"Art" of the sequence, a Node-RED retrospective

Mae West Roku?

2 Likes

Synecdoche

1 Like

None of my sequences are nicely laid out like the examples above; however, if "pretty" reflects the feeling of content an automation gives, then this sequence is pretty. If the TV is on, it raises the volume by 5 on the Sonos playbar/sub when the HVAC blower comes on and lowers it by 5 when the blower turns off.

4 Likes

The borg, on canvas. Circa 2020.

3 Likes

:crazy_face: :crazy_face: :crazy_face: :crazy_face: :crazy_face: :exploding_head: :exploding_head: :exploding_head: :exploding_head: :exploding_head: :exploding_head:

my head hurts reading this! :exploding_head:

This thread inspired me to install and learn node red, so I appreciate everything people have added. I'm still learning a lot (and reading the original thread as I go) but here's what I have put together so far. I'm re-implementing a RM sequence I have which does color temperature calculation and maintenance for me.

The top sequence is used to calculate sunrise and sunset and store those in flow variables.

The middle sequence checks the current time and decides what color temperature my lights should be, and the bottom sequence uses that number to inspect each bulb, ask if it's already on, and if so change the CT of the bulb.

I have the final steps of the flow manually triggered right now, and most of the bulbs are disabled while I tinker with it to keep from distracting the locals.

2 Likes

That's cool.. what do you think about NR so far?

The Radish or "Lawn Dart" couldn't decide..

1 Like

.
If I may, I call this my:
"$#@#!%$%@#-ing Gardenspot Mini RGBs do not properly turn off so I need to run the process twice"

1 Like

Ha! Although "docking with mothership" or "refueling" could work and might be less stressful.. :rofl:

edit: looks interesting visually though..

what do you think about NR so far?

Coming from a software background, Node Red has been a bit of a mind warp. Figuring out that subflows existed was a real satisfying moment for me. My single subflow just has one javascript function in it but it saved me from needing to dup that function out just to use it in more than one place which is what was really irking me.

I find myself wishing that I could be more "meta" with it, but I can't figure out if this is a limitation of the way the hubitat nodes are configured or the way Node Red itself works.

I'd really like to be able to group all my bulbs together and execute the same decision tree on them, but the command node doesn't seem to allow me to set the device id within the message object. That would allow me to clean this up in enough of a way that would really satisfy.

1 Like

I use HE groups for my lights it's straightforward and leverages the power of HE + I can do zigbee messaging. Also am using HE for the Alexa skill. Have Alexa tied to virtual switches on my control hub and sync them with the real lights on my main hub via NR.

Yes, this works sometimes but it fails me in this way. If I have all my CT bulbs in one group, then when I turn on my basement lights the lamps in the living room turn on too. The core reason for implementing this workflow in HE RM the first time around was that I don't want the individual bulbs to turn on when the CT adjusts.

My goal is to allow my bulbs to work as dumb bulbs, except that they change temperature throughout the day. Some of them are in lamps (always powered) and some are on dumb switches, but when they get power they check in with HE and the CT is updated and they gradually shift over 5s to the right CT for the time of day.

Essentially, I want a global reference CT, and all bulbs to follow that whenever they're on... but only when they're already on.

So you might want to check out my subflow I did which synchronizes an RGBW device to another one.. see my "Lawn Dart" above for how it works in a sequence.. (the vctlInitNodeRed + switch was just for startup you can replace with something else) dunno if it would help or not.

