When my lock become unlocked, I would like to use a trigger node that will relock the door after a certain number of minutes. I would like the msg.dealy to do so. The delay (in minutes) is store in a input.number helper (Home Assistant). I wish to take the state of the input.number (in minutes) and transform it in ms (*60000) and set it in the msg.dalay.
I do not want to use a fix value, because I have multiple locks with different autolock delay.
[{"id":"68f0521589e62f33","type":"api-current-state","z":"144c9bef.2833a4","name":"Get autolock Delay","server":"e447d17a.16a64","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_number.lock_1531_autolock_delay","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"for":0,"forType":"num","forUnits":"minutes","x":290,"y":3540,"wires":[["c9769ffb4f871fb4","4f0d29051c10df9d"]]},{"id":"c9769ffb4f871fb4","type":"change","z":"144c9bef.2833a4","name":"Set Delay","rules":[{"t":"move","p":"payload","pt":"msg","to":"delay","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":3540,"wires":[["0ce9bb6c8578bccf","4bf6c40d36b1de65"]]},{"id":"4f0d29051c10df9d","type":"debug","z":"144c9bef.2833a4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":510,"y":3460,"wires":[]},{"id":"0ce9bb6c8578bccf","type":"debug","z":"144c9bef.2833a4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":670,"y":3460,"wires":[]},{"id":"0caf4c2450378708","type":"inject","z":"144c9bef.2833a4","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"on","payloadType":"str","x":110,"y":3540,"wires":[["68f0521589e62f33"]]},{"id":"4bf6c40d36b1de65","type":"trigger","z":"144c9bef.2833a4","name":"Delay","op1":"","op2":"lock","op1type":"nul","op2type":"str","duration":"1","extend":false,"overrideDelay":true,"units":"min","reset":"lock","bytopic":"topic","topic":"door","outputs":1,"x":670,"y":3540,"wires":[["025d53d5455df831","a35a56f7540b72de"]]},{"id":"025d53d5455df831","type":"debug","z":"144c9bef.2833a4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":850,"y":3460,"wires":[]},{"id":"a35a56f7540b72de","type":"api-call-service","z":"144c9bef.2833a4","name":"Lock the door","server":"e447d17a.16a64","version":5,"debugenabled":false,"domain":"lock","service":"lock","areaId":[],"deviceId":[],"entityId":["lock.lock_1531_2"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":860,"y":3540,"wires":[["f43355f2837f3bc0"]]},{"id":"f43355f2837f3bc0","type":"debug","z":"144c9bef.2833a4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1030,"y":3540,"wires":[]},{"id":"e447d17a.16a64","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]