#mqtt esp8266 and dht 11

1 messages · Page 1 of 1 (latest)

steep hazel
#

so i have this sensor dht11 hook up to a esp8266, everything seems to be working fine in mqtt explorer i see both humidity and temp reading. i also see this in mosquitto broker log : New client connected from 192.16xx.x.xxx:xxxxx as esp8266_lab (p2, c1, k15, u'mqtt').
but nothing is showing up on the dashboard

turbid arrow
#

Assuming you're sing mosquitto as a Home Assistant add-on, and you're publishing mqtt data from your esp8266 to that mosquitto instance, did you update configuration.yaml with the new information so home assistant has entities configured?

proud basin
#

Also you don't need to mask LAN IP addresses 😄 it's not a security risk

turbid arrow
#

Example, possibly a poor one:
mqtt:
sensor:
- name: "MyUniqueEntityName"
state_topic: "state/MyTopic"
unit_of_measurement: '°F'
value_template: "{{ value_json.MyTempValueNameFromTheEspDevice }}"
unique_id: UniqueLongHexString
device_class: temperature
- name: "MyUniqueEntityName2"
state_topic: "state/MyTopic"
unit_of_measurement: '%'
value_template: "{{ value_json.MyHumidityValueNameFromTheEspDevice }}"
unique_id: UniqueLongHexString2
device_class: humidity

sleek hill
#

Do you consider to use ESPHome? his will make life easier for you, such as uploading changes over Wi-Fi and tight HA and ESP integration. And at the same time, you can still write C++ code as a custom component if needed.

steep hazel
#

so my trail was to code the esp in arduino ide and then went for mqtt auto discovery in HA