Hello all,
here’s a request for help.
I would like to get a node-red device, feed its output into a NodeRed-HA-sensor-entity-node, so it can act as the devices sensor, visible to HA. Unfortunately, attempts to get the fevice funtioning properly directly in HA, were unsucessful.
The device is working fine. The reason for my request is, that I don’t have the coding knowledge or understanding, to get doing as requested.
msg.payload.object is not the right path. You also do not need any attributes, you can delete them all.
Next to the value for ulimitset there will be a button for copy path, choose that. Then paste that result where msg.payload.object is.
Hello Mike,
followed up on you suggestion. It did something correctly. The sensor node ist filled with the message data. for some reason, it still produces an API error. Still looking for a possible reason. Maybe you are quicker
Sorry didn’t notice you had it set to sensor, it needs to be a binary sensor. true/false, open/close, on/off, whenever it is a yes or no type answer it will be a binary sensor.
To add about attributes, this is secondary information that can also be sent to the sensor. To add an attribute, use the same method you used to get the path, then when you add the attribute set it to msg. and paste the path in the attribute value box. The sensor/binary sensor is set according to the primary value.
I see. Well there is lots of nonbinary data, which i am interested in using. I’ll just tinker on. I have made non-binary sensors work to display number states, but the output from their connected device, was configured in such a way, that only the required data is transmitted.
I’d live to cut back on entities though, and love to configure the sensors to catch the entire dataset. And it did work, by the way. as you can see here:
Thanks for your help. I think the issue is solved.
On the same flow, there now seems to be another issue. It concerns feedback reporting and command acceptance of the device node (the grey node in the flow graphic).
It seems, that there is some form of hibernation mode for the node. As it happens, it does not consistently report position back to node-red or home assistant. At the same time, commands from node-red or HA are not executed. However, using the devices own control app, shutter position is being reported and commands are executed immediately and correctly.
I work with input_booleans to transmit commands from HA to the node-red, where the state change node should sense the input booleans state change, and send the respective command string message payload straight to the device node
Sounds like it is the device’s integration. Does it primarily connect to nodered or is there an integration in HA? If it connects to HA you have to trouble shoot that first.
If it connects directly to nodered, try the nodered forum.
Hey Mike,
thanks for the reply. Only just read it. In the meantime, I found a possible solution. Apparently, this has been implemented by the creators of the nodes. Sending a “?” to the device node, will wake it up and return present state
@rlust I guess your debug node is set to Payload? I can suggest to (mostly) always set it to whole message object to see the full message.
Generally in NR you have:
messages: the whole thing that gets transferred between nodes
objects: are inside a message and can contain more objects or keys
keys: or key-value pairs contain the actual data
The grey object just says that config or state are objects. You can’t use object in the State field
You can set your dgn attribute via msg.payload.state.dgn. Then the attribute should have the value 1FFF4
If your debug node is set to whole message object it would just be msg.state.dgn
Syntox thanks so much for your help! My brain is missing something in your explanation. I need a picture. Could you give me an example of how to pull attributes into an entity. Does not need to be like mine just an idea of where to put the objects. Thanks so much!
I have set my Debug node to complete msg object to see the entire message in the debug log:
In the entity-node you just put the path of the wanted value (1FFF4) inside the value field of the attribute. You can copy the path by clicking the icon (green box) next to the wanted value in your debug log. And of course, don’t forget to select msg. from the dropdown so it’ll be msg.PATH.TO.VALUE:
So is there a way to filter payload information with the exception of some specific information? Basically I have a numerically that defines (by measured distance) whether my car is in the garage or not. I cant seam to filter out this information. I’m posting here as I am using the entity node to push the data to my dash board. A “True” response mean car is occuping the garage, false is vacant, and because my sensor some times returns an unknown response this to is marked as vacant, the problem is the sensor sends its numerically information and posts it to the dash board, This information I do not want.
For instance, in the above example it’s extracting the current temperature from the panel heater and putting it into the msg.currtemp variable.
You can extract the path to the variable in question by hovering over the attribute and then selecting “Copy Path” from the icons that show up on the right of the highlighted row. All you need to do is then paste that into the “to the value” box, give the msg. variable an appropriate name and hit OK.