Closes #851
This commit is contained in:
parent
9264c69494
commit
c48ceaa936
|
@ -118,8 +118,6 @@ logbook:
|
|||
- media_player.LivingRoomCC
|
||||
- py.warnings
|
||||
- sensor.epson_xp_7100_series_uptime
|
||||
- sensor.last_boot
|
||||
- sensor.last_boot_templated
|
||||
- sensor.small_garage_status
|
||||
- sensor.large_garage_status
|
||||
- sensor.small_garage_time_in_state
|
||||
|
@ -149,14 +147,11 @@ history:
|
|||
|
||||
exclude:
|
||||
entities:
|
||||
- sensor.last_boot
|
||||
- sensor.date
|
||||
- sensor.epson_xp_7100_series_uptime
|
||||
- sensor.pi_hole_ads_blocked_today
|
||||
- sensor.pi_hole_ads_percentage_blocked_today
|
||||
- sensor.pi_hole_dns_queries_today
|
||||
- sensor.last_boot
|
||||
- sensor.last_boot_templated
|
||||
- sensor.floorplan_date
|
||||
- sensor.floorplan_time
|
||||
- sensor.ha_uptime
|
||||
|
|
|
@ -13,8 +13,6 @@
|
|||
sensor:
|
||||
- platform: systemmonitor
|
||||
resources:
|
||||
# - type: last_boot
|
||||
- type: last_boot
|
||||
- type: disk_use_percent
|
||||
arg: /
|
||||
|
||||
|
|
|
@ -39,8 +39,6 @@ exclude:
|
|||
- sensor.pi_hole_ads_blocked_today
|
||||
- sensor.pi_hole_ads_percentage_blocked_today
|
||||
- sensor.pi_hole_dns_queries_today
|
||||
- sensor.last_boot
|
||||
- sensor.last_boot_templated
|
||||
- sensor.skybell_front_door_chime_level
|
||||
- sensor.small_garage_door_since
|
||||
- sensor.time
|
||||
|
|
|
@ -98,7 +98,7 @@ tweet_engine_random:
|
|||
"Beep. Bop. Beep. Boop. I am a #roBOT run by @CCostan",
|
||||
"I have spoken for about {{ states.sensor.speech_time.attributes.value|replace('m', '') }} minutes in the last 24 hours.",
|
||||
"When you add it all up, I have spoken for about {{ states.sensor.speech_time.attributes.value|replace('m', '') }} minutes in the last 24 hours!",
|
||||
"The #Docker Host has been running for {{ states('sensor.last_boot_templated') }} (https://www.vcloudinfo.com/2018/02/journey-to-docker.html)",
|
||||
"Home Assistant has been running for {{ states('sensor.ha_uptime') }} (https://www.vcloudinfo.com/2018/02/journey-to-docker.html)",
|
||||
"The #Docker Host for Home Assistant is using {{ states('sensor.disk_use_percent') }}% of the hard drive currently. (https://www.vcloudinfo.com/2018/02/journey-to-docker.html)",
|
||||
"I am running Home Assistant version {{ states('sensor.ha_installed_version') }} (https://github.com/CCOSTAN/Home-AssistantConfig#logo)",
|
||||
"{{ states.sensor.lines_of_code.state }} lines of Home Assistant configuration code has been running for {{ states('sensor.ha_uptime') }}. (https://github.com/CCOSTAN/Home-AssistantConfig#logo)",
|
||||
|
|
|
@ -1,48 +1,3 @@
|
|||
- platform: template
|
||||
sensors:
|
||||
last_boot_templated:
|
||||
entity_id: []
|
||||
value_template: >-
|
||||
{%- set slb = states.sensor.last_boot.state.split(' ') -%}
|
||||
{%- set count = slb | length -%}
|
||||
{%- set hms = slb[count - 1] -%}
|
||||
{%- set hms_trimmed = hms.split('.')[0] -%}
|
||||
{%- set hms_split = hms_trimmed.split(':') -%}
|
||||
{%- set hours = hms_split[0] | int -%}
|
||||
{%- set minutes = hms_split[1] | int -%}
|
||||
{%- set seconds = hms_split[2] | int -%}
|
||||
|
||||
{%- if count == 3 -%}
|
||||
{{ slb[0] ~ ' ' ~ slb[1] ~ ' ' }}
|
||||
{%- endif -%}
|
||||
{%- if hours > 0 -%}
|
||||
{%- if hours == 1 -%}
|
||||
1 hour
|
||||
{%- else -%}
|
||||
{{ hours }} hours
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{%- if minutes > 0 -%}
|
||||
{%- if hours > 0 -%}
|
||||
{{ ', ' }}
|
||||
{%- endif -%}
|
||||
{%- if minutes == 1 -%}
|
||||
1 minute
|
||||
{%- else -%}
|
||||
{{ minutes }} minutes
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{%- if seconds > 0 -%}
|
||||
{%- if hours > 0 or minutes > 0 -%}
|
||||
{{ ', ' }}
|
||||
{%- endif -%}
|
||||
{%- if seconds == 1 -%}
|
||||
1 second
|
||||
{%- else -%}
|
||||
{{ seconds }} seconds
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
|
||||
- platform: rest
|
||||
scan_interval: 86400
|
||||
resource: https://api.ipify.org/
|
||||
|
|
Loading…
Reference in New Issue