Hi, I put the uptime sensor in all my ESPhome configuration, works great but has a value in seconds, which is difficult to read (for me). I rather have it in hours and/or days.
Is it possible to change it in hours/days with ESPhome code, if yes, how? Thanks
To be sure to understand well the problem, you want to report multiple uptime from same physical device (which doesnât have much sense) or from differents ESPs ? If from different ESPs theyâll show up as different variables for sure in HA so not sure whatâs your problem there
Thanks for this! Iâm much happier having my ESP do the work instead of making more sensors in HA. I also learned I can control the number of decimal places:
No, actually at first I wondered if putting 3600.0 would make it add the decimal place, but then I figured out it didnât make any difference - I needed the accuracy_decimals statement. But I forgot to change it back to just 3600
Like the OP here, I wanted the Uptime Sensor in ESPHome to do the formatting and not have to have Home Assistant do the work. So, I offer this code snippet to @Klagio (and everyone else).
src\main.cpp:562:21: error: could not convert â{buffer}â from ââ to âesphome::optionalâ
return {buffer};
^
src\main.cpp:563:3: warning: control reaches end of non-void function [-Wreturn-type]
});
^
*** [.pioenvs\bw_shp6_powerplug_02\src\main.cpp.o] Error 1