Assistance with panic button sequence and flow please

Greetings, and thank you in advance for your support.

UPDATED: We are trying to put together a panic button sequence and flow in node-red to support a single click to start flashing lights on/off for x minutes when a panic button is pressed once, and a manual stop using a double click to stop the x minute loop.

We are using aqara mini switchs (the panic buttons, that support single, double, and long presses.) and aqara light switches with the latest version of HA and node-red.

UPDATED: Our initial sequence and flow are working with a single click, but I’ve been unable to find a way to manually stop the x minute looptimer, i.e. with a double click. I’m looking forward to your comments and suggestions!

The current sequence and flow with the single click is working, i.e. it flashes the lights on/off for x minutes, but I’m unable to get the stoptimer to terminate/stop the looptimer.

[{"id":"57aa5bc9d175781c","type":"server-events","z":"5a0202f96055c14c","name":"ZHA Event","server":"6c09b198.8b806","version":1,"event_type":"zha_event","exposeToHomeAssistant":false,"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"}],"x":80,"y":420,"wires":[["d8b79ff399dcb3ed"]]},{"id":"0578e611b0978c62","type":"debug","z":"5a0202f96055c14c","name":"zha_event","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1030,"y":140,"wires":[]},{"id":"dadb8b405c510c29","type":"api-call-service","z":"5a0202f96055c14c","name":"Alarm Lights Toggle","server":"6c09b198.8b806","version":5,"debugenabled":false,"domain":"light","service":"toggle","areaId":["backyard","entry","hallway","living_room"],"deviceId":["ed26384ce723279da94e926f501bd12e","4a1cef03c616e3fc89366bea55c05588","d294a69c8dbf5e238e316aa152a4e8b9","678565a61f4c82425620e84da4de2b58"],"entityId":["light.lumi_lumi_switch_b1laus01_41bf2b00_on_off","light.lumi_lumi_switch_b1laus01_acb72b00_on_off","light.lumi_lumi_switch_b1laus01_dfbf2b00_on_off","light.lumi_lumi_switch_b1laus01_cebe2b00_on_off"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":970,"y":400,"wires":[["0578e611b0978c62"]]},{"id":"ed41e992f8d45d13","type":"looptimer","z":"5a0202f96055c14c","duration":"1","units":"Second","maxloops":"600","maxtimeout":"1","maxtimeoutunits":"Hour","name":"10 Minute Loop","x":780,"y":320,"wires":[["dadb8b405c510c29"],["4f7df52b968444de"]]},{"id":"4f7df52b968444de","type":"api-call-service","z":"5a0202f96055c14c","name":"Alarm Lights Off","server":"6c09b198.8b806","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":["backyard","entry","hallway","living_room"],"deviceId":["ed26384ce723279da94e926f501bd12e","4a1cef03c616e3fc89366bea55c05588","d294a69c8dbf5e238e316aa152a4e8b9","678565a61f4c82425620e84da4de2b58"],"entityId":["light.lumi_lumi_switch_b1laus01_41bf2b00_on_off","light.lumi_lumi_switch_b1laus01_acb72b00_on_off","light.lumi_lumi_switch_b1laus01_dfbf2b00_on_off","light.lumi_lumi_switch_b1laus01_cebe2b00_on_off"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":980,"y":460,"wires":[["0578e611b0978c62"]]},{"id":"d8b79ff399dcb3ed","type":"switch","z":"5a0202f96055c14c","name":"aqara mini switchs","property":"payload.event.unique_id","propertyType":"msg","rules":[{"t":"cont","v":"00:15:8d:00:07:e9:4e:8a:1:0x0012","vt":"str"},{"t":"cont","v":"00:15:8d:00:07:e9:4e:2f:1:0x0012","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":290,"y":420,"wires":[["3672d9997d59778e"],["3672d9997d59778e"]]},{"id":"3672d9997d59778e","type":"switch","z":"5a0202f96055c14c","name":"Single/Double","property":"payload.event.command","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":520,"y":420,"wires":[["ed41e992f8d45d13"],["1ddb9ecf276d03fb"]]},{"id":"1ddb9ecf276d03fb","type":"stoptimer","z":"5a0202f96055c14c","duration":"2","units":"Second","payloadtype":"num","payloadval":"0","name":"Stoptimer","x":660,"y":520,"wires":[["ed41e992f8d45d13"],["ed41e992f8d45d13"]]},{"id":"6c09b198.8b806","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]
1 Like

Set the trigger node

in the call service

image

Hi, and thank you for your support!
We tested this setting, it turns on the lights for 15 seconds then turns them off. Thank you for showing me how to use this trigger node and service call setting!
We are trying to flash the lights on/off with a 1-second interval (node settings below) for x minutes. We can not figure out how to stop flashing the lights on/off after x minutes.
Can we tune the trigger node settings for this use case?

Try this

[{"id":"e9f465662b9b9a0c","type":"trigger","z":"f80b6c338afd5483","name":"","op1":"toggle","op2":"0","op1type":"str","op2type":"str","duration":"-1","extend":true,"overrideDelay":false,"units":"s","reset":"turn_off","bytopic":"all","topic":"topic","outputs":1,"x":700,"y":2580,"wires":[["b9ef32fc182a4942"]]},{"id":"b9ef32fc182a4942","type":"api-call-service","z":"f80b6c338afd5483","name":"","server":"","version":5,"debugenabled":true,"domain":"light","service":"{{payload}}","areaId":[],"deviceId":[],"entityId":[],"data":"{\"message\":\"{{notification}}\"}","dataType":"jsonata","mergeContext":"","mustacheAltTags":true,"outputProperties":[],"queue":"none","x":940,"y":2620,"wires":[[]]},{"id":"a8ad8552bc00dad3","type":"trigger","z":"f80b6c338afd5483","name":"","op1":"turn_on","op2":"turn_off","op1type":"str","op2type":"str","duration":"2","extend":true,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":470,"y":2620,"wires":[["e9f465662b9b9a0c"],["e9f465662b9b9a0c","b9ef32fc182a4942"]]}]

Nice, thank you very much, that did the trick!

Thank you