mqtt mega-20190106 to homeassistent fails [solved]

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Tobbes
New user
Posts: 7
Joined: 10 Jan 2019, 07:43

mqtt mega-20190106 to homeassistent fails [solved]

#1 Post by Tobbes » 26 Sep 2022, 09:01

Hello,

I have a problem with a SONOFF S20 plug running ESPeasy (mega-20190106).
There is a DHT 22 added to the plug to measure the temperature and humidity in the room.
In the past I used this device with ioBroker and the mqtt link worked good.
Now I switched to homeassistent with its mosquitto-core broker.
I changed the IP adresss and set the user and password. I cannot get the values on homeassistant - there are no errors in the esp log.
The mosquitto-broker connection works with tasmota - so user and password are okay.
If I changed back the IP to ioBroker the messages over mqtt from the espeasy device are also okay.

Is there a generally problem with this (old) ESPeasy firmware and homeassistant? Must I fill in something in the LWT fields of mqtt?

Thank you for a hint.

tobbes
Last edited by Tobbes on 27 Sep 2022, 08:10, edited 1 time in total.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: mqtt mega-20190106 to homeassistent fails

#2 Post by TD-er » 26 Sep 2022, 09:16

You mentioned "Changed IP address"... Just to be sure, you are addressing it by IP and not hostname?
In older builds, the DNS hostname was resolved to an IP and that was stored and actually used by ESPEasy. Thus saving it again would then update the IP in the background.

Another hint I can give you is to use a tool like MQTT explorer (Windows Store, there are similar tools on other platforms)
This allows you to connect to the same broker and see what's being sent to which topic.

Also make sure you have the MQTT topics at the correct "depth". Like a leading slash may add an extra level to the topics, which is easily overlooked.

How long are your password and username? Do they contain "special" characters?

Tobbes
New user
Posts: 7
Joined: 10 Jan 2019, 07:43

Re: mqtt mega-20190106 to homeassistent fails

#3 Post by Tobbes » 26 Sep 2022, 10:27

TD-er wrote: 26 Sep 2022, 09:16 You mentioned "Changed IP address"... Just to be sure, you are addressing it by IP and not hostname?
In older builds, the DNS hostname was resolved to an IP and that was stored and actually used by ESPEasy. Thus saving it again would then update the IP in the background.

Another hint I can give you is to use a tool like MQTT explorer (Windows Store, there are similar tools on other platforms)
This allows you to connect to the same broker and see what's being sent to which topic.

Also make sure you have the MQTT topics at the correct "depth". Like a leading slash may add an extra level to the topics, which is easily overlooked.

How long are your password and username? Do they contain "special" characters?
Thanks for your answer.
I tried to take the hostname without luck. No values received in homeassistant.
I took the topics as used in ioBroker and thought it will be okay.
The the username contains a "_" and the password are only letters and numbers.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: mqtt mega-20190106 to homeassistent fails

#4 Post by TD-er » 26 Sep 2022, 10:31

Can you check with some MQTT tool like MQTT Explorer to see if ESPEasy actually tries to connect and send something?

Tobbes
New user
Posts: 7
Joined: 10 Jan 2019, 07:43

Re: mqtt mega-20190106 to homeassistent fails

#5 Post by Tobbes » 27 Sep 2022, 08:08

TD-er wrote: 26 Sep 2022, 10:31 Can you check with some MQTT tool like MQTT Explorer to see if ESPEasy actually tries to connect and send something?
Many Thanks to you!
The topic of the plug is slightly different. I do not know why, but with MQTT explorer I could find out the right topic.
Now the values of temperature and humidity are visible in homeassistant.

Thanks to all

tobbes

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 24 guests