Combining states of two entities into one msg.payload

Upon the state change of an input_number, I want to pass the input number value and the numeric value of an additional input_number entity down the line so a subsequent node can use both values.

I would presume that I need to store both of those values in a flow variable, but I don’t know exactly how to do that with a function node.

Is this the best way to do this, or is there another way, and what would the function look like? (new to javascript)

Hy arretx,

you can use the “Join” Node for this …
There you can define what the output should be - an array, a msg. text or what ever you need.
You can set there how long or how much messages it should catch.

br,
manzn

You could skip the change node if you’re never going to overwrite msg.payload.

msg.number1 and msg.number2 will contain the value of each slider.

[{"id":"d98cdf7a.e8ff2","type":"server-state-changed","z":"dd188fa8.9006c","name":"","server":"2dad33ee.42bf5c","entityidfilter":"input_number.number1","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":248,"y":1008,"wires":[["efe65eb3.055bf"]]},{"id":"5491868e.407b28","type":"api-current-state","z":"dd188fa8.9006c","name":"","server":"2dad33ee.42bf5c","outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_number.number2","state_type":"str","state_location":"number2","override_payload":"msg","entity_location":"","override_data":"none","x":774,"y":1008,"wires":[["8366b53f.909688"]]},{"id":"efe65eb3.055bf","type":"change","z":"dd188fa8.9006c","name":"","rules":[{"t":"set","p":"number1","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":506,"y":1008,"wires":[["5491868e.407b28"]]},{"id":"8366b53f.909688","type":"debug","z":"dd188fa8.9006c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":994,"y":1008,"wires":[]}]

I’ll have to try that. I ended up sending the state node to two locations. 1. A ‘get entities’ node, and a ‘join’ node. In the join node, I combined both messages manually into an array, then used the subsequent nodes to extract the information from the array into the appropriate fields.

Problem I have now is that I can’t seem to get IFTTT to recognize {{value2}} as an integer.

I’m sending the temperature “72.0” for example, from an input_number along with the hold time to IFTTT using the Honeywell app.

The only two pieces of information they need is temperature and hold time. Both of which seem to need to be integers, but IFTTT works with 72.0 as the input value for {{Value1}}. The app fails when the hold time is added…not that it’s critical to have that.

1 Like