Hi! Could anyone help me with this problem with Espurna and HA.
I have a Sonoff Th16 v2.1 and flashed it with Espurna 1.12.6 and one DS18b20 temperature sensor.
Now the problem is that sensor is showing like switch in HA states and not like sensor, i don´t really know what to change now so i could get sensor temperature in HA, mqtt broker works and i can read temperature in Espurna Web UI. Here is my configuration
In Espurna webui i have in MQTT Root Topic {Sonoff_TH} and MQTT Retain ON
and in General Hostname there is default ESPURNA_3294D5
I´m not really shore if it have to be SENSOR or Temperatur in state_topic or if tele is necessary
and then i´m unsure about value_template:
This is what it shows in HA states [switch.espurna_3294d5]
Would be very happy if someone could help me out on this
Edit
I reinstalled mosquitto and now it dosn’t show switch anymore but it shows my routers information in states like sent kbyte_sec recieved and sent, this is one of them sensor.dsl_ac68u_kbyte_sec_recieved
It’s like home assistant not reading configuration.yaml mqtt sensor. Do i have wrong code in state_topic and value
If you paste the mqtt messages that are being sent I might be able to help, but I have no experience with espurna, so I can’t tell what might happen from its configuration.
You need another client, such as mosquitto_sub or MQTT.FX, to connect to your broker and subscribe to the topic “#” - which means all messages, so the broker will send all message to your client to display
Now i tryed with that but it´s the same, i only get some routers info. I´m not really sure if i have right name in Espurna MQTT Root Topic, now i have the {Sonoff_TH}
Do you know if things like this would work better with Tasmota, if so is it possible to flash Tasmota with usb2uart or dos it have to be arduino? I tryed with Espeasy but didn’t got any states with that, maby my configuration was wrong.
I have just tried the configuration out on my test system and it works just fine when I send this message
mosquitto_pub -t "{Sonoff_TH}/temperature" -m 23
which should match what your Espurna is sending, so I don’t see why it wouldn’t work for you.
But if you are having difficulty with this, you might want to try the Tasmota discovery mode, which means you don’t have to set up anything in your yaml file. I have no idea if that would support what you need, as I don’t use it myself.
Okay thanks. But isn’t discovery mode for switches or have i understood something wrong
Edit
Seems it was only for autodiscovery on Espurna and Espeasy for switches
I got it last to work with Tasmota. I removed mosquitto and used mgtt from home-assistant Webui and then it showed up, dont know if it have to do with that i use Hassbian