bitfocus / companion-module-homeassistant-server

MIT License
12 stars 7 forks source link

companion on and off works, but toggle action doesn't toggle tuya via homeassistant-server #14

Closed lvnilesh closed 2 years ago

lvnilesh commented 2 years ago

Toggle used to work, but I upgraded bitfocus/companion to version 2.2.0 (2.2.0-71b95b9d-3683)

I observe the following:

What am I missing?

Julusian commented 2 years ago

Does the correct on/off state show in home-assistant? Does the feedback in companion for the on/off state of the entity work? Is it just the one, or all the light entities? Does it always turn off, or always on, or does nothing happen?

lvnilesh commented 2 years ago

When activated via companion, the Light turns ON but homeassistant shows OFF. Strange. Feedback in companion does NOT reflect the ON state. Also strange. I have just one light entity. It consistently turns OFF and always turns OFF via Companion but Homeassistant shows OFF all the time. Feedback in companion does not reflect the light state.

Where should I look next?

Julusian commented 2 years ago

This sounds like something weird going on in homeassistant, as it is showing that the light is off even when it is on. companion relies on the data from homeassistant to know the state of things, so it matching what is shown in homeassistant makes sense.

The toggling works by us looking at what homeassistant last told us the device is (is it on or off) and issuing a turn_on or turn_off to perform the toggle, so with it always showing as off we will always be issues an on as that is what we believe the toggle should be.

So I think you need to look into getting homeassistant to know the correct on/off state for the light

lvnilesh commented 2 years ago

Exactly.

The homeassistant app provided via getumbrel is busted.

I ran my own docker instance using homeassistant latest and all is well.

lvnilesh commented 2 years ago

Thanks for your help @Julusian