-
Notifications
You must be signed in to change notification settings - Fork 196
Closed
Labels
Description
Firstly - Kudos on the project
secondly - i have a request, can you please have the unit turn on, and send the stat/sonoff/LIGHT topic on boot.
I am integrating with Home Assistant, but my units are also switched by the mains (due to WAF). so they are regularly turned off. Ultimately, whenever the unit gets power, i want it to automatically turn on and send it's status out.
I have been playing with setting it at the end of setup(), just after the relay pin is assigned. However i am not 100% sure on how to implement. I have looked at trying to emulate a button press:
char scmnd[20];
snprintf_P(scmnd, sizeof(scmnd), commands[1]);
strtok(scmnd, " ");
send_button(scmnd);
do_cmnd(scmnd);
but to be honest - i don't really understand C that well.
any help would be super!
cheers,