Kind of new to Node Red here. So I’m trying to poll multiple entities every 60 seconds using the “Get Entities” node on Node Red (running as an Add-On on Home Assistant) - I’m not sure what I’m doing wrong, all I see is “no results” (see attached screenshot)
Can someone please explain to me what I’m doing wrong here?
My end goal is to send values over MQTT. I’m able to successfully do this using the “Poll State” node+function node (that modifies payload into the json format I want) + mqtt out node - but this works for one entity at a time. I’m trying to do this for multiple entities using a single flow.
Most people here use Node-red as a stand-alone programming language, not as an add-on to Home Assistant.
Are you expecting your Entities node to generate messages when something happens - perhaps when an 'Entity' pops into existence or changes state?
I suspect you are better off to ask in the Home Assistant forum, where folks will be more familiar with HA nodes.
In the meantime this playlist will introduce you to the Node-red way, which is rather different to how HA does things. Node-RED Essentials. The short videos are made by the developers of node-red.
I don't use HA either but my interpretation of the node config is that you can get a list of "entities" whose "state" property matches what you have typed in.
So I'm guessing that nothing has a "state" of sensor.system_monitor_processor_temp, as that is the name of an entity not a state value, which likely should be a temperature, eg 40 degrees.
I don't have the node, but see what else other than state you can select, perhaps an entity id/name and then use a wild card to select multiple. Maybe contains "sensor.system_monitor_"
You could then filter the results to get the ones you want downstream.
It is rare for entities in home assistant to need to be polled. If you use those entities in an event state node, they will trigger whenever there is an update.
If you want to get the state of a particular entity at a certain time use the entity in a current state node. get entities is for finding entities e.g. find all door or window sensors that are reporting open.
You can find examples for the get entities node at the bottom of this page. You can find examples on how to use each node here.
I just came back here to say that polling is not the best option and there must be another way to get your values, but Mike beat me to it, with what sounds like your best option
So I'm guessing that nothing has a "state" of sensor.system_monitor_processor_temp, as that is the name of an entity not a state value, which likely should be a temperature, eg 40 degrees.
Yes, I thought the same.
see what else other than state you can select, perhaps an entity id/name and then use a wild card to select multiple. Maybe contains "sensor.system_monitor_"
The funny thing is, the Entity Property field has no ‘entity_id’ option available in its list of selectable items. I can see state, last_changed, etc., but not any ‘entity_id’.
It is rare for entities in home assistant to need to be polled. If you use those entities in an event state node, they will trigger whenever there is an update.
My use case involves extracting values regardless of state changes and hence the polling. I am able to poll and send via mqtt an individual entity state every 60 secs. (see screenshot for flow) and I was wondering if I could do the same for a group of entities and not just a single one.
One other thing, it's been so long since I started using NR, I can't remember if globals are enabled by default. Inside an ha node > server > pencil edit button