Time input param from EEPROM

I prefer using time input widget over automations, so I programmed being able using the time inputs on Blynk for starting the lights. So I can fastly setup and change the times without changing automations. A disadvantage of this method is however that the data is stored in the software, so it is gone when the Arduino is powered off. Therefore I would like to store the data of the time input param in Eeprom and get this data back when the Arduino starts up. I think I can handle writing the data to Eeprom (I think every datapart like t.getStartHour(), t.getStartMinute(), etc…to a position of the Eeprom), but how should I assign these values back to the specific parts of the time input param after startup, I mean in the software instead of using the mobile dashboard? Is there something possible like for example t.StartHour() = 10?

That’s not the best approach. You can write the data to the server, then use the sync command to retrieve the data from the server after any reset.

The data is already stored on the server, in the time input widget, so it just needs a Blynk.syncVirtual(vPin) for the virtual pin that the time input widget is attached to, in the BLYNK_CONNECTED() callback.

@Carlimero are you looking to implement offline timer operations, that ruin when your internet is down?
If so, what hardware are you using?


1 Like

Thanks. I am using Wemos, but I think I’ll try the SyncVirtual option, assuming the internet will be almost always available.