Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frauhottelmann/8767237a2ca64f3b349b41fe87e7942a to your computer and use it in GitHub Desktop.
Save frauhottelmann/8767237a2ca64f3b349b41fe87e7942a to your computer and use it in GitHub Desktop.
blueprint:
name: Zigbee2MQTT - OSRAM Smart+ switch mini (AC0251100NJ/AC0251600NJ/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
integration: mqtt
multiple: false
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_down_release:
name: Up or Down Release
description: Action to run on up or down release 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:
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: 'on'
- platform: state
entity_id: !input button_sensor
to: 'brightness_move_up'
- platform: state
entity_id: !input button_sensor
to: 'brightness_stop'
- platform: state
entity_id: !input button_sensor
to: 'brightness_move_to_level'
- platform: state
entity_id: !input button_sensor
to: 'move_to_saturation'
- platform: state
entity_id: !input button_sensor
to: 'hue_stop'
- platform: state
entity_id: !input button_sensor
to: 'off'
- platform: state
entity_id: !input button_sensor
to: 'brightness_move_down'
action:
- variables:
action: "{{ trigger.to_state.state }}"
- choose:
- conditions: "{{ action == 'on' }}"
sequence: !input remote_button_up
- conditions: "{{ action == 'brightness_move_up' }}"
sequence: !input remote_button_up_hold
- conditions: "{{ action == 'brightness_stop' }}"
sequence: !input remote_button_up_down_release
- conditions: "{{ action == 'brightness_move_to_level' }}"
sequence: !input remote_button_circle
- conditions: "{{ action == 'move_to_saturation' }}"
sequence: !input remote_button_circle_hold
- conditions: "{{ action == 'hue_stop' }}"
sequence: !input remote_button_circle_release
- conditions: "{{ action == 'off' }}"
sequence: !input remote_button_down
- conditions: "{{ action == 'brightness_move_down' }}"
sequence: !input remote_button_down_hold
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment