Im ruining RasPi with rtl_433 and MQTT client on one device
On second device I’ve got HA on Debian.
First configuration was all fine. I’ve managed to add sensor to HA and display temperature.
My sensor is capable of reading temp and humidity so I’ve tried to add humidity sensor based on MQTT received from RasPi then all values went to 0 or Unknown. Don’t know the reason why? I’ve reinstalled Mosquito-MQTT and removed and added user again but still the same outcome.
This is the command i run on RasPi
"rtl_433 -C si -s 1024k -F “mqtt://192.168.0.30:1883,user=matys,pass=mypass,devices=rtl_433[/id]”
On Home Assist side: can see MQTT is coming, when i listen to a topic rtl_433173/temperature_C:
Message 0 received on rtl_433173/temperature_C at 15:49:
7.5
When trying to add sensor to the dashboard, all I get is value 0 or Unknown
Please format your code correctly with the </> button. You might have indentation errors we can’t see.
However, your problem is that you are “double-referencing” the key you need. From the look of that Explorer view, you don’t need the value_template line at all, as the value you’re getting in the topic is what you want already.
Your current configuration is trying to extract a temperature key out of 7.5.
Here’s how I’d set them up, with less generic names, random IDs (I use this), units and appropriate device_classes (docs):
I am, yes. Your temperature code would work if the topic rtl_433173/temperature_C contains {"temp1": 7.5} but it doesn’t, it just contains the value 7.5.
Note that I’ve edited my response above to add a few more things.