Node Red Check other Sequence

Hey guys,

Trying to bring some of my automations over to NR

Having issues with Value Templates that reference other automations. How do you do that when the automation no longer exists after it becomes a node sequence (its a sequence right lol?)

{{ ((as_timestamp(now()) | float) - (as_timestamp(state_attr('automation.motion_morning','last_triggered')) | default(0) | float)) > 36000.0 }}

This is what I want to convert, incase it helps

Thanks :slight_smile:

https://nodered.org/docs/user-guide/context
image

[{"id":"2de93466.6d0c9c","type":"inject","z":"56b1c979.b2c618","name":"start flow","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":186,"y":2784,"wires":[["e817ec03.6dcdd"]]},{"id":"e817ec03.6dcdd","type":"switch","z":"56b1c979.b2c618","name":"condition","property":"payload","propertyType":"msg","rules":[{"t":"else"}],"checkall":"true","repair":false,"outputs":1,"x":348,"y":2784,"wires":[["fd091be9.507ee8","281c1956.83eb46"]]},{"id":"fd091be9.507ee8","type":"debug","z":"56b1c979.b2c618","name":"do action","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":524,"y":2784,"wires":[]},{"id":"281c1956.83eb46","type":"change","z":"56b1c979.b2c618","name":"save current time + 3600","rules":[{"t":"set","p":"motion_morning","pt":"flow","to":"$millis() + 3600\t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":574,"y":2736,"wires":[[]]},{"id":"5806fd6c.78f434","type":"switch","z":"56b1c979.b2c618","name":"condition","property":"[$flowContext(\"motion_morning\"), 0][0] < $millis()","propertyType":"jsonata","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":348,"y":2832,"wires":[["eb7cc161.b513f"]]},{"id":"be91d4ed.2e7658","type":"inject","z":"56b1c979.b2c618","name":"start flow","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":188,"y":2832,"wires":[["5806fd6c.78f434"]]},{"id":"eb7cc161.b513f","type":"debug","z":"56b1c979.b2c618","name":"do action2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":534,"y":2832,"wires":[]}]

Thanks mate! appreciate that.

I think I understand that.

Have I got this right, you think? (really just talking about the switch nodes referencing each other, but the whole thing is here for completeness)

No idea why that’s showing like that. The JSON is there though :frowning:

I ended up using an input boolean and that’s working ok. Now just to get the call service node to play the Alexa Media Center routine :frowning: