I flashed Tasmota to a sonoff. It is publishing temp and humidity data via mqtt:
tele/D1mini01/SENSOR = {“Time”:“2019-03-01T03:17:07”,“DHT11”:{“Temperature”:78.1,“Humidity”:20.0},“TempUnit”:“F”}
I have mosquitto workiing:
1551406139: New client connected from 192.168.1.26 as DVES_0460ED (c1, k10, u’mosquitto’)
you looked for sensor.temperature and sensor.humidity in states? Did you type in d1mini01 to see if anything is in there? Did you add the MQTT integration?
The only current entities I have listed are as follows:
group.all_switches (a sonoff switch which works in HA)
sensor.hunidity (no state listed)
sensor.temperature (no state listed)
sun.sun
I realize I misspoke. The device I am trying to get working is a Wemos D1 mini flashed with Tasmota, not a sonoff)
I don’t speak JSON, but here is how I figure out my templates. (It usually works).
Run the tele data through a JSON formatter: https://jsonformatter.curiousconcept.com/
The formatter cleans up the JSON data and makes some human sense out of it:
No that was a mistake in the templates I provided you. Look at the edit history of my post (orange pen icon top right of my post) you will see I originally had a dot in front of the square brackets.
I just copied and pasted your code into my config.yaml file. I checked it in http://www.yamllint.com/ first which changed the order of the lines. I fixed this, checked the config and restarted. Bingo!