Can a JSON aficionado help me here. I’m almost there, just horrible with JSON.
I have the current amount of seconds the fridge has been opened being sent to the ‘set input_number’ node in the msg.duration field. How do I have that valuer be ADDED to the current number, and not just replaced.
So if input_number.fridge is currently at 6, and msg.duration = 3, I want the new value of input.nnumber_fridge to be 9
[{"id":"58112c045cb6f52a","type":"tab","label":"Flow 5","disabled":false,"info":"","env":[]},{"id":"e2c73e76a96eb792","type":"inject","z":"58112c045cb6f52a","name":"Fridge opened","props":[{"p":"command","v":"start","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":179,"y":162,"wires":[["603a73482f847ecc"]]},{"id":"f281b49569119026","type":"inject","z":"58112c045cb6f52a","name":"Fridge closed","props":[{"p":"command","v":"stop","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":188,"y":243,"wires":[["603a73482f847ecc","9c101a4ce20cc5f8"]]},{"id":"9c101a4ce20cc5f8","type":"change","z":"58112c045cb6f52a","name":"Status","rules":[{"t":"set","p":"command","pt":"msg","to":"status","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":186,"y":297,"wires":[["603a73482f847ecc","383b6551d1d2c17c"]]},{"id":"383b6551d1d2c17c","type":"change","z":"58112c045cb6f52a","name":"Reset","rules":[{"t":"set","p":"command","pt":"msg","to":"reset","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":176,"y":351,"wires":[["603a73482f847ecc"]]},{"id":"603a73482f847ecc","type":"hourglass","z":"58112c045cb6f52a","name":"Counter","persistId":"","humanizeLocale":"","x":501,"y":252,"wires":[["fc2f75e972497e54"]]},{"id":"fc2f75e972497e54","type":"change","z":"58112c045cb6f52a","name":"Convert milliseconds to seconds, set in msg.duration","rules":[{"t":"set","p":"duration","pt":"msg","to":"msg.elapsed.millis/1000","tot":"jsonata"},{"t":"set","p":"duration","pt":"msg","to":"$round(duration, 0)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":841,"y":252,"wires":[["aa4ab91ef18eb897"]]},{"id":"aa4ab91ef18eb897","type":"api-call-service","z":"58112c045cb6f52a","name":"Set input_number","server":"ab3e2c53.e3491","version":3,"debugenabled":false,"service_domain":"input_number","service":"set_value","entityId":"input_number.fridge","data":"{\"value\":\"{{duration}}\"}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1216,"y":252,"wires":[[]]},{"id":"ab3e2c53.e3491","type":"server","name":"AvilaSmartHome","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]