Hi to everybody,
I am brand beginner in Node-RED, thus desperately need help: I want the data from Temp+humidity sensors to be reflected on my dashboard. My Xiaomi sensor has msg.payload as follows {"cmd":"heartbeat","model":"sensor_ht","sid":"158d00020f3857","short_id":470,"data":{"voltage":3005,"temperature":20.78,"humidity":47.57,"batteryLevel":81}}
Currently my graph is done by command str.substring
though I understand that’s kindergarden.
Could anybody hint me on a function to pass the data to graph.
Any help is highly appreciated
There might be several ways of doing it but I how I would do it is to create an input_number in HA as the humidity container.
On Node-RED, based on your data, you can get it via: msg.payload.data.humidity
Thanks a lot for your help. Going to try msg.payload.data.humidity.
Kindly ask you to give more details how to create an input_number in HA… Could you?
It’s here: https://www.home-assistant.io/components/input_number/
Add something like this on your configuration.yaml:
input_number:
xiaomi_sensor_humidity:
name: Humidity Sensor
min: 0
max: 100
xiaomi_sensor_temperature:
name: Temperature Sensor
min: -50
max: 50
In Node-RED, you can refer to them as like: input_number.xiaomi_sensor_humidity