Hi,
I’ve been trying to monitor CO2 levels in my office and have setup a RaspberryPi Zero to send sensor data via MQTT to HA. I believe I have followed the instructions to install the Mosquitto Broker using the Hass.io addins screen.
CONFIGURATION.YAML
mqtt:
broker: 192.168.0.61
port: 1883
username: myuser
password: somepass
birth_message:
topic: 'hass/status'
payload: 'online'
will_message:
topic: 'hass/status'
payload: 'offline'
sensor:
- platform: mqtt
name: "Roaming CO2"
state_topic: "sensors/test"
unit_of_measurement: "ppm"
To test that Mosquitto is working, i have installed the Mosquitto client tools on my laptop (Win10) and done the following to subscribe and then publish data to the topic. This appears to work and I get the value returned successfully.
TEST SUBSCRIBE
mosquitto_sub -h 192.168.0.61 -p 1883 -u myuser -P somepass -d -t sensors/test
TEST PUBLISH
mosquitto_pub.exe -h 192.168.0.61 -p 1883 -u myuser -P somepass -t sensors/test -m "899"
Unfortunately I never see the sensor appear on my dashboard. I’m still quite new at this and would appreciate any tips or guidance on what I might be doing wrong.
Thanks