I was wondering, is it possible to pass a (variable) (part of ) regEx into another node.
In the node below I’m using a regEx to find all groups, belonging to a specific area, in this case "woonkmr (with state == “on”)
[{"id":"41a6f55123e3d0f6","type":"ha-get-entities","z":"593fb70375108267","name":"","server":"2fba4297.e4145e","version":0,"rules":[{"property":"entity_id","logic":"is","value":"group...*woonkmr_.*","valueType":"re"},{"property":"state","logic":"is","value":"on","valueType":"str"}],"output_type":"split","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":590,"y":400,"wires":[["53f6565f375405fe"]]},{"id":"2fba4297.e4145e","type":"server","name":"Home Assistant BasAdmin","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true,"heartbeat":true,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]
In order to have a more flexible flow I would like to be able to pass the area part (“woonkmr”) as a variable for the get entities node.
The whole flow is driven by a helper (presence) for a specific area, when it changes (to off) it triggers a routine to switch off lights and in the end all devices in the area. But I want this only to happen when lights and such are on in that area in the first place…
[{"id":"41a6f55123e3d0f6","type":"ha-get-entities","z":"593fb70375108267","name":"","server":"2fba4297.e4145e","version":0,"rules":[{"property":"entity_id","logic":"is","value":"group...*woonkmr_.*","valueType":"re"},{"property":"state","logic":"is","value":"on","valueType":"str"}],"output_type":"split","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":590,"y":400,"wires":[["53f6565f375405fe"]]},{"id":"2fba4297.e4145e","type":"server","name":"Home Assistant BasAdmin","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true,"heartbeat":true,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]
Above is the work around, but I was just wondering