[{"id":"4591d8e3.a01f88","type":"subflow","name":"Store & Gen Color Msgs","info":"","category":"","in":[{"x":20,"y":80,"wires":[{"id":"43ce582b.f10878"}]}],"out":[{"x":740,"y":80,"wires":[{"id":"1135ac38.dc1784","port":0}]}],"env":[],"color":"#DDAA99"},{"id":"ae35af45.f6423","type":"sort","z":"4591d8e3.a01f88","name":"","order":"ascending","as_num":true,"target":"","targetType":"seq","msgKey":"","msgKeyType":"elem","seqKey":"parts.index","seqKeyType":"msg","x":410,"y":80,"wires":[["1135ac38.dc1784"]]},{"id":"1135ac38.dc1784","type":"delay","z":"4591d8e3.a01f88","name":"","pauseType":"delay","timeout":"50","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":570,"y":80,"wires":[[]]},{"id":"43ce582b.f10878","type":"function","z":"4591d8e3.a01f88","name":"Store and Gen Color/CT Info","func":"pylName = msg.payload.name;\npylValue = (msg.payload.value === undefined?\"\":msg.payload.value);\n\n//node.warn('--------------------start func');\n\nasync function sendCmdMsg(message,cmd,args,parts) {\n    \n    node.warn(\"sending = \" + cmd + \" / \" + args );\n    message.command = cmd;\n    message.arguments = args;\n    message.payload = {};\n    message.parts = parts;\n    node.send(message);\n    node.done();\n}\n\n// \nvarName = \"$parent.\" + msg.topic + \"_attributes\";\nattrs = {};\n\nif(!flow.get(varName)){\n\tattrs = {\n\t\tswitch:{command:\"switch\",arguments:\"\"},\n\t\thue:{command:\"setHue\",arguments:\"\"},\n\t\tsaturation:{command:\"setSaturation\",arguments:\"\"},\n\t\tlevel:{command:\"setLevel\",arguments:\"\"},\n\t\tcolorTemperature:{command:\"setColorTemperature\",arguments:\"\"},\n\t\tcolorMode:{command:\"setColorMode\",arguments:\"\"}\n\t}\n} else  {\n\tattrs = flow.get(varName);\n}\n\n\n// Accumulate necessary commands from events..\nattrs[pylName].arguments = pylValue;\nflow.set(varName,attrs);\n\n//node.warn(attrs)\n\nif (checkAttrs(attrs) ) {\n\tcmds = [];\n\t\n    \n\tif (attrs.switch.arguments == \"on\") {\n\t\t\n\t\tswitch(attrs.colorMode.arguments) {\n\t\t\tcase \"CT\":\n\t\t\t\t//node.warn(\"********************  CT Mode\");\n\t\t\t\tcmds = [ \n\t\t\t\t\t{cmd:attrs.colorTemperature.command,arguments:attrs.colorTemperature.arguments},\n\t\t\t\t\t{cmd:attrs.level.command,arguments:attrs.level.arguments},\n\t\t\t\t\t{cmd:attrs.switch.arguments}\n\t\t\t\t];\n\t\t\t\tbreak;\n\t\t\n\t\t\tcase \"RGB\":\n\t\t\t\t//node.warn(\"********************  RGB Mode\");\n\t\t\t\tcmds = [\n\t\t\t\t\t{cmd:attrs.hue.command,arguments:attrs.hue.arguments},\n\t\t\t\t\t{cmd:attrs.saturation.command,arguments:attrs.saturation.arguments},\n\t\t\t\t\t{cmd:attrs.level.command,arguments:attrs.level.arguments},\n\t\t\t\t\t{cmd:attrs.switch.arguments}\n\t\t\t\t];\n\t\t\t\tbreak;\n\t\t}\n\t}\n\telse {\n\t\t\tcmds = [ \n\t\t\t\t{cmd:attrs.switch.arguments}\n\t\t\t];\n\t}\n    \n    //node.warn(cmds);\n    \n\tcmds.forEach((cmd, index, aCmds) => {\n        parts = { id:msg._msgid, index:index, count:aCmds.length};\n    \tsendCmdMsg(msg,cmd.cmd,cmd.arguments,parts);\n\t});\n\t\n\t\n\t// zap attrs\n\tflow.set(varName,undefined);\n}\n\n//node.warn('--------------------end func');\n\nreturn;\n\n\nfunction checkAttrs(attrs) {\n\t// make sure all attributes are filled for colorMode, if so return true!\n\tdataOkay = false;\n\t//node.warn(attrs.colorMode);\n\t\n\tswitch(attrs.colorMode.arguments) {\n\t\tcase \"CT\":\n\t\t\tdataOkay = ( \n\t\t\t    attrs.colorTemperature.arguments !== \"\" && \n\t\t\t    attrs.level.arguments !== \"\" && \n\t\t\t    attrs.switch.arguments !== \"\" \n\t\t\t);\n\t\t\t//node.warn(\"CT = \" + dataOkay);\n\t\t\tbreak;\n\t\tcase \"RGB\":\n\t\t\tdataOkay = ( \n\t\t\t    attrs.hue.arguments !== \"\" && \n\t\t\t    attrs.saturation.arguments !== \"\" && \n\t\t\t    attrs.level.arguments !== \"\"  && \n\t\t\t    attrs.switch.arguments !== \"\" \n\t\t\t);\n\t\t\t//node.warn(\"RGB = \" + dataOkay);\n\t\t\tbreak;\n\t}\n\n\t//if (dataOkay) node.warn(attrs);\n\t\n\treturn dataOkay;\n}","outputs":1,"noerr":0,"x":200,"y":80,"wires":[["ae35af45.f6423"]]}]
1 Like

