My goal is to pass a HA timer attribute finishes at to a ESP and use the UNIX time in the ESP to calculate how many minutes and seconds there is left.
But I just can’t make it…
time: - platform: sntp id: sntp_time
and slightly further down:
auto time = id(sntp_time).now();
But where do I place that? I get errors where ever I place it.
I also tried to output the sntp_time:
it.printf(0, 120, id(my_font_small), id(sntp_time).state); it.printf(0, 120, id(my_font_small), id(sntp_time).now()); it.printf(0, 120, id(my_font_small), id(sntp_time).timestamp());
but none of them works.
I believe I need to use the timer sensor (
it.printf(0, 160, id(my_font_small), "%.0f", id(david).state);, works) and subtract the current timestamp and
it.strftime it to mm:ss.
My first attempt was to do the calculation to a sensor in HA and pass that to ESP but it only updated once a minute, so I figured I need to do the calculation on the board and.