Hey there, I got to say this is exactly what I was looking for. From modding it to my set up, it works like your example @jbudd
But I'm running into an issue. Obviously since you do not use HA so your entities will be different and such, what I'm running into is when changing the brightness, at least for HA, you specify which device/light does the decrease/increase in brightness. As you can see in my example.
[
{
"id": "63ba6a4df5568f01",
"type": "tab",
"label": "Flow 2",
"disabled": false,
"info": "",
"env": []
},
{
"id": "51043c1ac96c44d1",
"type": "group",
"z": "63ba6a4df5568f01",
"name": "Count button presses in 2 sec",
"style": {
"label": true,
"stroke": "#9363b7",
"color": "#6f2fa0"
},
"nodes": [
"4f545b94277372e7",
"27528e7a60af2132",
"d2d72bc55eb14d77",
"b896612f7cd0c917",
"7302b8f94fd1fdfc",
"a89439b3384aa532"
],
"x": 694,
"y": 519,
"w": 592,
"h": 127
},
{
"id": "3410baab28559ffb",
"type": "group",
"z": "63ba6a4df5568f01",
"name": "Permit brightness adjustment",
"style": {
"label": true,
"stroke": "#9363b7",
"color": "#6f2fa0"
},
"nodes": [
"450bdb5c804906fe",
"7bfd1a3532b79f94",
"f50cb70a17346bb3",
"3db53157a8908ab5",
"cb97bbfa8d8b56bf",
"24fb1f14ade01fc4",
"4b2091f778c94742"
],
"x": 694,
"y": 699,
"w": 592,
"h": 182
},
{
"id": "7302b8f94fd1fdfc",
"type": "junction",
"z": "63ba6a4df5568f01",
"g": "51043c1ac96c44d1",
"x": 880,
"y": 580,
"wires": [
[
"4f545b94277372e7",
"d2d72bc55eb14d77"
]
]
},
{
"id": "a89439b3384aa532",
"type": "junction",
"z": "63ba6a4df5568f01",
"g": "51043c1ac96c44d1",
"x": 1260,
"y": 620,
"wires": [
[
"059657765a78db69",
"cb97bbfa8d8b56bf"
]
]
},
{
"id": "4b2091f778c94742",
"type": "junction",
"z": "63ba6a4df5568f01",
"g": "3410baab28559ffb",
"x": 1260,
"y": 840,
"wires": [
[
"bb36f7f08e1120d2",
"18f128597870a1d9"
]
]
},
{
"id": "059657765a78db69",
"type": "switch",
"z": "63ba6a4df5568f01",
"name": "Count",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "1",
"vt": "num"
},
{
"t": "eq",
"v": "2",
"vt": "num"
},
{
"t": "eq",
"v": "3",
"vt": "num"
},
{
"t": "eq",
"v": "4",
"vt": "num"
},
{
"t": "else"
}
],
"checkall": "true",
"repair": false,
"outputs": 5,
"x": 1390,
"y": 660,
"wires": [
[
"4702059087158b2a",
"6ed299bd99612f4f"
],
[
"324c32712ca61150",
"56351f7af1101856"
],
[
"3af494a76541f05d"
],
[
"fef6244d93fc1089"
],
[
"1be84399cba41f23"
]
]
},
{
"id": "4702059087158b2a",
"type": "debug",
"z": "63ba6a4df5568f01",
"name": "1 ON",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1570,
"y": 420,
"wires": []
},
{
"id": "324c32712ca61150",
"type": "debug",
"z": "63ba6a4df5568f01",
"name": "2 ON",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1570,
"y": 580,
"wires": []
},
{
"id": "3af494a76541f05d",
"type": "debug",
"z": "63ba6a4df5568f01",
"name": "Both ON",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1560,
"y": 660,
"wires": []
},
{
"id": "fef6244d93fc1089",
"type": "debug",
"z": "63ba6a4df5568f01",
"name": "Both OFF",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1560,
"y": 700,
"wires": []
},
{
"id": "bb36f7f08e1120d2",
"type": "debug",
"z": "63ba6a4df5568f01",
"name": "Change brightness2",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1580,
"y": 940,
"wires": []
},
{
"id": "1be84399cba41f23",
"type": "debug",
"z": "63ba6a4df5568f01",
"name": "Too many clicks",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1580,
"y": 740,
"wires": []
},
{
"id": "4f545b94277372e7",
"type": "function",
"z": "63ba6a4df5568f01",
"g": "51043c1ac96c44d1",
"name": "function 26",
"func": "let presses = context.get(\"presses\") ?? 0\nif (msg.payload == 0) presses = 0\nelse presses += 1;\ncontext.set(\"presses\", presses)\nmsg.payload = presses;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1010,
"y": 560,
"wires": [
[
"b896612f7cd0c917"
]
]
},
{
"id": "27528e7a60af2132",
"type": "inject",
"z": "63ba6a4df5568f01",
"g": "51043c1ac96c44d1",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 800,
"y": 560,
"wires": [
[
"7302b8f94fd1fdfc"
]
]
},
{
"id": "d2d72bc55eb14d77",
"type": "trigger",
"z": "63ba6a4df5568f01",
"g": "51043c1ac96c44d1",
"name": "2s inactive",
"op1": "",
"op2": "0",
"op1type": "nul",
"op2type": "num",
"duration": "2020",
"extend": true,
"overrideDelay": false,
"units": "ms",
"reset": "",
"bytopic": "all",
"topic": "topic",
"outputs": 1,
"x": 1010,
"y": 600,
"wires": [
[
"4f545b94277372e7"
]
]
},
{
"id": "b896612f7cd0c917",
"type": "trigger",
"z": "63ba6a4df5568f01",
"g": "51043c1ac96c44d1",
"name": "",
"op1": "",
"op2": "",
"op1type": "nul",
"op2type": "payl",
"duration": "2",
"extend": true,
"overrideDelay": false,
"units": "s",
"reset": "0",
"bytopic": "all",
"topic": "topic",
"outputs": 1,
"x": 1180,
"y": 560,
"wires": [
[
"a89439b3384aa532"
]
]
},
{
"id": "450bdb5c804906fe",
"type": "gate",
"z": "63ba6a4df5568f01",
"g": "3410baab28559ffb",
"name": "",
"controlTopic": "control",
"defaultState": "closed",
"openCmd": "open",
"closeCmd": "close",
"toggleCmd": "toggle",
"defaultCmd": "default",
"statusCmd": "status",
"persist": false,
"storeName": "memory",
"x": 1130,
"y": 800,
"wires": [
[
"4b2091f778c94742"
]
]
},
{
"id": "7bfd1a3532b79f94",
"type": "inject",
"z": "63ba6a4df5568f01",
"g": "3410baab28559ffb",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "1",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 810,
"y": 800,
"wires": [
[
"450bdb5c804906fe"
]
]
},
{
"id": "f50cb70a17346bb3",
"type": "trigger",
"z": "63ba6a4df5568f01",
"g": "3410baab28559ffb",
"name": "Open gate 7s",
"op1": "open",
"op2": "close",
"op1type": "str",
"op2type": "str",
"duration": "7",
"extend": false,
"overrideDelay": false,
"units": "s",
"reset": "0",
"bytopic": "all",
"topic": "topic",
"outputs": 1,
"x": 1100,
"y": 740,
"wires": [
[
"450bdb5c804906fe"
]
]
},
{
"id": "3db53157a8908ab5",
"type": "change",
"z": "63ba6a4df5568f01",
"g": "3410baab28559ffb",
"name": "",
"rules": [
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "control",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 930,
"y": 740,
"wires": [
[
"f50cb70a17346bb3"
]
]
},
{
"id": "cb97bbfa8d8b56bf",
"type": "switch",
"z": "63ba6a4df5568f01",
"g": "3410baab28559ffb",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "lt",
"v": "4",
"vt": "num"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 790,
"y": 740,
"wires": [
[
"3db53157a8908ab5"
]
]
},
{
"id": "24fb1f14ade01fc4",
"type": "link in",
"z": "63ba6a4df5568f01",
"g": "3410baab28559ffb",
"name": "Brightness setting",
"links": [],
"x": 810,
"y": 840,
"wires": [
[
"450bdb5c804906fe"
]
],
"l": true
},
{
"id": "0730b2603f9432e7",
"type": "server-events",
"z": "63ba6a4df5568f01",
"name": "ZHA Event",
"server": "8de944d3d3458290",
"version": 2,
"eventType": "zha_event",
"exposeToHomeAssistant": false,
"eventData": "",
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"waitForRunning": true,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "$outputData(\"eventData\").event_type",
"valueType": "jsonata"
},
{
"property": "event_type",
"propertyType": "msg",
"value": "$outputData(\"eventData\").event_type",
"valueType": "jsonata"
}
],
"x": 300,
"y": 800,
"wires": [
[
"069a909076c32c8b"
]
]
},
{
"id": "069a909076c32c8b",
"type": "switch",
"z": "63ba6a4df5568f01",
"name": "On/Off/Step",
"property": "payload.event.command",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "on",
"vt": "str"
},
{
"t": "eq",
"v": "off_with_effect",
"vt": "str"
},
{
"t": "eq",
"v": "step",
"vt": "str"
},
{
"t": "eq",
"v": "up_double_press",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 4,
"x": 490,
"y": 740,
"wires": [
[
"7302b8f94fd1fdfc"
],
[],
[
"450bdb5c804906fe"
],
[]
]
},
{
"id": "6ed299bd99612f4f",
"type": "api-call-service",
"z": "63ba6a4df5568f01",
"name": "Bedroom Light 1",
"server": "8de944d3d3458290",
"version": 5,
"debugenabled": false,
"domain": "light",
"service": "turn_on",
"areaId": [],
"deviceId": [],
"entityId": [],
"data": "{\"brightness\": 255}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"output_location": "",
"output_location_type": "none",
"x": 1600,
"y": 460,
"wires": [
[]
]
},
{
"id": "64600c3c90b7a5c0",
"type": "api-call-service",
"z": "63ba6a4df5568f01",
"name": "Increase 20%",
"server": "8de944d3d3458290",
"version": 5,
"debugenabled": false,
"domain": "light",
"service": "turn_on",
"areaId": [],
"deviceId": [],
"entityId": [],
"data": "{\"brightness_step_pct\": 20}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"output_location": "",
"output_location_type": "none",
"x": 1800,
"y": 780,
"wires": [
[]
]
},
{
"id": "5a167cd5ed48026d",
"type": "api-call-service",
"z": "63ba6a4df5568f01",
"name": "Decrease 20%",
"server": "8de944d3d3458290",
"version": 5,
"debugenabled": false,
"domain": "light",
"service": "turn_on",
"areaId": [],
"deviceId": [],
"entityId": [],
"data": "{\"brightness_step_pct\": -20}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"output_location": "",
"output_location_type": "none",
"x": 1800,
"y": 840,
"wires": [
[]
]
},
{
"id": "18f128597870a1d9",
"type": "switch",
"z": "63ba6a4df5568f01",
"name": "Type of Step",
"property": "payload.event",
"propertyType": "msg",
"rules": [
{
"t": "jsonata_exp",
"v": "msg.payload.event.args=[0,30,9]",
"vt": "jsonata"
},
{
"t": "jsonata_exp",
"v": "msg.payload.event.args=[0,56,9]",
"vt": "jsonata"
},
{
"t": "jsonata_exp",
"v": "msg.payload.event.args=[1,30,9]",
"vt": "jsonata"
},
{
"t": "jsonata_exp",
"v": "msg.payload.event.args=[1,56,9]",
"vt": "jsonata"
}
],
"checkall": "true",
"repair": false,
"outputs": 4,
"x": 1550,
"y": 840,
"wires": [
[
"64600c3c90b7a5c0",
"73048a2dec7d28ad"
],
[],
[
"5a167cd5ed48026d",
"9dcfe57bb11c3c46"
],
[]
]
},
{
"id": "56351f7af1101856",
"type": "api-call-service",
"z": "63ba6a4df5568f01",
"name": "Bedroom Light 2",
"server": "8de944d3d3458290",
"version": 5,
"debugenabled": false,
"domain": "light",
"service": "turn_on",
"areaId": [],
"deviceId": [],
"entityId": [],
"data": "{\"brightness\": 255}",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"output_location": "",
"output_location_type": "none",
"x": 1600,
"y": 540,
"wires": [
[]
]
},
{
"id": "73048a2dec7d28ad",
"type": "debug",
"z": "63ba6a4df5568f01",
"name": "debug 9",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 2000,
"y": 820,
"wires": []
},
{
"id": "9dcfe57bb11c3c46",
"type": "debug",
"z": "63ba6a4df5568f01",
"name": "debug 10",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 2000,
"y": 900,
"wires": []
},
{
"id": "8de944d3d3458290",
"type": "server",
"name": "Home Assistant",
"version": 5,
"addon": false,
"rejectUnauthorizedCerts": false,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true,
"cacheJson": true,
"heartbeat": false,
"heartbeatInterval": "30",
"areaSelector": "friendlyName",
"deviceSelector": "friendlyName",
"entitySelector": "friendlyName",
"statusSeparator": "at: ",
"statusYear": "hidden",
"statusMonth": "short",
"statusDay": "numeric",
"statusHourCycle": "h23",
"statusTimeFormat": "h:m",
"enableGlobalContextStore": true
}
]
Is there a different way to change brightness other than using the HA nodes to do it? Because by using the HA nodes for brightness, it seems you cannot specify which specific device you want to change brightness on, based off of the flow. Meaning, I only want to change brightness on light 2 when I run the flow, but the way the nodes work on 'HA-Call service node' you have to specify a device to change the brightness. So it causes having more than one light, it'll run all of the service nodes you have...vs the exact specific device you are running from the entire flow. Hope that made a little sense, could not explain any better.
The only thing I could think of was injecting other data into the bedroom light 1 node to change brightness like {"brightness_step_pct": 20}
, so you put a line from "incrase 20%" to the bedroom light 1. But not sure how to do that. And obviously I feel like there is a better way of doing that?
If it helps, this is the debug of where I got the perimeters for Hue remote:
{"event_type":"zha_event","event":{"device_ieee":"00:17:88:01:08:6e:70:db","unique_id":"00:17:88:01:08:6e:70:db:1:0x0008","device_id":"939e69de25c6cb73d860628019b5da86","endpoint_id":1,"cluster_id":8,"command":"step","args":[1,30,9],"params":{"step_mode":1,"step_size":30,"transition_time":9,"options_mask":null,"options_override":null}},"origin":"LOCAL","time_fired":"2022-12-17T16:18:56.026527+00:00","context":{"id":"01GMGE38CT595DWECKQG85E3SD","parent_id":null,"user_id":null}}