Github Gist: https://gist.github.com/freakshock88/1f4c349d9123114f821ce7a4e03bad52
Main features
Define actions for each button press type (up, up_hold, up_release, down_release, circle_release, circle_hold, down, down_hold, circle_click).
Supported device
This blueprint supports the OSRAM AC0251100NJ/AC0251700NJ device through Zigbee2MQTT only.
Prerequisites
You need to have a sensor entity for the button you want to use from Zigbee2MQTT.
Choose the right sensor with your button name and the entity id which ends with ā_actionā, e.g. āsensor.kitchen.switch_actionā
Blueprint
Click the badge to import this Blueprint: (needs Home Assistant Core 2021.3 or higher)
Or import this Blueprint by using the forum topic URL:
blueprint:
name: Zigbee2MQTT - OSRAM Smart+ switch mini (AC0251100NJ/AC0251700NJ) actions
description: >
Define actions for your OSRAM Smart+ switch mini using Zigbee2MQTT.
For your button entity, choose the right sensor with your button name and the entity id which ends with '_action', e.g. 'sensor.kitchen.switch_action'
domain: automation
input:
button_sensor:
name: OSRAM Smart+ switch mini sensor entity
description: Sensor for OSRAM Smart+ switch mini to use (Use sensor with entity_id ends with _action)
selector:
entity:
domain: sensor
remote_button_up:
name: Up Press
description: Action to run on up press
default: []
selector:
action:
remote_button_up_hold:
name: Up Hold
description: Action to run on up hold
default: []
selector:
action:
remote_button_up_release:
name: Up Release
description: Action to run on up release
default: []
selector:
action:
remote_button_circle:
name: Circle Press
description: Action to run on circle press
default: []
selector:
action:
remote_button_circle_hold:
name: Circle Hold
description: Action to run on circle hold
default: []
selector:
action:
remote_button_circle_release:
name: Circle Release
description: Action to run on circle release
default: []
selector:
action:
remote_button_down:
name: Down Press
description: Action to run on down press
default: []
selector:
action:
remote_button_down_hold:
name: Down Hold
description: Action to run on down hold
default: []
selector:
action:
remote_button_down_release:
name: Down Release
description: Action to run on down release
default: []
selector:
action:
mode: restart
max_exceeded: silent
# Each option is explicitly defined as a trigger because sensor reports empty values as well.
# Not defining explicit triggers causes the automation to show up in the log multiple times per button press.
trigger:
- platform: state
entity_id: !input button_sensor
to: 'up'
- platform: state
entity_id: !input button_sensor
to: 'up_hold'
- platform: state
entity_id: !input button_sensor
to: 'up_release'
- platform: state
entity_id: !input button_sensor
to: 'circle_click'
- platform: state
entity_id: !input button_sensor
to: 'circle_hold'
- platform: state
entity_id: !input button_sensor
to: 'circle_release'
- platform: state
entity_id: !input button_sensor
to: 'down'
- platform: state
entity_id: !input button_sensor
to: 'down_hold'
- platform: state
entity_id: !input button_sensor
to: 'down_release'
action:
- variables:
action: "{{ trigger.to_state.state }}"
- choose:
- conditions: "{{ action == 'up' }}"
sequence: !input remote_button_up
- conditions: "{{ action == 'up_hold' }}"
sequence: !input remote_button_up_hold
- conditions: "{{ action == 'up_release' }}"
sequence: !input remote_button_up_release
- conditions: "{{ action == 'circle_click' }}"
sequence: !input remote_button_circle
- conditions: "{{ action == 'circle_hold' }}"
sequence: !input remote_button_circle_hold
- conditions: "{{ action == 'circle_release' }}"
sequence: !input remote_button_circle_release
- conditions: "{{ action == 'down' }}"
sequence: !input remote_button_down
- conditions: "{{ action == 'down_hold' }}"
sequence: !input remote_button_down_hold
- conditions: "{{ action == 'down_release' }}"
sequence: !input remote_button_down_release
Changelog
- 2021-03-01: Initial version
If you have any issues or questions, please let me know