Next device alarm in Node Red

I’m trying to use the Ariela app’s mqtt sensor that sends the next due alarm with node red.

trigger:
minutes: /1
platform: time
seconds: 0
condition:
condition: template
value_template: '{{ (((as_timestamp(now()) | int) + 3*60) | timestamp_custom("%Y-%m-%d %H:%M:00")) == states.sensor.android_device_next_alarm.state }}'
action:
data:
  entity_id: scene.wakeup
service: scene.turn_on

I’m new to node-red and I can’t seem to figure out the best way about this, has anyone else done this? How do I compare the time/date the sensor gives to the current time/date

[{"id":"5d03a6d4.d2b098","type":"moment","z":"ffbd7f06.4a014","name":"","topic":"","input":"","inputType":"msg","inTz":"America/Los_Angeles","adjAmount":0,"adjType":"days","adjDir":"add","format":"Y-MM-DD HH:mm:00","locale":"en_US","output":"date","outputType":"msg","outTz":"America/Los_Angeles","x":308,"y":448,"wires":[["d346d4e0.8a30f8"]]},{"id":"fe6b9853.eeb818","type":"inject","z":"ffbd7f06.4a014","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"*/1 0-23 * * *","once":false,"onceDelay":0.1,"x":118,"y":448,"wires":[["5d03a6d4.d2b098"]]},{"id":"d346d4e0.8a30f8","type":"api-current-state","z":"ffbd7f06.4a014","name":"","server":"2dad33ee.42bf5c","outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.android_device_next_alarm","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"","override_data":"none","x":622,"y":448,"wires":[["4becaece.37fd"]]},{"id":"4becaece.37fd","type":"switch","z":"ffbd7f06.4a014","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"date","vt":"msg"}],"checkall":"true","repair":false,"outputs":1,"x":882,"y":448,"wires":[["9e83b60c.b47d08"]]},{"id":"9e83b60c.b47d08","type":"api-call-service","z":"ffbd7f06.4a014","name":"","server":"2dad33ee.42bf5c","service_domain":"scene","service":"turn_on","data":"{\"entity_id\":\"scene.wakeup\"}","mergecontext":"","output_location":"","output_location_type":"none","x":1050,"y":448,"wires":[[]]}]

Could also just use a get template node to compare the dates within Home Assistant.

[{"id":"527499f5.6f6b38","type":"api-render-template","z":"ffbd7f06.4a014","name":"compare","server":"2dad33ee.42bf5c","template":"{{ (((as_timestamp(now()) | int) + 3*60) | timestamp_custom(\"%Y-%m-%d %H:%M:00\")) == states.sensor.android_device_next_alarm.state }}","resultsLocation":"payload","resultsLocationType":"msg","templateLocation":"","templateLocationType":"none","x":428,"y":480,"wires":[["1d2f7b1f.d5fa25"]]},{"id":"1d2f7b1f.d5fa25","type":"switch","z":"ffbd7f06.4a014","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"True","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":562,"y":480,"wires":[["8dc86a83.9aa508"]]},{"id":"d173413c.7f95b","type":"inject","z":"ffbd7f06.4a014","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"*/1 0-23 * * *","once":false,"onceDelay":0.1,"x":278,"y":480,"wires":[["527499f5.6f6b38"]]},{"id":"8dc86a83.9aa508","type":"api-call-service","z":"ffbd7f06.4a014","name":"","server":"2dad33ee.42bf5c","service_domain":"scene","service":"turn_on","data":"{\"entity_id\":\"scene.wakeup\"}","mergecontext":"","output_location":"","output_location_type":"none","x":730,"y":480,"wires":[[]]}]

Perfect! thank you very much for that

An adjusted version to allow two phones with alarm and filter during morning hours and only act when home.

[{"id":"b0d50eaa.d005a","type":"inject","z":"56bc8fc0.48d1d","name":"Time","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"*/1 0-23 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":290,"y":900,"wires":[["547c2851.78a08"]]},{"id":"b41ed2da.23b9c8","type":"api-current-state","z":"56bc8fc0.48d1d","name":"Guy","server":"9c0d279b.e09278","version":2,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.gsm_guy_next_alarm","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"x":430,"y":980,"wires":[["ac7475ed.139358"]]},{"id":"cd3f36cf.c369c","type":"switch","z":"56bc8fc0.48d1d","name":"","property":"timestamp","propertyType":"msg","rules":[{"t":"eq","v":"alarm","vt":"msg"},{"t":"eq","v":"alarmlut","vt":"msg"}],"checkall":"true","repair":false,"outputs":2,"x":770,"y":900,"wires":[["43c0ec2f.76874c"],["43c0ec2f.76874c"]]},{"id":"9997dd82.31229","type":"debug","z":"56bc8fc0.48d1d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":750,"y":1060,"wires":[]},{"id":"ac7475ed.139358","type":"moment","z":"56bc8fc0.48d1d","name":"Format","topic":"","input":"","inputType":"msg","inTz":"Europe/Brussels","adjAmount":0,"adjType":"days","adjDir":"add","format":"YY-MM-DD HH:mm","locale":"C","output":"alarm","outputType":"msg","outTz":"Europe/Brussels","x":580,"y":980,"wires":[["98fc39db.7d2ea8"]]},{"id":"547c2851.78a08","type":"moment","z":"56bc8fc0.48d1d","name":"Format","topic":"","input":"","inputType":"msg","inTz":"Europe/Brussels","adjAmount":0,"adjType":"days","adjDir":"add","format":"YY-MM-DD HH:mm","locale":"C","output":"timestamp","outputType":"msg","outTz":"Europe/Brussels","x":440,"y":900,"wires":[["b41ed2da.23b9c8"]]},{"id":"98fc39db.7d2ea8","type":"api-current-state","z":"56bc8fc0.48d1d","name":"Lut","server":"9c0d279b.e09278","version":2,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.gsm_lut_next_alarm","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"x":430,"y":1060,"wires":[["7e95b7e6.69e838"]]},{"id":"7e95b7e6.69e838","type":"moment","z":"56bc8fc0.48d1d","name":"Format","topic":"","input":"","inputType":"msg","inTz":"Europe/Brussels","adjAmount":0,"adjType":"days","adjDir":"add","format":"YY-MM-DD HH:mm","locale":"C","output":"alarmlut","outputType":"msg","outTz":"Europe/Brussels","x":580,"y":1060,"wires":[["cd3f36cf.c369c","9997dd82.31229"]]},{"id":"43c0ec2f.76874c","type":"time-range-switch","z":"56bc8fc0.48d1d","name":"Is Ochtend?","lat":"","lon":"","startTime":"4:00","endTime":"9:00","startOffset":0,"endOffset":0,"x":950,"y":900,"wires":[["ba135132.b83e4"],[]]},{"id":"ba135132.b83e4","type":"api-current-state","z":"56bc8fc0.48d1d","name":"Thuis","server":"9c0d279b.e09278","version":2,"outputs":2,"halt_if":"home","halt_if_type":"str","halt_if_compare":"is","entity_id":"group.household","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1130,"y":900,"wires":[["5e7c9d90.b4a1b4"],[]]},{"id":"5e7c9d90.b4a1b4","type":"api-call-service","z":"56bc8fc0.48d1d","name":"Rollen omhoog","server":"9c0d279b.e09278","version":3,"debugenabled":false,"service_domain":"cover","service":"open_cover","entityId":"cover.rol_lutguy, cover.rol_dressing","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1300,"y":900,"wires":[[]]},{"id":"9c0d279b.e09278","type":"server","name":"Home Assistant","addon":true}]