I am trying to use Node-Red’s trigger-state node to send an alert, whenever the state of one of my connected UPSes changes. This works in a fashion, bit it only copies the actual state value (OL,OB, RB etc) into the msg.payload, so that it does not also carry the identity of which UPS triggered this, nor the battery runtime value
My two UPSes are named ‘UPS’ and ‘UPS-Living’ so the related entities are
which only fills in the sensor.ups_status_data. into the payload. So subsequent nodes have no info on which UPS triggered, nor what the remaining runtime is
I have tried working around this, by defining a custom output, that should emit a string
“remaining runtime: x.xxx”
and triggers (always) [ ie, whenever the ups_status_data changes ]
but it all it sends is ‘undefined: undefined’
How can I habe this look up the related entity and it value and interpolate it into teh custom output (or into the normal payload)?
I’m not sure what debug1 has to do with it, as that gets the positive output. I am interested in how to get another entity reported in the ’ custom output’ which goes to debug3
The entity that triggers the flow is not the same as the entity that you need to pass the data from?
Where it says attributes: object that expands and contains additional information. It would have the entity_id of the entity that triggered the node along with attributes like battery etc.
Correct, I want to include the sensor.ups_battery_runtime entity when the sensor.ups_battery_state changes. I have found no way to look that up and add it to the actual msg.payload, and hence thought I could trigger a second custom output and include it there, but cannot find out how to interpolate that there
In short, any time the state changes, i want to have the remaining runtime transmitted.