Hi there! I’m struggling to connect a sensor via MQTT and display it in HA.
Sending the MQTT message via wifi, mosquitto and displaying in node-red works:
The -1 is the value from the sensor. “Online” is a string I let my esp32 put out as its first message.
Now I would like to display the values in HA. So I tried setting up the sensor like this:
# MQTT
- platform: mqtt
name: Plant moisture sensor
state_topic: "home/sensor/plant1"
unique_id: "sensor.plant_moisture"
availability:
- topic: "home/sensor/plant1"
- payload_available: "online"
Under entities, I can see it was added via the mqtt integration:
But the status of it remains “Restored”, and when I try to display the value in the dashboard it says “unavailable”.
I’m lost and don’t know where to look for. I’m also quite new to this so forgive me
Any thoughts anyone? Thanks