Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sonoff L1 not changing color in scenes #513

Closed
Zip753 opened this issue May 22, 2021 · 5 comments
Closed

Sonoff L1 not changing color in scenes #513

Zip753 opened this issue May 22, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@Zip753
Copy link

Zip753 commented May 22, 2021

Hi, I'm new to Home Assistant and I'm trying to migrate scenes from SmartThings. I have a Sonoff L1 LED strip which I have successfully connected to Home Assistant via your integration, and I'm trying to add it to scenes. The problem is that when I'm activating the scene, all the other lights are switching colors to the ones configured in the scene, however Sonoff L1 strip just turns on to the last color that it had.

Here's an example of such scene (light.sonoff_living_room_bookshelf_led_strip is the entity for L1):

- id: '1621584204609'
  name: Nordic vibes
  entities:
    switch.evening_lights_outlet:
      friendly_name: Evening lights outlet
      state: 'on'
    light.yeelight2_kitchen_table_light:
      min_mireds: 153
      max_mireds: 588
      effect_list:
      - Strobe color
      - Police
      - Christmas
      - RGB
      - Random Loop
      - Fast Random Loop
      - LSD
      - Slowdown
      - Night Mode
      - Date Night
      - Movie
      - Sunrise
      - Sunset
      - Romance
      - Happy Birthday
      - Disco
      - Strobe epilepsy!
      - Alarm
      - Police2
      - WhatsApp
      - Facebook
      - Twitter
      - Home
      - Candle Flicker
      - Slow Temp
      - Stop
      supported_color_modes:
      - color_temp
      - hs
      color_mode: hs
      brightness: 128
      hs_color:
      - 267.765
      - 100
      rgb_color:
      - 118
      - 0
      - 255
      xy_color:
      - 0.207
      - 0.072
      color_temp: 153
      flowing: false
      music_mode: false
      friendly_name: Kitchen table light
      supported_features: 63
      state: 'on'
    light.yeelight2_living_room_light:
      min_mireds: 153
      max_mireds: 588
      effect_list:
      - Strobe color
      - Police
      - Christmas
      - RGB
      - Random Loop
      - Fast Random Loop
      - LSD
      - Slowdown
      - Night Mode
      - Date Night
      - Movie
      - Sunrise
      - Sunset
      - Romance
      - Happy Birthday
      - Disco
      - Strobe epilepsy!
      - Alarm
      - Police2
      - WhatsApp
      - Facebook
      - Twitter
      - Home
      - Candle Flicker
      - Slow Temp
      - Stop
      supported_color_modes:
      - color_temp
      - hs
      color_mode: hs
      brightness: 128
      hs_color:
      - 194.062
      - 75.294
      rgb_color:
      - 63
      - 210
      - 255
      xy_color:
      - 0.162
      - 0.271
      color_temp: 588
      flowing: false
      music_mode: false
      friendly_name: Living room light
      supported_features: 63
      state: 'on'
    light.sonoff_living_room_bookshelf_led_strip:
      effect_list:
      - Colorful
      - Colorful Gradient
      - Colorful Breath
      - DIY Gradient
      - DIY Pulse
      - DIY Breath
      - DIY Strobe
      - RGB Gradient
      - DIY Gradient
      - RGB Breath
      - RGB Strobe
      - Music
      supported_color_modes:
      - hs
      color_mode: hs
      brightness: 222
      hs_color:
      - 240
      - 100
      rgb_color:
      - 0
      - 0
      - 255
      xy_color:
      - 0.136
      - 0.04
      effect: Colorful
      manufacturer: SONOFF
      model: L1
      sw_version: PSF-BTA-GL v3.4.0
      cloud: online
      rssi: -45
      friendly_name: Living room bookshelf LED strip
      supported_features: 21
      state: 'on'

I have enabled debug logs for sonoff and whenever I activate the scene nothing is happening in the logs, meaning that the request is never sent to the device, which explains why the device doesn't react. At the same time, I can see that the icon on the Lovelace dashboard changes to the color that I specified in the scene, so I suspect that the internal state of the entity is indeed updated, however for some reason the actual request to the device never comes through. Just to give you some more context, this is what I see in the logs when I simply toggle the L1 from the Lovelace dashboard:

