So I’m trying to set up a flow for a room with it’s Hue lights (2 rgb bulbs and lightstrip) and Hue dimmer switch. I’ve gotten the button to set turn on the lights with a scene based on the time of day, and teh Off button to work, but I am having some difficulty with the dimmer buttons. (I’ve pasted my current flow below.) It’s really just a simple thing—take the current brightness and subtract 10, make sure it’s not below 0, and assign it back to the lights.
I’m using hue-magic, and the problem is that the Hue Light and Hue Group nodes act like event sinks or triggers and fire off any time the object changes state. And I mean any event. Deploying the flow after editing, hitting the On button of the dimmer to set the scene, changing the scene in the hue app. The node passes data to the function node which changes the brightness attribute in the payload and passes it on to a second Hue Group or Hue Light. When that second node changes the brightness based on the payload sent to it by function node, then the first Hue group/Light node sees it as an event, passes the new attributes to the function node, and this continues on in a cycle until the lights are off.
If I check “skip events from node”, the node ignores the input from the previous node in the sequence, so things just dead end don’t work.
There don’t seem to be any nodes that I can use to just get the brightness (or other attributes) of the Hue lights that don’t also act as event sinks for them.
So how the heck do I just make a simple dimmer then?
[
{
"id": "8e23f7c8.a625d8",
"type": "tab",
"label": "Bedroom Dimmer",
"disabled": false,
"info": ""
},
{
"id": "d3d3154e.1bd8e8",
"type": "hue-switch",
"z": "8e23f7c8.a625d8",
"name": "Bedroom Dimmer 1",
"bridge": "56b56a00.c143e4",
"sensorid": "118",
"skipevents": false,
"universalevents": false,
"x": 290,
"y": 120,
"wires": [
[
"8d47b69.2161148",
"bf493495.406128"
]
]
},
{
"id": "8d47b69.2161148",
"type": "switch",
"z": "8e23f7c8.a625d8",
"name": "",
"property": "payload.button",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "1002",
"vt": "num"
},
{
"t": "eq",
"v": "2002",
"vt": "num"
},
{
"t": "eq",
"v": "3002",
"vt": "num"
},
{
"t": "eq",
"v": "4002",
"vt": "num"
}
],
"checkall": "false",
"repair": false,
"outputs": 4,
"x": 130,
"y": 620,
"wires": [
[
"8aade705.695628",
"356bd82f.36f418",
"a75ec8be.503138",
"17e7b729.3538a9",
"aae3defa.a2cd5",
"47d98283.9f94bc",
"8264462.a8df1b8",
"42e871f9.0b1d3",
"177ef6f.4053809",
"8344d321.e0d28",
"eba694a6.53f9e8"
],
[],
[
"902f72d8.0d69a"
],
[
"e37872f8.57bf3"
]
]
},
{
"id": "8aade705.695628",
"type": "time-range-switch",
"z": "8e23f7c8.a625d8",
"name": "",
"lat": "43.44619",
"lon": "-80.49194",
"startTime": "07:00",
"endTime": "09:00",
"startOffset": "0",
"endOffset": 0,
"x": 770,
"y": 180,
"wires": [
[
"13eadf1a.0322d1"
],
[]
]
},
{
"id": "13eadf1a.0322d1",
"type": "weekday",
"z": "8e23f7c8.a625d8",
"name": "Mon-Fri",
"sun": false,
"mon": true,
"tue": true,
"wed": true,
"thu": true,
"fri": true,
"sat": false,
"x": 960,
"y": 180,
"wires": [
[
"b56efed0.3a436"
],
[]
]
},
{
"id": "b56efed0.3a436",
"type": "hue-scene",
"z": "8e23f7c8.a625d8",
"name": "Energize BR",
"bridge": "56b56a00.c143e4",
"sceneid": "v4OeLoFwrWBfmNf",
"groupid": "2",
"skipevents": false,
"x": 1150,
"y": 180,
"wires": [
[]
]
},
{
"id": "356bd82f.36f418",
"type": "time-range-switch",
"z": "8e23f7c8.a625d8",
"name": "",
"lat": "43.44619",
"lon": "-80.49194",
"startTime": "09:00",
"endTime": "17:00",
"startOffset": "0",
"endOffset": 0,
"x": 770,
"y": 240,
"wires": [
[
"3873d60b.9055ba"
],
[]
]
},
{
"id": "3873d60b.9055ba",
"type": "weekday",
"z": "8e23f7c8.a625d8",
"name": "Mon-Fri",
"sun": false,
"mon": true,
"tue": true,
"wed": true,
"thu": true,
"fri": true,
"sat": false,
"x": 960,
"y": 240,
"wires": [
[
"709950fb.92176"
],
[]
]
},
{
"id": "709950fb.92176",
"type": "hue-scene",
"z": "8e23f7c8.a625d8",
"name": "Concentrate BR",
"bridge": "56b56a00.c143e4",
"sceneid": "VF3rrSTubvS1ylI",
"groupid": "2",
"skipevents": false,
"x": 1160,
"y": 240,
"wires": [
[]
]
},
{
"id": "a75ec8be.503138",
"type": "time-range-switch",
"z": "8e23f7c8.a625d8",
"name": "",
"lat": "43.44619",
"lon": "-80.49194",
"startTime": "17:00",
"endTime": "19:30",
"startOffset": "0",
"endOffset": 0,
"x": 770,
"y": 360,
"wires": [
[
"da38543a.e3cfa8"
],
[]
]
},
{
"id": "da38543a.e3cfa8",
"type": "weekday",
"z": "8e23f7c8.a625d8",
"name": "Sun-Thu",
"sun": true,
"mon": true,
"tue": true,
"wed": true,
"thu": true,
"fri": false,
"sat": false,
"x": 960,
"y": 360,
"wires": [
[
"6c642422.98a81c"
],
[]
]
},
{
"id": "6c642422.98a81c",
"type": "hue-scene",
"z": "8e23f7c8.a625d8",
"name": "Relax BR",
"bridge": "56b56a00.c143e4",
"sceneid": "wwE1bf5X64bLK3s",
"groupid": "2",
"skipevents": false,
"x": 1140,
"y": 360,
"wires": [
[]
]
},
{
"id": "17e7b729.3538a9",
"type": "time-range-switch",
"z": "8e23f7c8.a625d8",
"name": "",
"lat": "43.44619",
"lon": "-80.49194",
"startTime": "19:30",
"endTime": "21:30",
"startOffset": "0",
"endOffset": 0,
"x": 770,
"y": 480,
"wires": [
[
"9a033510.291128"
],
[]
]
},
{
"id": "9a033510.291128",
"type": "weekday",
"z": "8e23f7c8.a625d8",
"name": "Sun-Thu",
"sun": true,
"mon": true,
"tue": true,
"wed": true,
"thu": true,
"fri": false,
"sat": false,
"x": 960,
"y": 480,
"wires": [
[
"ca130490.256de8"
],
[]
]
},
{
"id": "ca130490.256de8",
"type": "hue-scene",
"z": "8e23f7c8.a625d8",
"name": "Dim BR",
"bridge": "56b56a00.c143e4",
"sceneid": "ekGMoIwyBYjt5iH",
"groupid": "2",
"skipevents": false,
"x": 1140,
"y": 480,
"wires": [
[]
]
},
{
"id": "aae3defa.a2cd5",
"type": "time-range-switch",
"z": "8e23f7c8.a625d8",
"name": "",
"lat": "43.44619",
"lon": "-80.49194",
"startTime": "21:30",
"endTime": "23:59",
"startOffset": "0",
"endOffset": 0,
"x": 770,
"y": 600,
"wires": [
[
"fbbcbbf5.95dfc8"
],
[]
]
},
{
"id": "fbbcbbf5.95dfc8",
"type": "weekday",
"z": "8e23f7c8.a625d8",
"name": "Sun-Thu",
"sun": true,
"mon": true,
"tue": true,
"wed": true,
"thu": true,
"fri": false,
"sat": false,
"x": 960,
"y": 600,
"wires": [
[
"9c5a6b9a.6df198"
],
[]
]
},
{
"id": "9c5a6b9a.6df198",
"type": "hue-scene",
"z": "8e23f7c8.a625d8",
"name": "Nightlight BR",
"bridge": "56b56a00.c143e4",
"sceneid": "B42gVP1luD554jv",
"groupid": "2",
"skipevents": false,
"x": 1150,
"y": 600,
"wires": [
[]
]
},
{
"id": "47d98283.9f94bc",
"type": "time-range-switch",
"z": "8e23f7c8.a625d8",
"name": "",
"lat": "43.44619",
"lon": "-80.49194",
"startTime": "10:00",
"endTime": "17:00",
"startOffset": "0",
"endOffset": 0,
"x": 770,
"y": 300,
"wires": [
[
"2cb47651.496ada"
],
[]
]
},
{
"id": "2cb47651.496ada",
"type": "weekday",
"z": "8e23f7c8.a625d8",
"name": "Sat-Sun",
"sun": true,
"mon": false,
"tue": false,
"wed": false,
"thu": false,
"fri": false,
"sat": true,
"x": 960,
"y": 300,
"wires": [
[
"144aacff.3a9073"
],
[]
]
},
{
"id": "144aacff.3a9073",
"type": "hue-scene",
"z": "8e23f7c8.a625d8",
"name": "Read BR",
"bridge": "56b56a00.c143e4",
"sceneid": "v1q3ZFv-LnfI5M1",
"groupid": "2",
"skipevents": false,
"x": 1140,
"y": 300,
"wires": [
[]
]
},
{
"id": "8264462.a8df1b8",
"type": "time-range-switch",
"z": "8e23f7c8.a625d8",
"name": "",
"lat": "43.44619",
"lon": "-80.49194",
"startTime": "17:00",
"endTime": "20:30",
"startOffset": "0",
"endOffset": 0,
"x": 770,
"y": 420,
"wires": [
[
"ed632be2.323768"
],
[]
]
},
{
"id": "ed632be2.323768",
"type": "weekday",
"z": "8e23f7c8.a625d8",
"name": "Fri-Sat",
"sun": false,
"mon": false,
"tue": false,
"wed": false,
"thu": false,
"fri": true,
"sat": true,
"x": 950,
"y": 420,
"wires": [
[
"6772f105.08654"
],
[]
]
},
{
"id": "6772f105.08654",
"type": "hue-scene",
"z": "8e23f7c8.a625d8",
"name": "Relax BR",
"bridge": "56b56a00.c143e4",
"sceneid": "wwE1bf5X64bLK3s",
"groupid": "2",
"skipevents": false,
"x": 1140,
"y": 420,
"wires": [
[]
]
},
{
"id": "42e871f9.0b1d3",
"type": "time-range-switch",
"z": "8e23f7c8.a625d8",
"name": "",
"lat": "43.44619",
"lon": "-80.49194",
"startTime": "20:30",
"endTime": "22:30",
"startOffset": "0",
"endOffset": 0,
"x": 770,
"y": 540,
"wires": [
[
"77d18f22.4dbad"
],
[]
]
},
{
"id": "77d18f22.4dbad",
"type": "weekday",
"z": "8e23f7c8.a625d8",
"name": "Fri-Sat",
"sun": false,
"mon": false,
"tue": false,
"wed": false,
"thu": false,
"fri": true,
"sat": true,
"x": 950,
"y": 540,
"wires": [
[
"8a8b877f.da3ab8"
],
[]
]
},
{
"id": "8a8b877f.da3ab8",
"type": "hue-scene",
"z": "8e23f7c8.a625d8",
"name": "Dim BR",
"bridge": "56b56a00.c143e4",
"sceneid": "ekGMoIwyBYjt5iH",
"groupid": "2",
"skipevents": false,
"x": 1140,
"y": 540,
"wires": [
[]
]
},
{
"id": "177ef6f.4053809",
"type": "time-range-switch",
"z": "8e23f7c8.a625d8",
"name": "",
"lat": "43.44619",
"lon": "-80.49194",
"startTime": "22:30",
"endTime": "23:59",
"startOffset": "0",
"endOffset": 0,
"x": 770,
"y": 660,
"wires": [
[
"728c7a9e.d19594"
],
[]
]
},
{
"id": "728c7a9e.d19594",
"type": "weekday",
"z": "8e23f7c8.a625d8",
"name": "Fri-Sat",
"sun": false,
"mon": false,
"tue": false,
"wed": false,
"thu": false,
"fri": true,
"sat": true,
"x": 950,
"y": 660,
"wires": [
[
"a6b7d3aa.f247a"
],
[]
]
},
{
"id": "a6b7d3aa.f247a",
"type": "hue-scene",
"z": "8e23f7c8.a625d8",
"name": "Nightlight BR",
"bridge": "56b56a00.c143e4",
"sceneid": "B42gVP1luD554jv",
"groupid": "2",
"skipevents": false,
"x": 1150,
"y": 660,
"wires": [
[]
]
},
{
"id": "8344d321.e0d28",
"type": "time-range-switch",
"z": "8e23f7c8.a625d8",
"name": "",
"lat": "43.44619",
"lon": "-80.49194",
"startTime": "00:00",
"endTime": "07:00",
"startOffset": "0",
"endOffset": 0,
"x": 770,
"y": 720,
"wires": [
[
"eecdf4aa.141918"
],
[]
]
},
{
"id": "eecdf4aa.141918",
"type": "weekday",
"z": "8e23f7c8.a625d8",
"name": "Mon-Fri",
"sun": false,
"mon": true,
"tue": true,
"wed": true,
"thu": true,
"fri": true,
"sat": false,
"x": 960,
"y": 720,
"wires": [
[
"6e45ed3e.12c384"
],
[]
]
},
{
"id": "6e45ed3e.12c384",
"type": "hue-scene",
"z": "8e23f7c8.a625d8",
"name": "Nightlight BR",
"bridge": "56b56a00.c143e4",
"sceneid": "B42gVP1luD554jv",
"groupid": "2",
"skipevents": false,
"x": 1150,
"y": 720,
"wires": [
[]
]
},
{
"id": "eba694a6.53f9e8",
"type": "time-range-switch",
"z": "8e23f7c8.a625d8",
"name": "",
"lat": "43.44619",
"lon": "-80.49194",
"startTime": "00:00",
"endTime": "10:00",
"startOffset": "0",
"endOffset": 0,
"x": 770,
"y": 780,
"wires": [
[
"bf109934.69c9e8"
],
[]
]
},
{
"id": "bf109934.69c9e8",
"type": "weekday",
"z": "8e23f7c8.a625d8",
"name": "Mon-Fri",
"sun": false,
"mon": true,
"tue": true,
"wed": true,
"thu": true,
"fri": true,
"sat": false,
"x": 960,
"y": 780,
"wires": [
[
"6f2fb077.c3ff7"
],
[]
]
},
{
"id": "6f2fb077.c3ff7",
"type": "hue-scene",
"z": "8e23f7c8.a625d8",
"name": "Nightlight BR",
"bridge": "56b56a00.c143e4",
"sceneid": "B42gVP1luD554jv",
"groupid": "2",
"skipevents": false,
"x": 1150,
"y": 780,
"wires": [
[]
]
},
{
"id": "e37872f8.57bf3",
"type": "api-call-service",
"z": "8e23f7c8.a625d8",
"name": "Turn off Bedroom Lights",
"server": "65805b9d.669864",
"version": 1,
"debugenabled": false,
"service_domain": "light",
"service": "turn_off",
"entityId": "light.bedroom_lights",
"data": "{\"transition\":5}",
"dataType": "jsonata",
"mergecontext": "",
"output_location": "",
"output_location_type": "none",
"mustacheAltTags": false,
"x": 310,
"y": 1580,
"wires": [
[
"ecb3cc14.29ab4"
]
]
},
{
"id": "bf493495.406128",
"type": "change",
"z": "8e23f7c8.a625d8",
"name": "",
"rules": [
{
"t": "set",
"p": "bedroom_lights_circadian",
"pt": "global",
"to": "true",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 850,
"y": 120,
"wires": [
[]
]
},
{
"id": "ecb3cc14.29ab4",
"type": "change",
"z": "8e23f7c8.a625d8",
"name": "",
"rules": [
{
"t": "set",
"p": "bedroom_lights_circadian",
"pt": "global",
"to": "false",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 610,
"y": 1580,
"wires": [
[]
]
},
{
"id": "902f72d8.0d69a",
"type": "api-current-state",
"z": "8e23f7c8.a625d8",
"name": "",
"server": "65805b9d.669864",
"version": 1,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"override_topic": true,
"entity_id": "light.bedroom_lights",
"state_type": "str",
"state_location": "payload.lightstate",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"blockInputOverrides": false,
"x": 460,
"y": 1060,
"wires": [
[
"7c354acf.90d3c4"
],
[]
]
},
{
"id": "1aaede4a.772142",
"type": "debug",
"z": "8e23f7c8.a625d8",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1410,
"y": 820,
"wires": []
},
{
"id": "9bf4c2ff.74cf9",
"type": "function",
"z": "8e23f7c8.a625d8",
"name": "",
"func": "var my_brightness = (Math.ceil(msg.payload.brightness/10) - 1) * 10;\nif (my_brightness < 0) {\n my_brightness = 0;\n}\nif (my_brightness > 100) {\n mybrightness = 100;\n}\nvar my_brightnessLevel = Math.ceil(255 * (msg.payload.brightness/100.0));\n\nmsg.payload.brightness = my_brightness;\nmsg.payload.brightnessLevel = my_brightnessLevel;\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1230,
"y": 1080,
"wires": [
[
"7569a684.7408d8"
]
]
},
{
"id": "7c354acf.90d3c4",
"type": "hue-group",
"z": "8e23f7c8.a625d8",
"name": "Bedroom",
"bridge": "56b56a00.c143e4",
"groupid": "2",
"colornamer": true,
"skipevents": false,
"universalevents": false,
"x": 810,
"y": 1140,
"wires": [
[
"9bf4c2ff.74cf9"
]
]
},
{
"id": "7569a684.7408d8",
"type": "hue-group",
"z": "8e23f7c8.a625d8",
"name": "Bedroom",
"bridge": "56b56a00.c143e4",
"groupid": "2",
"colornamer": true,
"skipevents": false,
"universalevents": false,
"x": 1550,
"y": 1140,
"wires": [
[
"1aaede4a.772142"
]
]
},
{
"id": "56b56a00.c143e4",
"type": "hue-bridge",
"name": "Philips hue",
"bridge": "10.128.3.3",
"key": "q29lSeOY6PHGN9MuvuKwcbUEmA2nR1lmfTsxKBxm",
"interval": "2000",
"disableupdates": false
},
{
"id": "65805b9d.669864",
"type": "server",
"name": "Home Assistant",
"addon": true
}
]