After this Input, the differnt Action, that i will do by pressing one of the buttons will be created.
This Ikea Button has 5 Buttons, Each of them can be used to send a signal for:
- press
- release
- long press
- double click
I use single press to:
- Toggle the main Light (Center button)
- Toggle the Light in the next room (Left Button)
- Switch the diffent Scenes, I created (Right click)
- Increase Brightness +25( (Up Click)
- Decrease Brightness -25( (Down Click)
- Increase and Decrease Brightness as long as I hold the Up/Down Buttons
[{“id”:“ad5c205a.6cb4a”,“type”:“switch”,“z”:“d3956bfe.d5e5c8”,“name”:“IKEA”,“property”:“payload.action”,“propertyType”:“msg”,“rules”:[{“t”:“eq”,“v”:“brightness_down_release”,“vt”:“str”},{“t”:“eq”,“v”:“brightness_up_release”,“vt”:“str”},{“t”:“eq”,“v”:“toggle”,“vt”:“str”},{“t”:“eq”,“v”:“arrow_left_click”,“vt”:“str”},{“t”:“eq”,“v”:“arrow_right_click”,“vt”:“str”},{“t”:“eq”,“v”:“brightness_up_click”,“vt”:“str”},{“t”:“eq”,“v”:“brightness_up_hold”,“vt”:“str”},{“t”:“eq”,“v”:“brightness_down_click”,“vt”:“str”},{“t”:“eq”,“v”:“brightness_down_hold”,“vt”:“str”}],“checkall”:“false”,“repair”:false,“outputs”:9,“x”:390,“y”:460,“wires”:[[“48d2c945.a2b4a8”],[“48d2c945.a2b4a8”],[“e3ebc15.df3444”],[“7ecaf4b9.f57c9c”],[“9ccfa159.7cb7e”],[“3ba2c003.d6719”],[“3ba2c003.d6719”,“7668deef.f9e29”],[“d7b37b28.38a3b8”],[“d7b37b28.38a3b8”,“7668deef.f9e29”]]},{“id”:“9d1f5ac7.70eca8”,“type”:“link in”,“z”:“d3956bfe.d5e5c8”,“name”:“to-IKEA-Switch”,“links”:[“7374d9b.2707128”,“20e22bcb.8e7754”,“bac67226.58015”,“5a33cf01.e8871”,“548fefac.397f5”,“9805e63.bfca218”,“e721de25.ba2ff”,“5d836107.b2f1d”],“x”:275,“y”:460,“wires”:[[“ad5c205a.6cb4a”]]},{“id”:“9ccfa159.7cb7e”,“type”:“function”,“z”:“d3956bfe.d5e5c8”,“name”:“Scenen ++”,“func”:“var numeric_array = [];\nvar arrScenes = global.get(‘arrScenes’);\nfor ( var scene in arrScenes[msg.slots.room]){\n numeric_array.push(scene);\n //node.send({payload:scene})\n}\n\n//node.send({payload:numeric_array})\n\nvar currentDeviceVariable = msg.currentLightDevice + “deviceScene"\nvar currentState = flow.get(currentDeviceVariable)|| 0;\n\n\ncurrentState += 1;\ncurrentState %= numeric_array.length;\nflow.set(currentDeviceVariable, currentState);\nmsg.intent = {“name”: “ChangeLightScene”}\nmsg.slots.scene=numeric_array[currentState]\nreturn msg\n",“outputs”:1,“noerr”:0,“x”:650,“y”:460,“wires”:[[“a50e25e6.ad9288”]]},{“id”:“7668deef.f9e29”,“type”:“change”,“z”:“d3956bfe.d5e5c8”,“name”:“hold -> True”,“rules”:[{“t”:“set”,“p”:“hold”,“pt”:“flow”,“to”:“true”,“tot”:“bool”}],“action”:"",“property”:"",“from”:"",“to”:"",“reg”:false,“x”:650,“y”:600,“wires”:[[]]},{“id”:“48d2c945.a2b4a8”,“type”:“change”,“z”:“d3956bfe.d5e5c8”,“name”:“hold -> False”,“rules”:[{“t”:“set”,“p”:“hold”,“pt”:“flow”,“to”:“false”,“tot”:“bool”}],“action”:"",“property”:"",“from”:"",“to”:"",“reg”:false,“x”:650,“y”:320,“wires”:[[]]},{“id”:“4c9acee4.f4f13”,“type”:“comment”,“z”:“d3956bfe.d5e5c8”,“name”:“from-IKEA-Button”,“info”:"",“x”:200,“y”:460,“wires”:[]},{“id”:“e3ebc15.df3444”,“type”:“change”,“z”:“d3956bfe.d5e5c8”,“name”:“Hauptraum”,“rules”:[{“t”:“set”,“p”:“slots.state”,“pt”:“msg”,“to”:“toggle”,“tot”:“str”},{“t”:“set”,“p”:“intent.name”,“pt”:“msg”,“to”:“ChangeLightState”,“tot”:“str”}],“action”:"",“property”:"",“from”:"",“to”:"",“reg”:false,“x”:650,“y”:380,“wires”:[[“a50e25e6.ad9288”]]},{“id”:“f51a2491.ca9128”,“type”:“inject”,“z”:“d3956bfe.d5e5c8”,“name”:“ON”,“topic”:"",“payload”:“false”,“payloadType”:“bool”,“repeat”:"",“crontab”:"",“once”:true,“onceDelay”:0.1,“x”:190,“y”:320,“wires”:[[“48d2c945.a2b4a8”]]},{“id”:“a50e25e6.ad9288”,“type”:“change”,“z”:“d3956bfe.d5e5c8”,“name”:“Licht”,“rules”:[{“t”:“set”,“p”:“slots.device”,“pt”:“msg”,“to”:“licht”,“tot”:“str”}],“action”:"",“property”:"",“from”:"",“to”:"",“reg”:false,“x”:1050,“y”:460,“wires”:[[“46020a69.5e8264”]]},{“id”:“51bd8b66.11ed64”,“type”:“delay”,“z”:“d3956bfe.d5e5c8”,“name”:“750ms”,“pauseType”:“delay”,“timeout”:“750”,“timeoutUnits”:“milliseconds”,“rate”:“1”,“nbRateUnits”:“1”,“rateUnits”:“second”,“randomFirst”:“1”,“randomLast”:“5”,“randomUnits”:“seconds”,“drop”:false,“x”:790,“y”:560,“wires”:[[“ae23dd73.8a8b8”]]},{“id”:“ae23dd73.8a8b8”,“type”:“switch”,“z”:“d3956bfe.d5e5c8”,“name”:“hold?”,“property”:“hold”,“propertyType”:“flow”,“rules”:[{“t”:“true”}],“checkall”:“true”,“repair”:false,“outputs”:1,“x”:910,“y”:560,“wires”:[[“ed98ac24.1f72f”]]},{“id”:“ed98ac24.1f72f”,“type”:“change”,“z”:“d3956bfe.d5e5c8”,“name”:"Schrittweises Erhöhen”,“rules”:[{“t”:“set”,“p”:“slots.unit”,“pt”:“msg”,“to”:“Steps”,“tot”:“str”},{“t”:“set”,“p”:“intent.name”,“pt”:“msg”,“to”:“ChangeLightBrightness”,“tot”:“str”}],“action”:”",“property”:"",“from”:"",“to”:"",“reg”:false,“x”:850,“y”:520,“wires”:[[“a50e25e6.ad9288”,“51bd8b66.11ed64”]]},{“id”:“d7b37b28.38a3b8”,“type”:“change”,“z”:“d3956bfe.d5e5c8”,“name”:"-25",“rules”:[{“t”:“set”,“p”:“slots.value”,“pt”:“msg”,“to”:"-25",“tot”:“num”}],“action”:"",“property”:"",“from”:"",“to”:"",“reg”:false,“x”:630,“y”:540,“wires”:[[“ed98ac24.1f72f”]]},{“id”:“3ba2c003.d6719”,“type”:“change”,“z”:“d3956bfe.d5e5c8”,“name”:"+25",“rules”:[{“t”:“set”,“p”:“slots.value”,“pt”:“msg”,“to”:“25”,“tot”:“num”}],“action”:"",“property”:"",“from”:"",“to”:"",“reg”:false,“x”:630,“y”:500,“wires”:[[“ed98ac24.1f72f”]]},{“id”:“7ecaf4b9.f57c9c”,“type”:“change”,“z”:“d3956bfe.d5e5c8”,“name”:“Nebenraum”,“rules”:[{“t”:“set”,“p”:“slots.state”,“pt”:“msg”,“to”:“toggle”,“tot”:“str”},{“t”:“set”,“p”:“intent.name”,“pt”:“msg”,“to”:“ChangeLightState”,“tot”:“str”},{“t”:“set”,“p”:“slots.room”,“pt”:“msg”,“to”:“next_room”,“tot”:“msg”}],“action”:"",“property”:"",“from”:"",“to”:"",“reg”:false,“x”:650,“y”:420,“wires”:[[“a50e25e6.ad9288”]]}]
In the change-nodes, I set the same slots as I used in Rhasspy.
Like:
- intent.name
- slots.state to switch On/Off/Toggle Lights
- slots.value to set the difference for Brightness