2021-05-22 16:22:49  DEBUG    sonoff_cloud  1000f7e797 => Cloud4 | {'switch': 'on'} | 1621689769143
2021-05-22 16:22:49  DEBUG    sonoff_cloud  1000f7e797 <= Cloud3 | {'error': 0, 'deviceid': '1000f7e797', 'apikey': '...', 'sequence': '1621689769143'}
2021-05-22 16:22:49  DEBUG    sonoff_cloud  1000f7e797 => Cloud5 | Force update sequence: 1621689769319
2021-05-22 16:22:49  DEBUG    sonoff_cloud  1000f7e797 <= Cloud3 | {'error': 0, 'deviceid': '1000f7e797', 'apikey': '...', 'sequence': '1621689769319', 'params': {'bindInfos': {'smartThings': []}, 'version': 8, 'only_device': {'ota': 'success'}, 'sledOnline': 'on', 'ssid': '...', 'bssid': '...', 'switch': 'on', 'light_type': 1, 'colorR': 255, 'colorG': 127, 'colorB': 0, 'bright': 87, 'mode': 1, 'speed': 100, 'sensitive': 1, 'rssi': -45, 'fwVersion': '3.4.0', 'staMac': '...'}}

I went to developer tools and attempted to set the state of light.sonoff_living_room_bookshelf_led_strip to the exact same state as in scenes.yaml (except for the state: 'on'), and the same thing happened - I could see in the table below that the state got updated, but the logs were empty and the device didn't change the color.

I have peeked into the source and read some developer docs from Home Assistant, however I haven't found how exactly "set state" updates the entities - I suppose some default behavior from the light domain updates the state, however I don't know which code from the platform integration is called at that moment. I have found this in the docs: https://developers.home-assistant.io/docs/reproduce_state_index/ Maybe this is something that will have to be implemented in order to send the request to the device upon activating a scene?


Some more technical details:

  • I have only installed Sonoff LAN via HACS and don't have any other Sonoff integration
  • SonoffLAN version - 2.4.6
  • only configured username and password in the sonoff config, so running in the default cloud + local mode
  • L1 is only registered as an entity, no device for it is available (so e.g. in the scene I'm adding it as an entity, unlike other bulbs which I add as devices)
  • all L1 details should be visible in the entity definition in the scene above
  • also pasting default HA stats below

System Health

version core-2021.5.4
installation_type Home Assistant OS
dev false
hassio true
docker true
virtualenv false
python_version 3.8.9
os_name Linux
os_version 5.4.83-v8
arch aarch64
timezone Europe/Tallinn
Home Assistant Community Store
GitHub API ok
Github API Calls Remaining 4995
Installed Version 1.12.3
Stage running
Available Repositories 822
Installed Repositories 4
Home Assistant Cloud
logged_in true
subscription_expiration June 18, 2021, 3:00 AM
relayer_connected true
remote_enabled true
remote_connected true
alexa_enabled false
google_enabled true
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 5.13
update_channel stable
supervisor_version supervisor-2021.04.3
docker_version 19.03.15
disk_total 28.6 GB
disk_used 3.2 GB
healthy true
supported true
board rpi4-64
supervisor_api ok
version_api ok
installed_addons Visual Studio Code (3.4.0), File editor (5.3.0), Home Assistant Google Drive Backup (0.104.3)
Lovelace
dashboards 1
resources 0
mode auto-gen
@Zip753
Copy link
Author

Zip753 commented May 22, 2021

Another thing that I forgot to mention is that when I'm changing to the scene where I have set a different effect, e.g. Colorful Gradient, then it changes the effect in real life as well. If after that I activate the scene that has Colorful effect on (meaning just one static color), then it changes back to the last color that was set before changing to Colorful Gradient and not the one that is specified in the scene, so there's a high chance that the problem is only related to the color.

@coffedahl
Copy link

I have the same problem wont change colors in both automation and scenes

@AlexxIT AlexxIT added the enhancement New feature or request label Jun 7, 2021
@AlexxIT
Copy link
Owner

AlexxIT commented May 2, 2022

Is problem actual in latest SonoffLAN version?

@jiridostal
Copy link

@AlexxIT unfortunately yes, same issue here with the latest version

AlexxIT added a commit that referenced this issue May 4, 2022
@AlexxIT
Copy link
Owner

AlexxIT commented May 4, 2022

Fixed in latest master version. Will be in next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants