Human readable Uptime (#986)

* Human readable Uptime

* Uptime from Frenck code

* Uptime with Frenck code

* Updated Human Readable Uptime

* Removed trailing spaces

* Renamed sensor to "Last started"

Sensor renamed
Update moved to the boot process
Clean-up

---------

Co-authored-by: Edward Firmo <94725493+edwardtfn@users.noreply.github.com>
Co-authored-by: Edward Firmo <edward@costafirmo.com>
This commit is contained in:
w00zy
2023-08-21 14:32:29 +01:00
committed by GitHub
parent d8e181fdda
commit be9b189a61
2 changed files with 18 additions and 6 deletions

View File

@@ -31,6 +31,9 @@ Since in this update lots of input to the blueprint changed, we highly recommend
3. Removed entity `sensor.xxxxx_settings_entity` and service `esphome.xxxxx_set_settings_entity`.
4. Due to the changes on the time display engine, you might have to select your time format again in the blueprint settings.
5. The network settings was moved to under `networks` on the `wifi` session. If you are using advanced/custom settings for Wi-Fi on ESPHome, you may have to update to follow the new format.
6. The sensor "Uptime" is deprecated. It was replaced by "Last started" sensor, which makes it more readable to humans on Home Assistant interface. Thanks to @WZYProjects (#986) for the new sensor.<br>
![image](https://github.com/Blackymas/NSPanel_HA_Blueprint/assets/94725493/282c1ea2-2919-4f40-a413-6fe572a155ce)
&nbsp;
## Overview of all changes
@@ -58,7 +61,6 @@ The first add-on available is an **[embedded thermostat/heater](/docs/en/addon_c
Please refeer to the [documentation](/docs/en/addon_climate.md) to get more details on how to enable this add-on.
&nbsp;
### 2. Alarm control panel
Now you can control an Alarm Control Panel from your NSPanel, which will allow you to set the alarm mode between the standard modes supported by Home Assistant (Home, Away, Night, Vacation or Custom bypass) or disarm the alarm.
@@ -140,6 +142,8 @@ See here: https://github.com/Blackymas/NSPanel_HA_Blueprint/labels/roadmap
## What's Changed
* @chpego - Fixes on the blueprint UI (#928)
* @WZYProjects - Human readable "Last started" sensor (#986)
## New Contributors
*
* @chpego
* @WZYProjects

View File

@@ -823,10 +823,15 @@ binary_sensor:
##### START - SENSOR CONFIGURATION #####
sensor:
##### Uptime #####
- name: ${device_name} uptime
platform: uptime
disabled_by_default: true
##### Uptime Template #####
- name: ${device_name} Last started
id: last_started
platform: template
internal: false
device_class: timestamp
entity_category: diagnostic
accuracy_decimals: 0
update_interval: never
##### WIFI Signal stregth
- name: ${device_name} RSSI
@@ -1311,6 +1316,9 @@ display:
- lambda: id(disp1).set_component_text_printf("boot.esph_version", "%s", "${version}"); ### esphome-version ###
- wait_until:
api.connected
- sensor.template.publish:
id: last_started
state: !lambda 'return id(time_provider).utcnow().timestamp;'
- lambda: id(disp1).set_component_text_printf("boot.ip_addr", "%s", id(ip_address).state.c_str());
- delay: 1s
- number.set: