cgiesche / streamdeck-homeassistant

Control your Home Assistant devices from StreamDeck
MIT License
833 stars 41 forks source link

Toggle light group requires 2 presses to turn on, lost track of status? #105

Closed hjdarnel closed 2 years ago

hjdarnel commented 2 years ago

Hi, I recently found this plugin and I've been using it a bit.

I have a light group (2 lights) that I want to toggle when pressing a button.

I have dragged the Entity (custom icons) button to my streamdeck, successfully connected it to my HA instance, and set it up with Domain: light, Entity: my_light_group, and Service: toggle

If the light group is on, pressing the button turns them off and the Stream Deck button changes to "Off". After maybe 0.25 second, the Stream Deck button reverts to "On", with my lights still turned off. If I press the button once, the button shows "Off", and pressing again turns the lights on and the button properly changes to "On" again.

Basically, I can turn them off with one press, but requires two presses to turn back on (it immediately thinks the lights are back on, when I've just turned them off)

Hopefully this makes sense, I'm happy to explain further, but I think this is a pretty basic function.

cgiesche commented 2 years ago

Hi,

the plugin itself is stateless. Every change in button status is triggered by Home-Assistant, that means, a button only changes it's state (on/off) after home assistant sent an update. Can you please check, if the button state in the plugin matches the group state in the home assistant gui? Edit: You may also try what happens to your lights/button state if you switch the group in HA gui...

The behavior sounds strange...

hjdarnel commented 2 years ago

Thanks, I do think it's an issue with Home Assistant or the Zigbee Home Automation (ZHA) integration I'm using to control my lights. The light group does seem to revert to the incorrect state but I don't think that's the fault of the Stream Deck plugin.

Thanks for answering anyway :)