I want to display the amount of time an ESP32 device has been turned on days/hours/minutes
Using an lcd2004 but could be an oled
I can figure out how to display “timer” I just can’t figure out how the get it
Tried looking at duty cycle
Thanks,
The uptime sensor ~works, but on my display it shows either secs, mins, days, etc
I suppose I could use days as I am looking for Day 15 and day 17 in reality, but it would be much sexier to see Days:hours:mins
I suppose I could just create 3 sensors, one for each.
When I look at the sensor in HA it looks good.
Afraid I cannot figure out your second suggestion, on_time triger
You can create a global variable, a number type specifically. This number will be saved through restarts. This will represent seconds. Set the restore value to yes
# Example configuration entry
globals:
- id: my_global_int
type: int
restore_value: yes
initial_value: '0'
Then use one of the time triggers set to trigger every second. Increase the global by 1
I was under the impression you were trying to keep this all on the esp32. It’s easier to do this in home assistant and then bring the value back to the esp.
Add a binary sensor to the esp
*Edit it says mqtt but it is also applicable if you don’t use mqtt
Use that to create
bring that value back to the esp using the homeassistant platform.