High value thread right here, thanks and h/t to all. Iâve deployed around 15 Red switches (mix of 30s and 31s) around the house - after a few months of behavioral analysis, Iâve determined my test subjects (family) have some deeply ingrained âswitch habitsâ and a distinct lack of tolerance for change:
- 95%+ of switch interaction is on/off 1x tap
- Config taps and dimming actions are just starting - later/slower than I expected.
- Multi-taps adopted by 1 user (me)
- Confusion grew in-line with the number of deployed switches (my fault - âlook what I can doâ turned into a mess of various / spotty switch behaviors)
So, Iâve adapted the excellent subflows from @harmfulmushroom, @nappyjim and a few others with the following loose âstandardsâ intended to a) deliver a more familiar experience for my stodgy users, and b) keep the dev team (me) focused on utility first, creative exuberance second:
- Model traditional switch behavior - up=on, down=off
- Maintain consistency - 1x = expected lights, 2x = area/room, config = switches etc.
- Target âintuitively obviousâ behavior - âi wonder what this will doâ is, evidently, more frustrating than interesting to everyone but this admin (even though random color loops on config press are sweet - adoption first, easter eggs second for my users)
The resulting Red Dimmer subflow:
[{"id":"9c21f3d8.28304","type":"subflow","name":"pal-Toggled","info":"","category":"nodePallette","in":[{"x":60,"y":100,"wires":[{"id":"8e0e0b85.f2ee28"}]}],"out":[{"x":740,"y":80,"wires":[{"id":"9f9a2966.460d68","port":0}]},{"x":740,"y":120,"wires":[{"id":"7d408f07.c37f7","port":0}]}],"env":[],"meta":{},"color":"#f59c3d","outputLabels":["On","Off"]},{"id":"8e0e0b85.f2ee28","type":"counter","z":"9c21f3d8.28304","name":"","init":"0","step":"1","lower":"","upper":"","mode":"increment","outputs":1,"x":200,"y":100,"wires":[["7742abfc.1bf6c4"]]},{"id":"9f9a2966.460d68","type":"change","z":"9c21f3d8.28304","name":"on","rules":[{"t":"set","p":"payload","pt":"msg","to":"on","tot":"str"},{"t":"set","p":"service","pt":"msg","to":"turn_on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":80,"wires":[[]]},{"id":"7d408f07.c37f7","type":"change","z":"9c21f3d8.28304","name":"off","rules":[{"t":"set","p":"payload","pt":"msg","to":"off","tot":"str"},{"t":"set","p":"service","pt":"msg","to":"turn_off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":120,"wires":[[]]},{"id":"5a48baf5.097f64","type":"num-if","z":"9c21f3d8.28304","name":"even","condition":"even","checkvalue":"2","x":490,"y":80,"wires":[["9f9a2966.460d68"]]},{"id":"e9876370.21223","type":"num-if","z":"9c21f3d8.28304","name":"odd","condition":"odd","checkvalue":"1","x":490,"y":120,"wires":[["7d408f07.c37f7"]]},{"id":"7742abfc.1bf6c4","type":"change","z":"9c21f3d8.28304","name":"clean","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"move","p":"count","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":100,"wires":[["5a48baf5.097f64","e9876370.21223"]]},{"id":"262c8575.6a270a","type":"subflow","name":"Dimmer Loop","info":"","category":"home_assistant","in":[{"x":80,"y":100,"wires":[{"id":"46386579.fbb7cc"}]}],"out":[{"x":900,"y":80,"wires":[{"id":"864d8f96.b5b9f","port":0}]}],"env":[],"meta":{},"color":"#f26f6f"},{"id":"794d0f18.444d1","type":"looptimer","z":"262c8575.6a270a","duration":".15","units":"Second","maxloops":"20","maxtimeout":"10","maxtimeoutunits":"Second","name":"Dimmer Loop","x":420,"y":80,"wires":[["e162b9ba.124e18"],[]]},{"id":"e162b9ba.124e18","type":"function","z":"262c8575.6a270a","name":"Dim Up/Down","func":"newmsg={}\nvar updown = msg.payload.event.property_key;\nif(updown == \"002\"){\n dim = 10;\n} else { dim = -10;}\nnewmsg.payload={dim}\nreturn newmsg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":620,"y":80,"wires":[["864d8f96.b5b9f"]]},{"id":"864d8f96.b5b9f","type":"change","z":"262c8575.6a270a","name":"On","rules":[{"t":"set","p":"service","pt":"msg","to":"turn_on","tot":"str"},{"t":"move","p":"payload.dim","pt":"msg","to":"data.brightness_step_pct","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":80,"wires":[[]]},{"id":"46386579.fbb7cc","type":"switch","z":"262c8575.6a270a","name":"","property":"payload.event.value_raw","propertyType":"msg","rules":[{"t":"eq","v":"2","vt":"num"},{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":230,"y":100,"wires":[["794d0f18.444d1"],["ddec65a1.9f3b58"]]},{"id":"ddec65a1.9f3b58","type":"change","z":"262c8575.6a270a","name":"Stop","rules":[{"t":"set","p":"payload","pt":"msg","to":"stop","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":120,"wires":[["794d0f18.444d1"]]},{"id":"803845de.f9a508","type":"subflow","name":"RedDim","info":"","category":"home_assistant","in":[{"x":480,"y":440,"wires":[{"id":"158f3c7c.c7f064"}]}],"out":[{"x":1340,"y":220,"wires":[{"id":"1a88b769.0c60d9","port":0},{"id":"ee9ef01a.965a","port":0}]},{"x":1340,"y":280,"wires":[{"id":"7603cdab.552af4","port":0},{"id":"dcefe019.7a3b5","port":0}]},{"x":1340,"y":340,"wires":[{"id":"f4ac0d9e.b9a13","port":0},{"id":"250e8b80.a32af4","port":0}]},{"x":1340,"y":400,"wires":[{"id":"1bb6666.f3ee59a","port":0},{"id":"6ce14d1d.305da4","port":0}]},{"x":1340,"y":460,"wires":[{"id":"518e8d30.5ecf44","port":0},{"id":"3db90f2e.b4c6d","port":0}]},{"x":1340,"y":520,"wires":[{"id":"93d06aa4.cb2908","port":0},{"id":"2d9d0edc.7706f2","port":0}]},{"x":1340,"y":580,"wires":[{"id":"78f123bd.840eec","port":0},{"id":"78f123bd.840eec","port":1}]}],"env":[],"meta":{},"color":"#d94545","outputLabels":["On/Off 1x","On/Off 2x","On/Off 3x","On/Off 4x","On/Off 5x","Dim Up/Down","Config Press"]},{"id":"158f3c7c.c7f064","type":"switch","z":"803845de.f9a508","name":"Scene ID","property":"payload.event.property_key_name","propertyType":"msg","rules":[{"t":"eq","v":"002","vt":"num"},{"t":"eq","v":"001","vt":"num"},{"t":"eq","v":"003","vt":"num"}],"checkall":"true","repair":false,"outputs":3,"x":600,"y":440,"wires":[["3bdb9b5d.9d74a4"],["bccb6520.572d68"],["17191473.842fcc"]]},{"id":"3bdb9b5d.9d74a4","type":"switch","z":"803845de.f9a508","name":"UpPress","property":"payload.event.value_raw","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"eq","v":"3","vt":"num"},{"t":"eq","v":"4","vt":"num"},{"t":"eq","v":"5","vt":"num"},{"t":"eq","v":"6","vt":"num"},{"t":"eq","v":"2","vt":"num"},{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":7,"x":860,"y":240,"wires":[["1a88b769.0c60d9"],["7603cdab.552af4"],["f4ac0d9e.b9a13"],["1bb6666.f3ee59a"],["518e8d30.5ecf44"],["2d9d0edc.7706f2"],["2d9d0edc.7706f2"]],"outputLabels":["Up 1x","Up 2x","Up 3x","Up 4x","Up 5x","Up hold","Up release"]},{"id":"17191473.842fcc","type":"switch","z":"803845de.f9a508","name":"Config","property":"payload.event.value_raw","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":870,"y":660,"wires":[["78f123bd.840eec"]],"outputLabels":["Single Config Tap"]},{"id":"bccb6520.572d68","type":"switch","z":"803845de.f9a508","name":"DownPress","property":"payload.event.value_raw","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"eq","v":"3","vt":"num"},{"t":"eq","v":"4","vt":"num"},{"t":"eq","v":"5","vt":"num"},{"t":"eq","v":"6","vt":"num"},{"t":"eq","v":"2","vt":"num"},{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":7,"x":850,"y":500,"wires":[["ee9ef01a.965a"],["dcefe019.7a3b5"],["250e8b80.a32af4"],["6ce14d1d.305da4"],["3db90f2e.b4c6d"],["93d06aa4.cb2908"],["93d06aa4.cb2908"]],"outputLabels":["Down 1x","Down 2x","Down 3x","Down 4x","Down 5x","Down held","Down release"]},{"id":"93d06aa4.cb2908","type":"subflow:262c8575.6a270a","z":"803845de.f9a508","name":"","env":[],"x":1080,"y":600,"wires":[[]]},{"id":"2d9d0edc.7706f2","type":"subflow:262c8575.6a270a","z":"803845de.f9a508","name":"","env":[],"x":1080,"y":340,"wires":[[]]},{"id":"1a88b769.0c60d9","type":"change","z":"803845de.f9a508","name":"On","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"service","pt":"msg","to":"turn_on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1110,"y":140,"wires":[[]]},{"id":"ee9ef01a.965a","type":"change","z":"803845de.f9a508","name":"Off","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"service","pt":"msg","to":"turn_off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1110,"y":400,"wires":[[]]},{"id":"7603cdab.552af4","type":"change","z":"803845de.f9a508","name":"On","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"service","pt":"msg","to":"turn_on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1110,"y":180,"wires":[[]]},{"id":"f4ac0d9e.b9a13","type":"change","z":"803845de.f9a508","name":"On","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"service","pt":"msg","to":"turn_on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1110,"y":220,"wires":[[]]},{"id":"1bb6666.f3ee59a","type":"change","z":"803845de.f9a508","name":"On","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"service","pt":"msg","to":"turn_on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1110,"y":260,"wires":[[]]},{"id":"518e8d30.5ecf44","type":"change","z":"803845de.f9a508","name":"On","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"service","pt":"msg","to":"turn_on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1110,"y":300,"wires":[[]]},{"id":"dcefe019.7a3b5","type":"change","z":"803845de.f9a508","name":"Off","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"service","pt":"msg","to":"turn_off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1110,"y":440,"wires":[[]]},{"id":"250e8b80.a32af4","type":"change","z":"803845de.f9a508","name":"Off","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"service","pt":"msg","to":"turn_off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1110,"y":480,"wires":[[]]},{"id":"6ce14d1d.305da4","type":"change","z":"803845de.f9a508","name":"Off","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"service","pt":"msg","to":"turn_off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1110,"y":520,"wires":[[]]},{"id":"3db90f2e.b4c6d","type":"change","z":"803845de.f9a508","name":"Off","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"service","pt":"msg","to":"turn_off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1110,"y":560,"wires":[[]]},{"id":"78f123bd.840eec","type":"subflow:9c21f3d8.28304","z":"803845de.f9a508","name":"Toggler","env":[],"x":1100,"y":660,"wires":[[],[]]}]
This approach requires at least a {{payload.service}} variable in the Call Service node and no additional data (i.e. color, brightness, etc.) or the turn_off call will barf in some cases (switches). So I modeled primary scenes for each room in Node Red and pass {{payload.domain /service /entityid}} and data to the Call Service node as appropriate. I still have an occasional on/off (OOF) switch outside of the Inovelli subflows for non-binary use-cases (e.g. on = âset cover to 6%â but off = close cover), but theyâre the exception:
This took some up-front lift to templatize, join, and branch within the scene subflows, but a lot of that was modeling entities and establishing a common subflow palette (pal):
[{"id":"530a946a.c1a54c","type":"subflow","name":"pal-Data","info":"","category":"nodePallette","in":[{"x":540,"y":160,"wires":[{"id":"23b85a23.471646"}]}],"out":[{"x":1180,"y":160,"wires":[{"id":"99d8dfe0.936fc","port":0}]}],"env":[],"meta":{},"color":"#f59c3d"},{"id":"99d8dfe0.936fc","type":"api-call-service","z":"530a946a.c1a54c","name":"BadHass","server":"","version":1,"debugenabled":false,"service_domain":"{{payload.domain}}","service":"{{payload.service}}","entityId":"{{payload.entityid}}","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1000,"y":160,"wires":[[]]},{"id":"6754d793.ce5b38","type":"function","z":"530a946a.c1a54c","name":"noData","func":"newmsg={}\nnewmsg.payload={\n domain:msg.domain,\n service:msg.service,\n entityid:msg.entityid,\n}\nreturn newmsg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":840,"y":180,"wires":[["99d8dfe0.936fc"]]},{"id":"a36f1abc.236c08","type":"function","z":"530a946a.c1a54c","name":"data","func":"newmsg={}\nnewmsg.payload={\n domain:msg.domain,\n service:msg.service,\n entityid:msg.entityid,\n data:{\n \"brightness\":msg.data.brightness,\n \"color_name\":msg.data.color_name,\n \"kelvin\":msg.data.kelvin,\n \"transition\":msg.data.transition,\n \"brightness_pct\": msg.data.brightness_pct,\n \"brightness_step_pct\": msg.data.brightness_step_pct,\n \"profile\": msg.data.profile,\n \"flash\": msg.data.flash,\n \"effect\": msg.data.effect,\n \"temperature\":msg.data.temperature,\n \"position\":msg.data.position\n }\n}\nreturn newmsg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":850,"y":140,"wires":[["99d8dfe0.936fc"]]},{"id":"23b85a23.471646","type":"switch","z":"530a946a.c1a54c","name":"dataSwitch","property":"data","propertyType":"msg","rules":[{"t":"nempty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":670,"y":160,"wires":[["a36f1abc.236c08"],["6754d793.ce5b38"]]},{"id":"304c693c.e92b36","type":"subflow","name":"pal-OOFState","info":"","category":"nodePallette","in":[{"x":200,"y":140,"wires":[{"id":"9501df06.5b7da"}]}],"out":[{"x":620,"y":100,"wires":[{"id":"5ed54fd6.2684e","port":1}]},{"x":620,"y":180,"wires":[{"id":"32901bf3.574db4","port":0}]}],"env":[],"meta":{},"color":"#f59c3d","outputLabels":["On","Off"]},{"id":"5ed54fd6.2684e","type":"api-current-state","z":"304c693c.e92b36","name":"state","server":"","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"{{entityid}}","state_type":"str","state_location":"","override_payload":"none","entity_location":"","override_data":"none","blockInputOverrides":false,"x":470,"y":120,"wires":[[],[]]},{"id":"9501df06.5b7da","type":"switch","z":"304c693c.e92b36","name":"OOF","property":"service","propertyType":"msg","rules":[{"t":"eq","v":"turn_on","vt":"str"},{"t":"eq","v":"turn_off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":310,"y":140,"wires":[["5ed54fd6.2684e"],["32901bf3.574db4"]]},{"id":"32901bf3.574db4","type":"api-current-state","z":"304c693c.e92b36","name":"state","server":"","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"{{entityid}}","state_type":"str","state_location":"","override_payload":"none","entity_location":"","override_data":"none","blockInputOverrides":false,"x":470,"y":160,"wires":[[],[]]},{"id":"a99b75c0.4cc7b8","type":"subflow","name":"pal-Join","info":"","category":"nodePallette","in":[{"x":680,"y":280,"wires":[{"id":"26419813.5a7268"}]}],"out":[{"x":900,"y":280,"wires":[{"id":"26419813.5a7268","port":0}]}],"env":[],"meta":{},"color":"#f59c3d"},{"id":"26419813.5a7268","type":"join","z":"a99b75c0.4cc7b8","name":"","mode":"custom","build":"string","property":"entityid","propertyType":"msg","key":"topic","joiner":",","joinerType":"str","accumulate":false,"timeout":"0.25","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":790,"y":280,"wires":[[]]},{"id":"4db14326.81f06c","type":"subflow","name":"pal-OnOff","info":"","category":"nodePallette","in":[{"x":680,"y":380,"wires":[{"id":"5baa26cd.e88198"}]}],"out":[{"x":1260,"y":340,"wires":[{"id":"f6684654.1b7d58","port":0},{"id":"5baa26cd.e88198","port":0}]},{"x":1260,"y":400,"wires":[{"id":"f2093d3b.70028","port":0},{"id":"5baa26cd.e88198","port":1}]}],"env":[],"meta":{},"color":"#f59c3d"},{"id":"3727d155.810bde","type":"switch","z":"4db14326.81f06c","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"true","vt":"str"},{"t":"eq","v":"false","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":970,"y":460,"wires":[["f6684654.1b7d58"],["f6684654.1b7d58"],["f2093d3b.70028"],["f2093d3b.70028"]]},{"id":"f6684654.1b7d58","type":"change","z":"4db14326.81f06c","name":"On","rules":[{"t":"set","p":"service","pt":"msg","to":"turn_on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1110,"y":420,"wires":[[]]},{"id":"f2093d3b.70028","type":"change","z":"4db14326.81f06c","name":"Off","rules":[{"t":"set","p":"service","pt":"msg","to":"turn_off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1110,"y":500,"wires":[[]]},{"id":"5baa26cd.e88198","type":"switch","z":"4db14326.81f06c","name":"","property":"service","propertyType":"msg","rules":[{"t":"eq","v":"turn_on","vt":"str"},{"t":"eq","v":"turn_off","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":810,"y":380,"wires":[[],[],["3727d155.810bde"]]},{"id":"2ad5208e.c6d02","type":"subflow","name":"SCN-KUCabs","info":"","category":"nodescenes","in":[{"x":140,"y":400,"wires":[{"id":"9d5933e9.c3f92"}]}],"out":[{"x":1360,"y":400,"wires":[{"id":"9cf8d7f5.b1b2d8","port":0},{"id":"4f69e92e.523658","port":0}]}],"env":[],"meta":{},"color":"#3ecf65"},{"id":"6aff0513.92f85c","type":"change","z":"2ad5208e.c6d02","name":"KitchCab1","rules":[{"t":"set","p":"entityid","pt":"msg","to":"switch.kitchen_cabinet_1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":280,"wires":[["cf017b66.708318"]]},{"id":"594352ee.ba8e2c","type":"change","z":"2ad5208e.c6d02","name":"KitchCab3","rules":[{"t":"set","p":"entityid","pt":"msg","to":"switch.kitchen_cabinet_3","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":320,"wires":[["cf017b66.708318"]]},{"id":"35e7486.246d7b8","type":"change","z":"2ad5208e.c6d02","name":"TeaCab1","rules":[{"t":"set","p":"entityid","pt":"msg","to":"switch.tea_cabinet_1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":360,"wires":[["cf017b66.708318"]]},{"id":"6b697ef8.9a942","type":"change","z":"2ad5208e.c6d02","name":"Switch","rules":[{"t":"set","p":"domain","pt":"msg","to":"switch","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":340,"wires":[["6aff0513.92f85c","594352ee.ba8e2c","35e7486.246d7b8"]]},{"id":"9d5933e9.c3f92","type":"subflow:4db14326.81f06c","z":"2ad5208e.c6d02","name":"","x":260,"y":400,"wires":[["6b697ef8.9a942","b7137715.d64408"],["6b697ef8.9a942","b7137715.d64408"]]},{"id":"27cf0989.9545c6","type":"subflow:a99b75c0.4cc7b8","z":"2ad5208e.c6d02","name":"","env":[],"x":1020,"y":320,"wires":[["4f69e92e.523658"]]},{"id":"1435ff19.c8a901","type":"change","z":"2ad5208e.c6d02","name":"TeaCab2","rules":[{"t":"set","p":"entityid","pt":"msg","to":"switch.tea_cabinet_2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":420,"wires":[["40a3ec82.e32b64"]]},{"id":"75262b94.7bc1c4","type":"change","z":"2ad5208e.c6d02","name":"Kitchen2","rules":[{"t":"set","p":"entityid","pt":"msg","to":"light.kitchen_2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":460,"wires":[["40a3ec82.e32b64"]]},{"id":"b28ef26e.9130c","type":"change","z":"2ad5208e.c6d02","name":"Kitchen4","rules":[{"t":"set","p":"entityid","pt":"msg","to":"light.kitchen_4","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":500,"wires":[["40a3ec82.e32b64"]]},{"id":"b7137715.d64408","type":"change","z":"2ad5208e.c6d02","name":"Off","rules":[{"t":"set","p":"service","pt":"msg","to":"turn_off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":460,"wires":[["6da000af.ff12d"]]},{"id":"40a3ec82.e32b64","type":"subflow:a99b75c0.4cc7b8","z":"2ad5208e.c6d02","name":"","x":1020,"y":460,"wires":[["9cf8d7f5.b1b2d8"]]},{"id":"6da000af.ff12d","type":"change","z":"2ad5208e.c6d02","name":"Switch","rules":[{"t":"set","p":"domain","pt":"msg","to":"switch","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":460,"wires":[["1435ff19.c8a901","75262b94.7bc1c4","b28ef26e.9130c"]]},{"id":"cf017b66.708318","type":"subflow:304c693c.e92b36","z":"2ad5208e.c6d02","name":"","x":850,"y":320,"wires":[["27cf0989.9545c6"],["27cf0989.9545c6"]]},{"id":"fab6c649.77c6b8","type":"comment","z":"2ad5208e.c6d02","name":"SCN-KUCabs","info":"","x":280,"y":340,"wires":[]},{"id":"4f69e92e.523658","type":"subflow:530a946a.c1a54c","z":"2ad5208e.c6d02","name":"","x":1200,"y":320,"wires":[[]]},{"id":"9cf8d7f5.b1b2d8","type":"subflow:530a946a.c1a54c","z":"2ad5208e.c6d02","name":"","x":1200,"y":460,"wires":[[]]}]
This approach also makes it easy to repurpose each scene in NR without worrying about the input (turn_on, on, true are branched in pal-OnOff), so you can attach them to Inovelli, schedules, presence flows, NR HASS Switch entities, etc. Acknowledged, you could do the same by calling HASS scripts or scenes/automations, but I prefer Node Redâs functionality and visual object-oriented approach for automation and scene management. That said, the Websocket API is still foreign territory to me, and surely thereâs a more efficient way to set/pass variables to HASS. Mushroomâs pass-nodeID solution looks interesting - need to understand it better to see if it can clean up my sprawling Inovelli Switch flow!