To collect your sensor data on home assistant you must have a MQTT broker on it. If it’s not the case, add MQTT integration and configure the MQTT username and password.
Configure your sensor with your broker ip, username and password in its parameters.
Now launch Home Assistant –> Parameters –> Integrations –> MQTT –> Configure
Choose listen to a subject and type your sensor subject (For example TEST/Your_Sensor). Start listening and see if it works.
If it’s ok you just have to declare mqtt sensors in global configuration (/homeassistant/configuration.yaml) :
mqtt:
- sensor:
name: "Your_Sensor"
state_topic: "Test/Your_Sensor"
icon: "mdi:Your_Icon"
unit_of_measurement: "Your_Sensor_unit_of_measurement"
Apply settings in home assistant. You can now make an automation based on your sensor data.
Leave a Reply