Ikea Button - zha_event question

Hi There,

I just picked up one of the ikea buttons and I am setting it up in in Node Red?

I used zha_event to find the device ieee and how the buttons were identified as when they were pressed:

Centre - toggle
top - step_with_on_off
bottom - step
left - press
right - press

I was able to configure node red to assign different functions to the buttons but the problem I ran into is that because both left & right buttons had the command identification “press” if I assign something to the left button the right button triggers the same thing.

Does anyone know if it is possible to change the command from “press” to something else for the right button so that I can use all 6 buttons?

Thanks in advance

I ran into this also, under arguments the two buttons have a different number. I used a change node to move that number to payload and then assigned that to the function I wanted

here is the node that does it

[{"id":"630ff087.007ee","type":"change","z":"f0cb5c7e.9caa5","name":"","rules":[{"t":"move","p":"payload.event.command","pt":"msg","to":"payload","tot":"msg"},{"t":"move","p":"payload.event.args[0]","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":520,"wires":[["5298f49c.5af2fc"]]}]

Thank you for this,

Do I just add this nose to the existing flow?

yes you can check the output with a debug node although to be honest I just played with a blueprint that works awesome for this remote if you are using zha. ZHA - IKEA five button remote for lights

Not sure how you are sorting out the button id i use the “payload.event.device_ieee” in a switch node then the change node after that. Looking at it I think I shorted you a node I actually use 2 change nodes. I’ll post the whole flow for you to have a look at. This is probably not the most efficient way of doing this but I am new to node-red and always happy when I get something to work.

[{"id":"d340a9ea.3b59f8","type":"server-events","z":"f0cb5c7e.9caa5","name":"test","server":"","event_type":"zha_event","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"x":130,"y":380,"wires":[["3d20fb45.e87794"]]},{"id":"3d20fb45.e87794","type":"switch","z":"f0cb5c7e.9caa5","name":"test dimmer","property":"payload.event.device_ieee","propertyType":"msg","rules":[{"t":"eq","v":"68:0a:e2:ff:fe:7d:27:4b","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":270,"y":440,"wires":[["630ff087.007ee","7284548f.43bacc"]]},{"id":"630ff087.007ee","type":"change","z":"f0cb5c7e.9caa5","name":"","rules":[{"t":"move","p":"payload.event.command","pt":"msg","to":"payload","tot":"msg"},{"t":"move","p":"payload.event.args[0]","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":520,"wires":[["5298f49c.5af2fc"]]},{"id":"8b70bff.29e104","type":"api-call-service","z":"f0cb5c7e.9caa5","name":"living room light dim","server":"","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.living_room_lights","data":"{\"brightness_pct\":\"25\"}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":940,"y":580,"wires":[["75d146a9.3ca8a8"]]},{"id":"495af730.57b148","type":"api-call-service","z":"f0cb5c7e.9caa5","name":"living room light toggle","server":"","version":1,"debugenabled":false,"service_domain":"light","service":"toggle","entityId":"light.living_room_lights","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":900,"y":460,"wires":[[]]},{"id":"5298f49c.5af2fc","type":"switch","z":"f0cb5c7e.9caa5","name":"living room dimmer","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"toggle","vt":"str"},{"t":"eq","v":"step_with_on_off","vt":"str"},{"t":"eq","v":"move_with_on_off","vt":"str"},{"t":"eq","v":"step","vt":"str"},{"t":"eq","v":"move","vt":"str"},{"t":"eq","v":"256","vt":"str"},{"t":"eq","v":"257","vt":"str"}],"checkall":"true","repair":false,"outputs":7,"x":650,"y":540,"wires":[["495af730.57b148"],["bb55b15.13f085"],[],["8b70bff.29e104"],[],["7a99b032.4405d","a0a6423b.770a8"],["c753882.8779678"]]},{"id":"bb55b15.13f085","type":"api-call-service","z":"f0cb5c7e.9caa5","name":"living room light full","server":"","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.living_room_lights","data":"{\"brightness_pct\":\"100\"}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":910,"y":520,"wires":[[]]},{"id":"c753882.8779678","type":"api-call-service","z":"f0cb5c7e.9caa5","name":"hall light off","server":"","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.hallway_light","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":950,"y":700,"wires":[[]]},{"id":"7284548f.43bacc","type":"change","z":"f0cb5c7e.9caa5","name":"","rules":[{"t":"move","p":"payload.event.args[0]","pt":"msg","to":"payload.event.command","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":210,"y":600,"wires":[["630ff087.007ee"]]},{"id":"a0a6423b.770a8","type":"api-call-service","z":"f0cb5c7e.9caa5","name":"hall light on","server":"","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.hallway_light","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":950,"y":640,"wires":[[]]}]

it looks like there is also a long press argument for those 2 keys 3328 and 3329 so they could be assigned also.

Craig

Perfect I’ll take a look, I set my Samsung buttons up in Node Red and was hoping to keep everything together.

I did also find the Blueprint you mentioned and it was really simple to setup. The only thing I’m finding is the press and hold buttons are a bit hit & miss

I have been using node red for everything, figured I would just try to learn one thing. I haven’t used the press and hold side buttons but the dimming is working better than I could get it to work in node-red.
I have never so much as written a script so the learning curve for both is steep but I am getting the hang of node red. I have my xiaomi buttons set up in node red and they work great. I was missing webcore but now that I am getting the hang of node red I like it better.

1 Like

How are you finding the battery life with the Blueprint setup? I noticed mine dropped from 100% on Tuesday when I set it up to 60% this morning. That seems really excessive. I thought I read that somewhere else too

This flow worked perfectly with all 5 buttons thank you,

It will be interesting to see if the battery drains as quickly as it has been with the BluePrint setup (As I posted previously)

I see the same battery drain but I am going to run the blueprint for a week to see if it stabilizes. My problem with the Node-Red flow was I could not get dimming to work that well. The blueprint steps much better for me.

It’s funny that it drops to excactly 60% for both of us. it makes me question the accuracy of the reading.
If it’s dead in a week I will know for sure I guess.

I have quite a few battery powered sensors both Zigbee & Z-Wave from different manufacturers and the battery monitoring isn’t the best but none of them have ever dropped this quickly.

I will carry on using the BluePrint setup for now and monitor how long until it actually craps out. I typically get anywhere from 6 - 10 months from my other sensors

My battery went back up to 87% overnight lol

I made a note of when it was installed as I do with all my batteries and I will see how long before it craps out, I think I will take the battery readout with a pinch of salt.