mankyd
(Dave Mankoff)
April 7, 2021, 7:15pm
1
I had an MQTT sensor created via yaml:
I am building a device that reports, via MQTT, various sensor readings (temp, humidity, pressure, co2, etc.)
I am confused about how I set these up in hass.
It’s easy enough to define an MQTT sensor:
- platform: mqtt
name: "My CO2 Sensor"
state_topic: "topic/subtopic/co2"
unit_of_measurement: "ppm"
unique_id: "my-co2-sensor"
expire_after: 300
That creates a new “entity” and I can do that for each sensor I have.
How do I associate them all together into one device, howe…
I deleted the yaml code, then deleted the entity in hass (it was reporting as unavailable).
I then tried to create it via a script to “discover” the device, similar to comment #6:
https://community.home-assistant.io/t/mqtt-understanding-entities-vs-devices/297010/6
I tried to make four entities overall, each tied back to the same device. 3 of the 4 of them worked successfully. The first one - which should’ve recreated the manual yaml device - won’t come back.
How do I get this entity back?
mankyd
(Dave Mankoff)
April 7, 2021, 7:27pm
2
Ignore me!
The problem was that I had the device_class
parameter set to sensor
instead of what it should have been. I found the error in the logs.