Skip to content

Instantly share code, notes, and snippets.

@TheDevFreak
Last active January 18, 2021 18:58
Show Gist options
  • Save TheDevFreak/ff87c2812611c690c2e80cf26d296080 to your computer and use it in GitHub Desktop.
Save TheDevFreak/ff87c2812611c690c2e80cf26d296080 to your computer and use it in GitHub Desktop.
NodeRed Template for the Tradfri 5 Button Remotes (ZHA)
[
{
"id": "b79dcd2c.8666d",
"type": "tab",
"label": "Tradfri 5 Button Template",
"disabled": false,
"info": ""
},
{
"id": "fe9febcb.14ec2",
"type": "server-events",
"z": "b79dcd2c.8666d",
"name": "ZHA Events",
"server": "",
"event_type": "zha_event",
"exposeToHomeAssistant": false,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"x": 330,
"y": 340,
"wires": [
[
"dbf7f8eb.a2ec18"
]
]
},
{
"id": "bed73a25.c6c3b",
"type": "switch",
"z": "b79dcd2c.8666d",
"name": "Tradfri 5 Button",
"property": "payload.event.command",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "toggle",
"vt": "str"
},
{
"t": "jsonata_exp",
"v": "msg.payload.event.command = \"press\" and msg.payload.event.args[0] = 256",
"vt": "jsonata"
},
{
"t": "jsonata_exp",
"v": "msg.payload.event.command = \"press\" and msg.payload.event.args[0] = 257",
"vt": "jsonata"
},
{
"t": "jsonata_exp",
"v": "msg.payload.event.command = \"step_with_on_off\" and msg.payload.event.args[0] = 0",
"vt": "jsonata"
},
{
"t": "jsonata_exp",
"v": "msg.payload.event.command = \"step\" and msg.payload.event.args[0] = 1",
"vt": "jsonata"
},
{
"t": "jsonata_exp",
"v": "msg.payload.event.command = \"move_with_on_off\" and msg.payload.event.args[0] = 0",
"vt": "jsonata"
},
{
"t": "jsonata_exp",
"v": "msg.payload.event.command = \"move\" and msg.payload.event.args[0] = 1",
"vt": "jsonata"
},
{
"t": "eq",
"v": "stop",
"vt": "str"
},
{
"t": "jsonata_exp",
"v": "msg.payload.event.command = \"hold\" and msg.payload.event.args[0] = 3328",
"vt": "jsonata"
},
{
"t": "jsonata_exp",
"v": "msg.payload.event.command = \"hold\" and msg.payload.event.args[0] = 3329",
"vt": "jsonata"
},
{
"t": "eq",
"v": "release",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 11,
"x": 900,
"y": 340,
"wires": [
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[]
],
"outputLabels": [
"Middle",
"Right",
"Left",
"Up",
"Down",
"UpHoldStart",
"DownHoldStart",
"StopHoldingUpDown",
"RightHoldStart",
"LeftHoldStart",
"ReleaseLeftRight"
]
},
{
"id": "dbf7f8eb.a2ec18",
"type": "switch",
"z": "b79dcd2c.8666d",
"name": "Remote Selector",
"property": "payload.event.device_ieee",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 610,
"y": 340,
"wires": [
[
"bed73a25.c6c3b"
]
],
"outputLabels": [
"Ben's Remote"
]
},
{
"id": "d8993541.ac5de",
"type": "comment",
"z": "b79dcd2c.8666d",
"name": "Put IEEE in this switch node",
"info": "",
"x": 580,
"y": 300,
"wires": []
},
{
"id": "fcfb8bfe.71b3f",
"type": "comment",
"z": "b79dcd2c.8666d",
"name": "Ensure server dropdown is correct",
"info": "",
"x": 260,
"y": 300,
"wires": []
}
]
@ValiEne
Copy link

ValiEne commented Jan 10, 2021

Thanks a lot, it really helped me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment