home-assistant-glow
home-assistant-glow copied to clipboard
Add Uptime Sensor
I find it useful to have an Uptime Sensor in HA Glow. I've copied right away from the ESPHome-Page from the "Human readable sensor" Section
I'm not so familiar with GitHub, so I'm afraid I can't make a PR :-/ But maybe somebody can quickly copy/paste it into the project, is quite nice to know about it:

added https://github.com/klaasnicolaas/home-assistant-glow/pull/142 don't know if @klaasnicolaas needs to do something to make the tests verify the code :-/
What about this uptime sensor: https://github.com/klaasnicolaas/smarty-homeassistant-config/blob/master/esphome/sensors/uptime_timestamp.yaml
I'll give that a try. The idea sounds good to only send it once.
And?
There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!
Still something that is on my list to add 🤔
Doesn't this uptime sensor solve this issue?
Yep, I've been using the uptime sensor @mcchots mentions with success. Added the following to the esphome build definition yaml file:
- platform: uptime
name: Uptime
id: sensor_uptime
update_interval: 60s
Uptime is great, but rather than have to calculate backwards in time to work out when it last booted, I prefer to add one that updates once on each boot when the time syncs:
text_sensor:
- platform: template
name: "Last Boot"
id: device_last_boot
icon: mdi:clock
entity_category: diagnostic
time:
- platform: homeassistant
timezone: "Australia/Hobart"
id: homeassistant_time
on_time_sync:
then:
- if:
condition:
lambda: 'return id(device_last_boot).state == "";'
then:
- text_sensor.template.publish:
id: device_last_boot
state: !lambda 'return id(homeassistant_time).now().strftime("%a %d %b %Y - %I:%M:%S %p");'
Which gives you: