State-node - output properties not working

Hi all,

I’m using the state-node to check if the current power consumption of a smart socket is below 5W for 3minutes. When it is yes I want to send output properties in the msg-body. But this does not seem to work.

image

I’m putting this message in the debug output but the customData, test and isCurrentlyRunning properties are not added to the msg-message.

(for testing purposes I added these output properties for a state-node where the power consumption > 5W).

I’m wondering what I’m doing wrong.

I’m using Node-Red version 2.0.5 installed on Home Assistant OS 6.1.

Many thanks for any suggestions!
Joris

1 Like

Which node type is this specifically? I’m also using version 2.0.5 but don’t see a state node, the closest thing I have are: events: state, trigger: state, poll: state, and current state. I didn’t see any option for output properties in any of those nodes, though.

Hi,

It is the events: state node.

So this one visually:

image

It is weird, clicking on it does not give me the output properties in the help section of node red.

Kr,

Joris

Strange, I don’t see any output properties on that node type:

Make sure you don’t have an older version of the HA nodes pinned in your config.

Your example is working fine for me. Do you have an errors in the NR logs?

image

[{"id":"7a632b95a6e00475","type":"debug","z":"ffbd7f06.4a014","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":642,"y":1584,"wires":[]},{"id":"b5d31cdb0d6782d9","type":"server-state-changed","z":"ffbd7f06.4a014","name":"","server":"","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.testnumber","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"5","halt_if_type":"num","halt_if_compare":"gt","outputs":2,"output_only_on_state_change":true,"for":"10","forType":"num","forUnits":"seconds","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"isCurrentlyRunning","propertyType":"msg","value":"true","valueType":"bool"},{"property":"customData","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"},{"property":"test","propertyType":"msg","value":"test","valueType":"str"}],"x":338,"y":1584,"wires":[["7a632b95a6e00475"],[]]}]

Thanks @Kermit , it hadn’t occurred to me that I need to manually nodes in the palette settings. Lots of new nodes to investigate.

When I test your flow I don’t get any of the added properties in the message:
image

How should I check these version of the nodes itself?

It seems that I had to update the home assistant websocket node. Now it works perfectly.

Thanks!