Hey.
I need your help. How can I make a mqtt temperature sensor in home assistant with these payloads on the picture under here?
Best Regards Stig
Hey.
I need your help. How can I make a mqtt temperature sensor in home assistant with these payloads on the picture under here?
Best Regards Stig
Fairly easily using the MQTT Sensor integration.
A basic MQTT Sensor configured for temperature would look something like this (in the configuration.yaml
file)
sensor:
- platform: mqtt
name: My Temperature Sensor
state_topic: your/temperature/sensor/topic/goes/here
device_class: temperature
unit_of_measurement: '°C'
However, which one of the two examples represents the temperature? The first topic is timer_hotwater_period and the other is timer_hotwater_start_1.
I do not know the specific temperature sensor yet, because the system there sends the mqtt data to mqtt broker still are in demo mode so and not attach to the Pellet burner therefor it says 1234* - I try the code you have posted to me.
The example I posted will only work if you change the state_topic
to the topic your device uses to report its temperature.
After adding it to configuration.yaml
, you should execute Configuration > Server Controls > Check Configuration to ensure it passes inspection. Then you must restart Home Assistant to load the new MQTT Sensor.
I tried the code but I cant get it to load the payload as a temperature data.
The code are posted in configuration.yaml under sensor:
It will change from unknown
to a value when your device publishes a payload to the the topic pellmon-Temperature
. Until it does that, the sensor’s state will remain unknown
.
Related question:
Did you install and configure the MQTT integration?
okay thank you, I will try to play around with that code and hope it will work for me
best regards
I got it to work
Glad to hear you got it working.
For the benefit of other users, please mark my first post with the Solution tag. This will automatically place a check-mark next to the topic’s title which indicates that this topic has an accepted solution. It helps other users find answers to similar questions.
Yes I will.
Do you know some tricks to format the decimals correct so it not say 1,234* but keeps it like 1234*
As far as I know, you can’t format the number. However, that shouldn’t pose a problem unless you are expecting to regularly measure temperatures that exceed 1000 degrees Celsius.
Is this some kind of commercial or industrial device?
It maybe reach 1000* celsius then it measures the temperature on the pellet burner. But in the rest of time its just normal decimal around 0-100* celcius.
It is this system Pellmon, some monitoring software you can connect to your Pellet burner with a raspberry pi or other linux based system with a FTDI seriel rs232 link https://github.com/motoz/PellMon
Here are a little example :
Interesting! I’m surprised by hot it can get. That’s certainly more than enough to burn off most combustible gases.
yes you are absolutely right.