Removing old command line sensors

This commit is contained in:
Jeffrey Stone 2019-11-09 10:22:55 -05:00
parent 96da697b23
commit 385102f467
1 changed files with 25 additions and 25 deletions

View File

@ -32,25 +32,25 @@ sensor:
# - platform: cert_expiry # - platform: cert_expiry
# host: !secret ahsl_base_url # host: !secret ahsl_base_url
# name: SSL Cert Expiration # name: SSL Cert Expiration
- platform: command_line # - platform: command_line
name: "HA Uptime" # name: "HA Uptime"
command: echo "$(($(date +%s) - $(date -d "$(head -n1 /home/homeassistant/.homeassistant/home-assistant.log | cut -d' ' -f-2)" +%s)))" # command: echo "$(($(date +%s) - $(date -d "$(head -n1 /home/homeassistant/.homeassistant/home-assistant.log | cut -d' ' -f-2)" +%s)))"
scan_interval: 720 # scan_interval: 720
value_template: >- # value_template: >-
{% set uptime = value | int %} # {% set uptime = value | int %}
{% set seconds = uptime % 60 %} # {% set seconds = uptime % 60 %}
{% set minutes = ((uptime % 3600) / 60) | int %} # {% set minutes = ((uptime % 3600) / 60) | int %}
{% set hours = ((uptime % 86400) / 3600) | int %} # {% set hours = ((uptime % 86400) / 3600) | int %}
{% set days = (uptime / 86400) | int %} # {% set days = (uptime / 86400) | int %}
{%- if days > 0 -%} # {%- if days > 0 -%}
{%- if days == 1 -%} # {%- if days == 1 -%}
1 day # 1 day
{%- else -%} # {%- else -%}
{{ days }} days # {{ days }} days
{%- endif -%} # {%- endif -%}
{{ ', ' }} # {{ ', ' }}
{%- endif -%} # {%- endif -%}
{{ '%02d' % hours }}:{{ '%02d' % minutes }} # {{ '%02d' % hours }}:{{ '%02d' % minutes }}
- platform: template - platform: template
sensors: sensors:
current_version_ha: current_version_ha:
@ -68,12 +68,12 @@ sensor:
- platform: version - platform: version
name: Released Hassio Ver name: Released Hassio Ver
source: hassio source: hassio
- platform: command_line # - platform: command_line
name: ha_v2db # name: ha_v2db
command: "ls -sh /home/homeassistant/.homeassistant/home-assistant_v2.db | cut -f1 -d ' '" # command: "ls -sh /home/homeassistant/.homeassistant/home-assistant_v2.db | cut -f1 -d ' '"
- platform: command_line # - platform: command_line
name: ha_log # name: ha_log
command: "ls -sh /home/homeassistant/.homeassistant/home-assistant.log | cut -f1 -d ' '" # command: "ls -sh /home/homeassistant/.homeassistant/home-assistant.log | cut -f1 -d ' '"
- platform: uptime - platform: uptime
name: Time Online name: Time Online
unit_of_measurement: days unit_of_measurement: days