Displaying data from NodeRed in Home Assistant

Is there a neat and easy way to display data in Home Assistant that comes from Node Red?

I’ve been using text entities/helpers but they don’t look very neat and are editable by clicking into them in home assistant which is something I don’t like…

I can’t see a node that would help so thought I’d ask :slight_smile:

The sensor node.

1 Like

Ah, thanks, I thought it was just for temperature type values etc, I’ll have a play with it.

That works fantastic for the running total, thanks for that info.

Would it also show an input like my total since field or would that need to be two sensors??

You can add attributes in the config of the sensor node. You will need to calculate the value and send it to the node in the message name.

Result

Thanks

I’ll have to look at this, not used this node much and never used the attributes bit. Not sure how to set it or what to send it yet to yield my required result :wink:

Hmm,

harder than I thought - the total was so easy but date and time seems not so.

Does anyone have any more tips they can throw in? I can’t find any helpful documentation on the web for this sensor at all, very odd :wink:

Does this help?

[{"id":"b7ae30e6226efbbd","type":"inject","z":"8e6ef4f6cbb13d83","name":"","props":[{"p":"payload"},{"p":"some_value","v":"200.65","vt":"num"},{"p":"some_name","v":"test run","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"10","payloadType":"num","x":840,"y":210,"wires":[["7ca92eaca84d6a41"]]},{"id":"7ca92eaca84d6a41","type":"ha-sensor","z":"8e6ef4f6cbb13d83","name":"","entityConfig":"578b426f39e767d6","version":0,"state":"payload","stateType":"msg","attributes":[{"property":"some_value","value":"some_value","valueType":"msg"},{"property":"some_name","value":"some_name","valueType":"msg"}],"inputOverride":"allow","outputProperties":[],"x":1040,"y":210,"wires":[[]]},{"id":"578b426f39e767d6","type":"ha-entity-config","server":"6b1110b5.183a4","deviceConfig":"","name":"another test","version":6,"entityType":"sensor","haConfig":[{"property":"name","value":"Another test"},{"property":"icon","value":""},{"property":"entity_picture","value":""},{"property":"entity_category","value":""},{"property":"device_class","value":""},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""}],"resend":true,"debugEnabled":false},{"id":"6b1110b5.183a4","type":"server","name":"Home Assistant","version":6,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":["y","yes","true","on","home","open"],"connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"id","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true},{"id":"68710a2ef481b7c0","type":"global-config","env":[],"modules":{"node-red-contrib-home-assistant-websocket":"0.80.3"}}]

Maybe, thanks - I’m away from home now so will try it as soon as i return.

I can’t read the code as such so i’ll have to wait :slight_smile:

Thanks in advance though

Collect the whole set? :grinning:

Thanks,

I have that set now but can’t figure out how I add the attributes to my HA dashboard?

I can get the main entity easily but the two extra attributes do not show up??

It will depend on the card. Some cards can display attributes. I use a markdown card but there are others.

  - type: markdown
    content: >-
      ##  🏃 Next ![Image](http://192.168.0.101:8123/local/dtrain25.jpg) Trains
      @ 205th 


      ---


      ##  {{ states('sensor.next_d') }} 🚀


      ## {{ state_attr('sensor.next_d', 'next1') }} 🚀


      ## {{ state_attr('sensor.next_d', 'next2') }} 🚀


      ## {{ state_attr('sensor.next_d', 'next3') }} 🚀


      ## {{ state_attr('sensor.next_d', 'next4') }} 🚀

Gives me

1 Like

Great, thanks