jfarmer08 / ha-sengledapi

Home Assistant Integration for Sengled Bulbs. This is a custom component to allow control of Sengled Bulbs in Homeassistant using the unofficial Sengled API. Please note this mimics the Sengled app and therefore Sengled may cut off access at anytime.
Apache License 2.0
104 stars 34 forks source link

State Not Updating #71

Closed ZackWilson90 closed 2 years ago

ZackWilson90 commented 2 years ago

This may not be a bug, but rather me not understanding the features of this integration properly. I use home assistant primarily to view data and not control at the moment. When I turn a bulb on or off through Alexa or the Sengled app, the state of that bulb shown in home assistant doesn’t change. I assume it only polls the state when telling the bulbs to change? Would there be a way to add automatic state polling or is there a limitation on the API? Thanks!

Sandman224 commented 2 years ago

I seem to have the same issue. Affects light groups of only sengled bulbs for some reason. If an automation turns on the bulbs the state will not update but it does update when turning off through another automation?!? It's very strange. Could home assistant be set to poll the status of the lights at a regular interval or a configurable interval preferably?

jfarmer08 commented 2 years ago

The current SCAN_INTERVAL is 10 second's.

ZackWilson90 commented 2 years ago

Was able to get the logger running and found this: Logger: homeassistant.components.websocket_api.http.connection Source: components/websocket_api/connection.py:96 Integration: Home Assistant WebSocket API (documentation, issues) First occurred: 12:51:24 PM (8 occurrences) Last logged: 12:51:24 PM

[547888254304] Received invalid command: hacs/subscribe

jfarmer08 commented 2 years ago

Reporting an Issue

  1. Setup your logger to print debug messages for this component by adding this to your configuration.yaml:
    logger:
      default: warning
      logs:
        custom_components.sengledapi: debug
  2. Restart HA
  3. Verify you're still having the issue
  4. File an issue in this Github Repository
ZackWilson90 commented 2 years ago

I'm going to close this issue. Technically it didn't resolve, I just ended up deciding to use the ZHA integration and bypass the Sengled system all together.

dlangerm commented 2 years ago

@jfarmer08 @ZackWilson90 I've submitted a PR to fix this issue (I also had a similar problem).

dlangerm commented 2 years ago

PS. I only have the element bulbs with a hub so I'm unable to test if this breaks other things (it looks like the blame for the line was for an issue with switches).