Skip to content

Instantly share code, notes, and snippets.

@elRadix
Forked from nsotnikov/configuration.yaml
Last active April 19, 2018 16:42
Show Gist options
  • Save elRadix/f1a5cd6e3d6dd2b221dc4d67fd9923bc to your computer and use it in GitHub Desktop.
Save elRadix/f1a5cd6e3d6dd2b221dc4d67fd9923bc to your computer and use it in GitHub Desktop.
Home Assistant, one click upgrade all Sonoff-Tasmota devices, check the current installed and latest available version of firmware.
# Just an example how to check and upgrade the sonoff-tasmota from the Home Assistant
# Twitter link: https://goo.gl/e3y7pa
#
# 1. Open your sonoff webinterface and add in the "Firmware Upgrade" menu following OTA Url, save! Example: https://goo.gl/6ZMjzA
# OTA Url: http://sonoff.maddox.co.uk/tasmota/sonoff.bin
#
# 2. Below the Home Assistant configuration:
script:
check_sonoffs_version:
sequence:
- service: mqtt.publish
data_template:
topic: "cmnd/sonoffs/status"
payload: 2
update_sonoffs:
sequence:
- service: mqtt.publish
data_template:
topic: "cmnd/sonoffs/upgrade"
payload: 1
sensor:
- platform: rest
name: Sonoff latest release
resource: https://api.github.com/repos/arendst/Sonoff-Tasmota/releases/latest
value_template: '{{ value_json.tag_name }}'
headers:
Accept: application/vnd.github.v3+json
Content-Type: application/json
User-Agent: Home Assistant REST sensor
- platform: mqtt
name: Sonoff 01 Version
state_topic: "stat/sonoff01/STATUS2"
value_template: "{{ value_json['StatusFWR'].Version }}"
- platform: mqtt
name: Sonoff 02 Version
state_topic: "stat/sonoff02/STATUS2"
value_template: "{{ value_json['StatusFWR'].Version }}"
- platform: mqtt
name: Sonoff 03 Version
state_topic: "stat/sonoff03/STATUS2"
value_template: "{{ value_json['StatusFWR'].Version }}"
- platform: mqtt
name: Sonoff 04 Version
state_topic: "stat/sonoff04/STATUS2"
value_template: "{{ value_json['StatusFWR'].Version }}"
- platform: mqtt
name: Sonoff 05 Version
state_topic: "stat/sonoff05/STATUS2"
value_template: "{{ value_json['StatusFWR'].Version }}"
- platform: mqtt
name: Sonoff 06 Version
state_topic: "stat/sonoff06/STATUS2"
value_template: "{{ value_json['StatusFWR'].Version }}"
- platform: mqtt
name: Sonoff 07 Version
state_topic: "stat/sonoff07/STATUS2"
value_template: "{{ value_json['StatusFWR'].Version }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment