Skip to content

Instantly share code, notes, and snippets.

@TheGroundZero
Last active August 3, 2022 16:10
Show Gist options
  • Save TheGroundZero/3b583f5aaf76ffce0d746b0d07c9ed67 to your computer and use it in GitHub Desktop.
Save TheGroundZero/3b583f5aaf76ffce0d746b0d07c9ed67 to your computer and use it in GitHub Desktop.
Home Assistant configuration for Shelly 2.5 in Roller Mode
# Shelly 2.5
# Roller Mode
# Based on https://shelly-api-docs.shelly.cloud/?shell#shelly2-5-mqtt
# And https://www.home-assistant.io/integrations/cover.mqtt/
cover:
- platform: mqtt
name: Rolling Shutters
command_topic: shellies/shellyswitch25-<deviceid>/roller/0/command # rc, open, close and stop
state_topic: shellies/shellyswitch25-<deviceid>/roller/0 # open, close, stop
position_topic: shellies/shellyswitch25-<deviceid>/roller/0/pos
set_position_topic: shellies/shellyswitch25-<deviceid>/roller/0/command/pos
availability_topic: shellies/shellyswitch25-<deviceid>/online
json_attributes_topic: shellies/shellyswitch25-<deviceid>/info
payload_open: open
payload_close: close
payload_stop: stop
state_opening: open
state_closing: close
position_open: 100
position_closed: 0
payload_available: true
payload_not_available: false
qos: 1
switch:
- platform: mqtt
name: Rolling Shutters - FW upgrade
command_topic: shellies/shellyswitch25-<deviceid>/command
payload_on: update_fw
binary_sensor:
- platform: mqtt
name: Rolling Shutters - switch open
payload_on: 1
payload_off: 0
state_topic: shellies/shellyswitch25-<deviceid>/input/0
- platform: mqtt
name: Rolling Shutters - switch close
payload_on: 1
payload_off: 0
state_topic: shellies/shellyswitch25-<deviceid>/input/1
- platform: mqtt
name: Rolling Shutters - overtemperature
payload_on: 1
payload_off: 0
state_topic: shellies/shellyswitch25-<deviceid>/overtemperature
- platform: mqtt
name: Rolling Shutters - firmware available
payload_on: true
payload_off: false
value_template: "{{ value_json.new_fw }}"
state_topic: shellies/shellyswitch25-<deviceid>/announce
sensor:
- platform: mqtt
name: Rolling Shutters - temperature
device_class: temperature
unit_of_measurement: '°C'
state_topic: shellies/shellyswitch25-<deviceid>/temperature
- platform: mqtt
name: Rolling Shutters - power consumption
device_class: power
unit_of_measurement: 'W'
state_topic: shellies/shellyswitch25-<deviceid>/roller/0/power
- platform: mqtt
name: Rolling Shutters - energy consumption since last reboot
device_class: energy
unit_of_measurement: 'Wh'
value_template: "{{ value | float / 60 }}"
state_topic: shellies/shellyswitch25-<deviceid>/roller/0/energy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment