Mixiaoxiao / Arduino-HomeKit-ESP8266

Native Apple HomeKit accessory implementation for the ESP8266 Arduino core.
MIT License
1.48k stars 278 forks source link

Switch always reboot as OFF #165

Open SgtFoose opened 2 years ago

SgtFoose commented 2 years ago

Sorry I'm not a code expert but by looking at the code, shouldnt it return to its last known state after a power loss?

If not, how to modify the code to make it reboot as SWITCH ON after a reboot?

PS using default code as is posted with just my SSID and PW.

hitenlulla commented 2 years ago

When your device restarts it will always go back to the off state, you can store the values over the internet (I use MQTT) or in SPIFFS (Internal file system) so that your device takes the stored value and not the default off value when it restarts.

SgtFoose commented 2 years ago

When your device restarts it will always go back to the off state, you can store the values over the internet (I use MQTT) or in SPIFFS (Internal file system) so that your device takes the stored value and not the default off value when it restarts. It would be great if this feature could be integrated in the master. For now, do you know how I can hard-code it to start as ON?

hitenlulla commented 2 years ago

https://youtu.be/pfJROpQg-Is This should be a good start point to get used to SPIFFS and Arduino JSON. Try it out and still if you don't find a solution, connect with me at https://www.linkedin.com/in/hiten-lulla-a434201aa