vintlabs / fauxmoESP

Add voice control of your ESP32 and ESP8266 devices using Amazon Alexa
MIT License
379 stars 70 forks source link

fauxmoESP Device does not maintain state, e.g. set "on" goes back to "off" in Alexa App #167

Open ekatus opened 3 years ago

ekatus commented 3 years ago

As shown in the examples, I handle Alexa actions in the onSetState callback. However, the current device state does not seem to be communicated to the Alexa or inquries are disregarded. So treating the "hue" lamp through the alexa app switches the device or changes the color, but the state is not persisted. fauxmoESP 3.2 on ESP32. Gen 3 dot and Alexa App on iphone XR.

Miq1 commented 3 years ago

Same here.

ToBiDi0410 commented 3 years ago

Are you using the Colour Branch or the Master Branch?

If you are using the Colour Branch, perhaps my last Pull Request, that was merged into the Colour Branch today, should fix this issue.

AndSeef commented 3 years ago

Same here. Tried the Colour Branch, unfortunately without any success. Is it necessary to send back the state after receiving a change with onSetState?

electroman00 commented 2 years ago

fauxmoESP Paul Vint 3.4.0

So I’ve done some testing and haven’t found a solution…however I have defined the issue further and updated the priority to critical.

If you use the alexa app to trigger the device the callback works fine each and every time on/off/on/off/on etc.

However…if you trigger the device via alexa Voice…the callback runs twice and the device state is now out of sync with the app.

Since I’ve stripped my script to bare bones minimum it has become clear to me there is a bug in the fauxmoESP lib in the way it handles app or Voice triggers!!

So now I’m off to digging into the libs…oh so much fun!

Try this script and open the Serial Monitor...remember to change SSID and Pass and do a alexa device discovery! sketch_nov03b_fauxmo1a.txt