Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sensors.yaml:
- - platform: rest
- name: Home Assistant Released Version
- json_attributes:
- - body
- - html_url
- resource: https://api.github.com/repos/home-assistant/home-assistant/releases/latest
- username: !secret github_username
- password: !secret github_access_token
- authentication: basic
- value_template: '{{ value_json.tag_name }}'
- headers:
- Accept: application/vnd.github.v3+json
- Content-Type: application/json
- User-Agent: Home Assistant REST sensor
- - platform: version
- automation.yaml:
- - alias: Home Assistant Release Check
- initial_state: on
- trigger:
- - platform: state
- entity_id: sensor.home_assistant_release
- - platform: homeassistant
- event: start
- condition:
- condition: template
- value_template: "{{ states('sensor.home_assistant_released_version') != states('sensor.current_version') }}"
- action:
- - service: persistent_notification.create
- data_template:
- title: Home Assistant Release
- message: >-
- A new version of Home Assistant is available, {{ states('sensor.home_assistant_released_version') }}, while current version is {{states('sensor.current_version') }}
- Link: {{states.sensor.home_assistant_released_version.attributes.html_url}}
- Release notes:
- {{states.sensor.home_assistant_released_version.attributes.body.split("## All changes")[0]}}
- - service: notify.telegram_notifier
- data_template:
- message: >-
- A new version of Home Assistant is available, {{ states('sensor.home_assistant_released_version') }}, while current version is {{states('sensor.current_version') }}
- Link: {{states.sensor.home_assistant_released_version.attributes.html_url}}
- Release notes:
- {{states.sensor.home_assistant_released_version.attributes.body.split("## All changes")[0]}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement