I will try next time it happens. Though as it is imported as a template, I don’t have an option to change mode.
Okay I’ve listened for zha_event in developer tools while this occured. I got an event upon button press, but no new event when the light turned back on by itself 10sec later.
event_type: zha_event
data:
device_ieee: bc:33:ac:ff:fe:89:19:00
unique_id: bc:33:ac:ff:fe:89:19:00:1:0x0006
device_id: fea0a0456ae6a181222c88871610c8c1
endpoint_id: 1
cluster_id: 6
command: "off"
args: []
params: {}
origin: LOCAL
time_fired: "2023-01-22T21:10:41.248810+00:00"
context:
id: 01GQDN3BB0KYAJ7SXD4S61VKHC
parent_id: null
user_id: null
And the Trace timeline:
Like I said, I cannot change mode from restart, because it is an imported blueprint, so home assistant won’t let me change anything.
And here it is from the logbook. (My 5 spots is in a zha group)
Is there anything else I can do?
If you do not see any zha_event, this means there is no action coming from homeassistant (and thus this blueprint/automation) to control that light.
Not sure why your light comes back on…
Hmm okay,
Bu then why does the logbook state both the on and off action are triggered by automation, triggered by event?
Anyways, thank you for the help, I’ll have keep looking for the cause.
Hi, you can try to use this version i posted earlier.
When the remote issues a “stop”, in the old version a “light.turn_on” command was sent. I removed it in this one.
https://gist.github.com/jongdesteven/e267f19575cafbe5fc0d756612717a63
Thank you, I will try that. I have just updated all my lights to this blueprint. I’ll report back!
I’ve been facing the same issue. I think the cause lies somewhere on a higher level but until that is fixed, I’ve managed to avoid the issue by removing transition values from the blueprint as shown below.
For example, edit this code:
sequence:
- service: light.turn_on
target: !input 'light'
data:
transition: 1
brightness_step_pct: -10
into:
sequence:
- service: light.turn_on
target: !input 'light'
data:
# transition: 1
brightness_step_pct: -10
Or, if transition value is the only data, remove (or just comment) the whole section like this:
sequence:
- service: light.turn_off
target: !input 'light'
# data:
# transition: 1
This Blueprint is working fantastic for me. The only annoying thing are these nasty error-messages that occur every time the remote goes into sleep-mode. Then Ι get 3 warnings, meaning that the 3 variables “endpoint_id, cluster_ic and command” are not assigned with a value. In order to avoid this I customized the Blueprint by adding the “endpoint_id” as an additional criterium to the trigger-section like so:
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input remote
endpoint_id: 1
This might not be the best solution but for me it works.
FYI I tweaked this to use with my osram zigbee switches and works fantastic. Thank you for the blueprint this was a lifesaver when setting up switches. It probably can be used with any zigbee switch id imagine but it’s worked for all mine.
Tried using this blueprint but HA doesn’t seem to find the “device” when I try to setup automation with this blueprint although it shows in Z2M.
Any ideas why?
Hi, got this blueprint up and running with a Trådfri dimmer. However, one thing is bugging me. When turning on the default brightness is 5%… I’ve tried setting the forced brightness levels up to 100% for both night and day, but still same results. Any ideas?
Having the same problem, looks like it has been discussed a bit previously but still not clear what the issue/fix is… One thing I noticed is when you hold the dimmer it defines the brightness in the device card on HA, but when you just press on it just says ‘on’ in the HA card without the brightness. It’s happening on hue bulbs and ikea bulbs connected via hue bridge.
Remove “transition: 1” from the turn_off action.
First of all, i’ve been using the blueprint for my on/off switch almost daily to switch several basic lights on and off… its been working great and i would like to thank you for that.
Today, i wanted to buy another remote for a specific group of lights.
As i was searching in IKEA, I came to the conclusion they discontinued this switch, but they replaced it with the “RODRET Dimmer”. I’ve edited your blueprint as you explain the model in (line 20), i changed it to model: RODRET Dimmer.
This same blueprint works great for the new remote!
Are you able to change this one blueprint so i can use it for both devices or do you want me to upload it myself? Other blueprints for the new RODRET remote just do actions for switches… i like your blueprint as it is so super simple to set up.
Can you test if this works for you?
blueprint:
It looks like i cannot import it…
I noticed you made a typo, it should be RODRET Dimmer.
However, that still doesnt make it work. thanks for the effort.
"
Invalid blueprint: expected str for dictionary value @ data[‘blueprint’][‘input’][‘remote’][‘selector’][‘model’]. Got None
"
Finally got it working.
The input section should be as this:
input:
remote:
name: Remote
description: The remote that will control the lights
selector:
device:
filter:
- integration: zha
manufacturer: 'IKEA of Sweden'
model: 'TRADFRI on/off switch'
- integration: zha
manufacturer: 'IKEA of Sweden'
model: 'RODRET Dimmer'
Fixed the gist.
How would you do that? I want this too – mimicking the original Ikea behaviour.
Hey poolcactus,
Thanks for the blueprint!
I modified it a bit to also support switches, my use cases being:
- being able to control ikea outlets to turn on/off the car engine heater in the winter (living in nordic country)
- being able to turn on/off light + outlet (Christmas led strips) at the same time
The outlets do not support dimming so a separate input was required. It’s still been able to dim the lights with an outlet if the same automation
“works on my home assistant” with Sky connect.
I found the repeat delay of 1s to be too long and set it to 300ms. I see no issues on my setup.
Here are the modifications:
blueprint:
name: ZHA - IKEA Tradfri on/off switch
description: 'Control your light(s) with IKEA Tradfri on/off switch
Select the Tradfri remote and your lights and or switch.
You can turn the lights and switches On / Off, or hold the buttons to dim
the lights.
'
domain: automation
input:
remote:
name: Remote
description: The remote that will control the lights
selector:
device:
integration: zha
manufacturer: IKEA of Sweden
model: TRADFRI on/off switch
multiple: false
light:
name: Light
description: The lights that will be controlled
default: {}
selector:
target:
entity:
- domain:
- light
switch:
name: Switch
description: The switches that will be controlled
default: {}
selector:
target:
entity:
- domain:
- switch
source_url: https://community.home-assistant.io/t/zha-ikea-tradfri-on-off-switch-incl-dimmer/255412
mode: restart
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input remote
action:
- variables:
command: "{{ trigger.event.data.command }}"
cluster_id: "{{ trigger.event.data.cluster_id }}"
endpoint_id: "{{ trigger.event.data.endpoint_id }}"
- choose:
- conditions:
- "{{ command == 'on' }}"
- "{{ cluster_id == 6 }}"
- "{{ endpoint_id == 1 }}"
sequence:
- service: switch.turn_on
target: !input switch
- service: light.turn_on
target: !input light
data:
transition: 1
- conditions:
- "{{ command == 'off' }}"
- "{{ cluster_id == 6 }}"
- "{{ endpoint_id == 1 }}"
sequence:
- service: switch.turn_off
target: !input switch
- service: light.turn_off
target: !input light
data:
transition: 1
- conditions:
- "{{ command == 'move_with_on_off' }}"
- "{{ cluster_id == 8 }}"
- "{{ endpoint_id == 1 }}"
sequence:
repeat:
while:
- condition: template
value_template: "{{ repeat.index < 10 }}"
sequence:
- service: light.turn_on
target: !input light
data:
transition: 1
brightness_step_pct: 10
- delay: 0.3
- conditions:
- "{{ command == 'move' }}"
- "{{ cluster_id == 8 }}"
- "{{ endpoint_id == 1 }}"
sequence:
repeat:
while:
- condition: template
value_template: "{{ repeat.index < 10 }}"
sequence:
- service: light.turn_on
target: !input light
data:
transition: 1
brightness_step_pct: -10
- delay: 0.3
- conditions:
- "{{ command == 'stop' }}"
- "{{ cluster_id == 8 }}"
- "{{ endpoint_id == 1 }}"
sequence:
- service: light.turn_on
target: !input light