So I have a Sonoff TH flashed with tasmota. I have the switch portion working just fine with HA. I’m using the AM2301 temp/humidity sensor plugged into the sonoff. From the console page of the sonoff I can see the data is being measured (HA even recorded some temp and humidity last night for about an hour). Now when I look at the entity on Hass.io it just says “unknown” for both of their readings. I’m not sure if this is an MQTT issue or a yaml issue? I’m using cloudmqtt right now. I’ve tried restarting the instance and no change. Here is the snippet of my code as well. I am aware that I don’t have value_json.AM2301.temperature in that portion. I was trying it each way to see if I could get it to work.
Well that made the values blank now. I’m wondering if its an issue with MQTT but I’m not sure how to figure that out and everything else with MQTT seems to be working.
The topic is correct I have verified that. I’ve adjusted some of the quotation marks to match what other people show, but I’m not sure as that makes a difference.
If I just put “{{ value_json }}” I get the full MQTT message: {‘Time’: ‘2017-12-08T19:23:12’, ‘AM2301’: {‘Temperature’: 23.7, ‘Humidity’: 34.9}, ‘TempUnit’: ‘C’} %
I can not get temperature to my HomeAssistant.
But I clearly see my Th16 as switch with
-platform: mqtt
name: “th239”
state_topic: “stat/th239/POWER”
command_topic: “cmnd/th239/POWER”
availability_topic: “tele/th239/LWT”
qos: 1
payload_on: “ON”
payload_off: “OFF”
payload_available: “Online”
payload_not_available: “Offline”
retain: false
On the other hand I have also wemosD1mini with tasmota and DS18B20 sensor and it works with configuration:
- platform: mqtt
state_topic: ‘tele/wemos3_221/SENSOR’
name: ‘Temperature’
unit_of_measurement: ‘°C’
value_template: ‘{{ value_json[“DS18B20”][“Temperature”] }}’