I must not be pushing the limits with Node Red because I don't have a single subflow. I went thru all of mine and only found one place where I could do it and it would only change 2 nodes to 1 so not worth the effort. Other than @erktrek who has already shared, what kind of things are you guys doing with subflows?

I rarely use subflows. Sometimes, but not often. Not because I don't like subflows, they are great, it is just more of a stylistic decision.

I use them whenever I have a function node that I reuse many times. That way I only have to change code in one place. Otherwise certain things like a predefined email alert notification or "sensor open for 5 mins" kind of thing. I've also done a "group" of sensors with a rate limit delay node. The key is de-duplication of stuff - almost like a function library.

1 Like

So another post.. just did this thanks to @fblackburn's excellent new update. This sets 2 dashboard chart nodes (one for each hub) with battery device levels... (very bad of me not to be more descriptive in naming nodes)

The Rocket!

1 Like

I needed a motion lighting flow that respected manually controlling the lights. Along with usual time of day, illuminance filters. I wasn't being very successful, so Googling around I found an example from a HA user. It uses a node called a finite state machine. It takes a little bit to understand if you are not a programmer, but it's not that conceptually difficult. Basically the flow chooses a path based on triggers, current state, and future state. There's a lot more at the original reddit post.

Flow JSON:

Summary
[
{
    "id": "cd2e24c3.24164",
    "type": "state-machine",
    "z": "32054f7b.6f13c",
    "name": "",
    "triggerProperty": "payload",
    "triggerPropertyType": "msg",
    "stateProperty": "payload",
    "statePropertyType": "msg",
    "outputStateChangeOnly": true,
    "throwException": false,
    "states": [
        "switch",
        "motion-detected",
        "motion-on",
        "motion-off",
        "off",
        "on"
    ],
    "transitions": [
        {
            "name": "motion",
            "from": "off",
            "to": "motion-detected"
        },
        {
            "name": "motion",
            "from": "motion-on",
            "to": "motion-on"
        },
        {
            "name": "off",
            "from": "*",
            "to": "off"
        },
        {
            "name": "on",
            "from": "*",
            "to": "on"
        },
        {
            "name": "switch",
            "from": "off",
            "to": "switch"
        },
        {
            "name": "switch",
            "from": "on",
            "to": "switch"
        },
        {
            "name": "switch",
            "from": "switch",
            "to": "switch"
        },
        {
            "name": "switch",
            "from": "motion-on",
            "to": "switch"
        },
        {
            "name": "motion-on",
            "from": "motion-detected",
            "to": "motion-on"
        },
        {
            "name": "motion-off",
            "from": "motion-on",
            "to": "motion-off"
        }
    ],
    "x": 460,
    "y": 360,
    "wires": [
        [
            "e4bc4a4c.a41c88",
            "360cbf98.e378a8",
            "56259156.cacac",
            "3abe544f.9780ec"
        ]
    ]
},
{
    "id": "2e7249fe.b79626",
    "type": "change",
    "z": "32054f7b.6f13c",
    "name": "switch",
    "rules": [
        {
            "t": "set",
            "p": "payload",
            "pt": "msg",
            "to": "switch",
            "tot": "str"
        }
    ],
    "action": "",
    "property": "",
    "from": "",
    "to": "",
    "reg": false,
    "x": 270,
    "y": 400,
    "wires": [
        [
            "cd2e24c3.24164"
        ]
    ]
},
{
    "id": "81b55db6.ac465",
    "type": "change",
    "z": "32054f7b.6f13c",
    "name": "motion",
    "rules": [
        {
            "t": "set",
            "p": "payload",
            "pt": "msg",
            "to": "motion",
            "tot": "str"
        }
    ],
    "action": "",
    "property": "",
    "from": "",
    "to": "",
    "reg": false,
    "x": 270,
    "y": 360,
    "wires": [
        [
            "cd2e24c3.24164"
        ]
    ]
},
{
    "id": "e0147903.1a0668",
    "type": "stoptimer",
    "z": "32054f7b.6f13c",
    "duration": "2",
    "units": "Minute",
    "payloadtype": "num",
    "payloadval": "0",
    "name": "pause detection",
    "x": 860,
    "y": 540,
    "wires": [
        [
            "9d1eb16.c4c095"
        ],
        []
    ]
},
{
    "id": "18468b2f.edbca5",
    "type": "change",
    "z": "32054f7b.6f13c",
    "name": "stop",
    "rules": [
        {
            "t": "set",
            "p": "payload",
            "pt": "msg",
            "to": "stop",
            "tot": "str"
        }
    ],
    "action": "",
    "property": "",
    "from": "",
    "to": "",
    "reg": false,
    "x": 830,
    "y": 480,
    "wires": [
        [
            "786d7e71.4c4598"
        ]
    ]
},
{
    "id": "70df8219.d66544",
    "type": "change",
    "z": "32054f7b.6f13c",
    "name": "motion-on",
    "rules": [
        {
            "t": "set",
            "p": "payload",
            "pt": "msg",
            "to": "motion-on",
            "tot": "str"
        }
    ],
    "action": "",
    "property": "",
    "from": "",
    "to": "",
    "reg": false,
    "x": 1250,
    "y": 300,
    "wires": [
        [
            "81434535.f6326"
        ]
    ]
},
{
    "id": "9fdf23ab.1043a8",
    "type": "change",
    "z": "32054f7b.6f13c",
    "name": "motion-off",
    "rules": [
        {
            "t": "set",
            "p": "payload",
            "pt": "msg",
            "to": "motion-off",
            "tot": "str"
        }
    ],
    "action": "",
    "property": "",
    "from": "",
    "to": "",
    "reg": false,
    "x": 1250,
    "y": 360,
    "wires": [
        [
            "81434535.f6326"
        ]
    ]
},
{
    "id": "b0621693.6aa238",
    "type": "stoptimer",
    "z": "32054f7b.6f13c",
    "duration": "1",
    "units": "Second",
    "payloadtype": "num",
    "payloadval": "0",
    "name": "pause",
    "x": 1030,
    "y": 420,
    "wires": [
        [
            "9d1eb16.c4c095"
        ],
        []
    ]
},
{
    "id": "da08aec3.d749a",
    "type": "stoptimer",
    "z": "32054f7b.6f13c",
    "duration": "1",
    "units": "Second",
    "payloadtype": "num",
    "payloadval": "0",
    "name": "pause",
    "x": 1030,
    "y": 300,
    "wires": [
        [
            "70df8219.d66544"
        ],
        []
    ]
},
{
    "id": "1f3745d7.2e5fa2",
    "type": "inject",
    "z": "32054f7b.6f13c",
    "name": "steady-state",
    "topic": "",
    "payload": "stop",
    "payloadType": "str",
    "repeat": "",
    "crontab": "",
    "once": true,
    "onceDelay": 0.1,
    "x": 1070,
    "y": 620,
    "wires": [
        [
            "e0147903.1a0668",
            "9d1eb16.c4c095"
        ]
    ]
},
{
    "id": "e7869b10.0f8bf",
    "type": "inject",
    "z": "32054f7b.6f13c",
    "name": "",
    "topic": "",
    "payload": "simulate",
    "payloadType": "str",
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": 0.1,
    "x": 100,
    "y": 340,
    "wires": [
        [
            "81b55db6.ac465"
        ]
    ]
},
{
    "id": "e4bc4a4c.a41c88",
    "type": "switch",
    "z": "32054f7b.6f13c",
    "name": "motion-detected",
    "property": "payload",
    "propertyType": "msg",
    "rules": [
        {
            "t": "eq",
            "v": "motion-detected",
            "vt": "str"
        }
    ],
    "checkall": "true",
    "repair": false,
    "outputs": 1,
    "x": 690,
    "y": 300,
    "wires": [
        [
            "76ef38e1.e0c138"
        ]
    ]
},
{
    "id": "360cbf98.e378a8",
    "type": "switch",
    "z": "32054f7b.6f13c",
    "name": "motion-on",
    "property": "payload",
    "propertyType": "msg",
    "rules": [
        {
            "t": "eq",
            "v": "motion-on",
            "vt": "str"
        }
    ],
    "checkall": "true",
    "repair": false,
    "outputs": 1,
    "x": 670,
    "y": 360,
    "wires": [
        [
            "786d7e71.4c4598"
        ]
    ]
},
{
    "id": "b1cbc49a.9cd008",
    "type": "link in",
    "z": "32054f7b.6f13c",
    "name": "kitchen state machine",
    "links": [
        "81434535.f6326"
    ],
    "x": 355,
    "y": 300,
    "wires": [
        [
            "cd2e24c3.24164"
        ]
    ]
},
{
    "id": "81434535.f6326",
    "type": "link out",
    "z": "32054f7b.6f13c",
    "name": "kitchen state machine",
    "links": [
        "b1cbc49a.9cd008"
    ],
    "x": 1455,
    "y": 320,
    "wires": []
},
{
    "id": "56259156.cacac",
    "type": "switch",
    "z": "32054f7b.6f13c",
    "name": "switch",
    "property": "payload",
    "propertyType": "msg",
    "rules": [
        {
            "t": "eq",
            "v": "switch",
            "vt": "str"
        }
    ],
    "checkall": "true",
    "repair": false,
    "outputs": 1,
    "x": 650,
    "y": 480,
    "wires": [
        [
            "18468b2f.edbca5",
            "e0147903.1a0668"
        ]
    ]
},
{
    "id": "3abe544f.9780ec",
    "type": "switch",
    "z": "32054f7b.6f13c",
    "name": "motion-off",
    "property": "payload",
    "propertyType": "msg",
    "rules": [
        {
            "t": "eq",
            "v": "motion-off",
            "vt": "str"
        }
    ],
    "checkall": "true",
    "repair": false,
    "outputs": 1,
    "x": 670,
    "y": 420,
    "wires": [
        [
            "e4033469.c56598"
        ]
    ]
},
{
    "id": "786d7e71.4c4598",
    "type": "stoptimer",
    "z": "32054f7b.6f13c",
    "duration": "2",
    "units": "Minute",
    "payloadtype": "num",
    "payloadval": "0",
    "name": "",
    "x": 1060,
    "y": 360,
    "wires": [
        [
            "9fdf23ab.1043a8"
        ],
        []
    ]
},
{
    "id": "b7009f7c.1475a8",
    "type": "hubitat device",
    "z": "32054f7b.6f13c",
    "name": "Motion Sensor",
    "server": "d0c8b8e.6894848",
    "deviceId": "2695",
    "attribute": "motion",
    "sendEvent": true,
    "x": 100,
    "y": 40,
    "wires": [
        [
            "a10c31d7.2a55a8"
        ]
    ]
},
{
    "id": "8b7bf52b.866948",
    "type": "hubitat device",
    "z": "32054f7b.6f13c",
    "name": "DR Lights",
    "server": "d0c8b8e.6894848",
    "deviceId": "7",
    "attribute": "switch",
    "sendEvent": true,
    "x": 80,
    "y": 420,
    "wires": [
        [
            "2e7249fe.b79626"
        ]
    ]
},
{
    "id": "76ef38e1.e0c138",
    "type": "hubitat command",
    "z": "32054f7b.6f13c",
    "name": "DR Lights On",
    "server": "d0c8b8e.6894848",
    "deviceId": "7",
    "command": "on",
    "commandArgs": "",
    "x": 880,
    "y": 300,
    "wires": [
        [
            "da08aec3.d749a"
        ]
    ]
},
{
    "id": "e4033469.c56598",
    "type": "hubitat command",
    "z": "32054f7b.6f13c",
    "name": "DR Lights Off",
    "server": "d0c8b8e.6894848",
    "deviceId": "7",
    "command": "off",
    "commandArgs": "",
    "x": 880,
    "y": 420,
    "wires": [
        [
            "b0621693.6aa238"
        ]
    ]
},
{
    "id": "9d1eb16.c4c095",
    "type": "hubitat device",
    "z": "32054f7b.6f13c",
    "name": "DR Lights",
    "server": "d0c8b8e.6894848",
    "deviceId": "7",
    "attribute": "switch",
    "sendEvent": false,
    "x": 1240,
    "y": 440,
    "wires": [
        [
            "e12d195c.ce2e9"
        ]
    ]
},
{
    "id": "e12d195c.ce2e9",
    "type": "change",
    "z": "32054f7b.6f13c",
    "name": "DR Lights State",
    "rules": [
        {
            "t": "set",
            "p": "payload",
            "pt": "msg",
            "to": "payload.value",
            "tot": "msg"
        }
    ],
    "action": "",
    "property": "",
    "from": "",
    "to": "",
    "reg": false,
    "x": 1340,
    "y": 500,
    "wires": [
        [
            "81434535.f6326"
        ]
    ]
},
{
    "id": "e64c4e31.36aaf8",
    "type": "time-range-switch",
    "z": "32054f7b.6f13c",
    "name": "",
    "lat": "",
    "lon": "",
    "startTime": "06:00",
    "endTime": "22:00",
    "startOffset": 0,
    "endOffset": 0,
    "x": 300,
    "y": 140,
    "wires": [
        [
            "aec70c57.f1e2d8"
        ],
        []
    ]
},
{
    "id": "afbbd0dd.bb8b38",
    "type": "hubitat device",
    "z": "32054f7b.6f13c",
    "name": "Lux - Back Entrance",
    "server": "d0c8b8e.6894848",
    "deviceId": "1579",
    "attribute": "illuminance",
    "sendEvent": false,
    "x": 320,
    "y": 200,
    "wires": [
        [
            "ec312867.891898"
        ]
    ]
},
{
    "id": "3b7e53e0.d21554",
    "type": "change",
    "z": "32054f7b.6f13c",
    "name": "Lux Blocked?",
    "rules": [
        {
            "t": "set",
            "p": "lux_block",
            "pt": "flow",
            "to": "0",
            "tot": "num"
        }
    ],
    "action": "",
    "property": "",
    "from": "",
    "to": "",
    "reg": false,
    "x": 660,
    "y": 200,
    "wires": [
        [
            "d768f4ca.32357"
        ]
    ]
},
{
    "id": "aec70c57.f1e2d8",
    "type": "switch",
    "z": "32054f7b.6f13c",
    "name": "",
    "property": "payload",
    "propertyType": "msg",
    "rules": [
        {
            "t": "nempty"
        }
    ],
    "checkall": "true",
    "repair": false,
    "outputs": 1,
    "x": 490,
    "y": 140,
    "wires": [
        [
            "aa9f4f85.57da7"
        ]
    ]
},
{
    "id": "aa9f4f85.57da7",
    "type": "change",
    "z": "32054f7b.6f13c",
    "name": "Time Blocked?",
    "rules": [
        {
            "t": "set",
            "p": "time_block",
            "pt": "flow",
            "to": "0",
            "tot": "num"
        }
    ],
    "action": "",
    "property": "",
    "from": "",
    "to": "",
    "reg": false,
    "x": 660,
    "y": 140,
    "wires": [
        [
            "d768f4ca.32357"
        ]
    ]
},
{
    "id": "ec312867.891898",
    "type": "switch",
    "z": "32054f7b.6f13c",
    "name": "",
    "property": "payload.value",
    "propertyType": "msg",
    "rules": [
        {
            "t": "lt",
            "v": "43",
            "vt": "num"
        }
    ],
    "checkall": "true",
    "repair": false,
    "outputs": 1,
    "x": 490,
    "y": 200,
    "wires": [
        [
            "3b7e53e0.d21554"
        ]
    ]
},
{
    "id": "d768f4ca.32357",
    "type": "function",
    "z": "32054f7b.6f13c",
    "name": "Blocked?",
    "func": "var a= flow.get('time_block')\nvar b= flow.get('lux_block')\nmsg.payload = a+b\nreturn msg;",
    "outputs": 1,
    "noerr": 0,
    "x": 860,
    "y": 160,
    "wires": [
        [
            "1c635c36.ad33ec"
        ]
    ]
},
{
    "id": "a10c31d7.2a55a8",
    "type": "switch",
    "z": "32054f7b.6f13c",
    "name": "Active?",
    "property": "payload.value",
    "propertyType": "msg",
    "rules": [
        {
            "t": "eq",
            "v": "active",
            "vt": "str"
        }
    ],
    "checkall": "true",
    "repair": false,
    "outputs": 1,
    "x": 280,
    "y": 40,
    "wires": [
        [
            "e64c4e31.36aaf8",
            "afbbd0dd.bb8b38"
        ]
    ]
},
{
    "id": "1c635c36.ad33ec",
    "type": "switch",
    "z": "32054f7b.6f13c",
    "name": "Blocked =0",
    "property": "payload",
    "propertyType": "msg",
    "rules": [
        {
            "t": "eq",
            "v": "0",
            "vt": "num"
        }
    ],
    "checkall": "true",
    "repair": false,
    "outputs": 1,
    "x": 1010,
    "y": 160,
    "wires": [
        [
            "81b55db6.ac465"
        ]
    ]
},
{
    "id": "4ccc06b2.f00188",
    "type": "comment",
    "z": "32054f7b.6f13c",
    "name": "Check filters",
    "info": "",
    "x": 90,
    "y": 120,
    "wires": []
},
{
    "id": "1578ab31.0d2b6d",
    "type": "comment",
    "z": "32054f7b.6f13c",
    "name": "Control the lights",
    "info": "",
    "x": 100,
    "y": 280,
    "wires": []
},
{
    "id": "d0c8b8e.6894848",
    "type": "hubitat config",
    "z": "",
    "name": "Hubitat",
    "usetls": false,
    "host": "192.168.1.17",
    "port": "80",
    "token": "e5653e7e-56a0-43fc-8e19-96a6d9f22711",
    "appId": "2834",
    "nodeRedServer": "http://192.168.1.10:1882",
    "webhookPath": "/hubitat/webhook"
}]
2 Likes

So that is cool - thx for the state machine node! Have to check it out.

Also for your function node.. try this one instead (function nodes are not efficient due to the way they sandbox) or recreate using core nodes.

1 Like