From 95a0c72b370b5958926ab6a7a71e26f04e537a80 Mon Sep 17 00:00:00 2001 From: Jeffrey Stone Date: Mon, 7 Oct 2019 20:32:49 -0400 Subject: [PATCH] Moving to version platform for my HA version sensors. --- packages/sysmon.yaml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/packages/sysmon.yaml b/packages/sysmon.yaml index 4a899a1..8ceb877 100755 --- a/packages/sysmon.yaml +++ b/packages/sysmon.yaml @@ -51,15 +51,23 @@ sensor: {{ ', ' }} {%- endif -%} {{ '%02d' % hours }}:{{ '%02d' % minutes }} - - platform: command_line - command: python3 -c "import requests; print(requests.get('https://pypi.python.org/pypi/homeassistant/json').json()['info']['version'])" - name: Current HA Version - - platform: command_line + - platform: template + sensors: + current_version_ha: + #command: python3 -c "import requests; print(requests.get('https://pypi.python.org/pypi/homeassistant/json').json()['info']['version'])" + friendly_name: Current HA Version + value_template: >- + {{ states.binary_sensor.attributes.newest_version }} + - platform: version name: Installed version - command: "head -5 /home/homeassistant/.homeassistant/.HA_VERSION" + source: local + #command: "head -5 /home/homeassistant/.homeassistant/.HA_VERSION" + - platform: version + name: Released Version + source: pypi - platform: command_line name: ha_v2db command: "ls -sh /home/homeassistant/.homeassistant/home-assistant_v2.db | cut -f1 -d ' '" - platform: command_line name: ha_log - command: "ls -sh /home/homeassistant/.homeassistant/home-assistant.log | cut -f1 -d ' '" \ No newline at end of file + command: "ls -sh /home/homeassistant/.homeassistant/home-assistant.log | cut -f1 -d ' '"