This blueprint is basically the same as the 5-button version, but for use with the on/off-button.
The original use of the button is on or off (short presses) or brightness up (long pressing the on button) and brighness down (long pressing the off button).
But to make it more general, you select an action for on-short, off-short, on-long, off-long.
blueprint:
name: Ikea on/off-switch general use
description: "This blueprint is for the IKEA on/off-remote switch when used with zigbee2mqtt.
It is for genral use so all buttons can be connected to any action of your choice.
Make sure to select the correct sensor for the remote."
domain: automation
input:
remote:
name: Remote
description: IKEA remote to use
selector:
entity:
integration: mqtt
domain: sensor
on_button_short:
name: On button short
description: Action to run when ON button SHORT press
default: []
selector:
action: {}
off_button_short:
name: Off button short
description: Action to run when OFF button SHORT pressed
default: []
selector:
action: {}
on_button_long:
name: On button long
description: Action to run when ON button LONG pressed (brightness up)
default: []
selector:
action: {}
off_button_long:
name: Off button long
description: Action to run when OFF button LONG pressed (brightness down)
default: []
selector:
action: {}
mode: restart
max_exceeded: silent
trigger:
- platform: state
entity_id: !input "remote"
attribute: action
action:
- variables:
command: "{{ trigger.to_state.state }}"
- choose:
- conditions:
- "{{ command == 'on' }}"
sequence: !input "on_button_short"
- conditions:
- "{{ command == 'off' }}"
sequence: !input "off_button_short"
- conditions:
- "{{ command == 'brightness_move_up' }}"
sequence: !input "on_button_long"
- conditions:
- "{{ command == 'brightness_move_down' }}"
sequence: !input "off_button_long"
Thanks for your blueprint!
May you rename the Title and the Description?
Its pretty misleading to have an on-of switch named âIKEA 5-button remoteâ
blueprint:
name: zigbee2mqtt IKEA 2-button remote
description: "This blueprint is for the IKEA round, 2-button remote when used with zigbee2mqtt.
It is for general use so all buttons can be connected to any action of your choice"
but in case you just found this and didn hang along I managed to first publish the 5-button-version instead of the on/off-switch,so yeas, there is one as well, link at the top, and here
First you have to select the correct remote, And make sure itâs the corrext entity since there are a lot to choose from. If you havenât changed to much, the entity_id will contain action. ie sensor.my_remote_action
Then click the ADD ACTION button next to the button you want to controll and you will be able to select what action and entity to control, This will work the same as when you do a ânormalâ automation in the ui. If you are new to automations I suggest you take a look at the documentation on the home page where they have written far better instructions than I can do here.
The actions be a lot of different things, I for example have some buttons just turning on/off lamps, and other buttons will activate an input_boolean and do a lot of things at the same time, like when itâs bed-time it will turn off all my lights, lower the set-points, turn on my alarm, turn off the bedside lamp etc. Yet other will control the media-player volume.
So these blueprints (both this and the 5-button-version) are ment for those who would like to be able to use the remotes just as they like.
It I remember correctly, there are blueprints for zigbee2mqtt and IKEA 5-button remote that you assign a light and it will work like it would if you paired the remote and lamp directly.
Hope this will help, just get back otherwise, so itâs not the blueprints that are the problem.
It seems you are using the IKEA trÄdfri integration. This integration is ment for the zigbee2mqtt integration.
The âproblemâ is that different integrations have different ways of solving thingsâŠ
Now, unfortunatley I donât have an IKEA GW so canât test myself how much changes that needs to be done in order for it to work with the IKEA TrĂ„dfri integration, but if you are lucky, it might be quite easy.
Open up the blueprint file in an editor and remove the line integration: mqtt. This is used to filter the entities so you get a few less to scroll through, and kind of as the case is here, to filter out entities that are not compatible with the blueprint. If up want to you could replace mqtt with IKEA Tradfri to filter out only your trÄdfri-devices. But if you just remove the line you will have all your sensors showing up.
Save your changes and go to configuration -> server controls -> reload automations.
Now your device should show up, and with a bit of luck it is the same commands and it will work.
If it doesât, send me an PM and lets see if we can sort it out.
remote:
name: Remote
description: IKEA remote to use
selector:
entity:
integration: mqtt
domain: sensor
to:
remote:
name: Remote
description: IKEA remote to use
selector:
entity:
domain: sensor
Is it possible to support two actions per event? E.g. âOn button shortâ turns on a switch AND a light? At the moment Iâve had to create a group and use a single action.