vergo
August 25, 2018, 3:37pm
1
Hi, need some help:
I´ve changed from hasbian to hass.io . I´ve set up a Mosquito broker addon. My sonoff switches work well but my NodeNCUs with the DHT22 don´t.
In hass.io I´ve used the same code in the configauration.yaml as in the old hassbian.
mqtt:
broker: localhost
port: 1883
client_id: home-assistant-1
username: pi
password: raspberry
sensor:
- platform: mqtt
name: "Keller"
state_topic: "keller/sensor/humidity"
unit_of_measurement: "%"
switch:
- platform: mqtt
name: "Licht Schiffsamaturen"
command_topic: "cmnd/sonoff1/power"
state_topic: "stat/sonoff1/POWER"
qos: 1
payload_on: "ON"
payload_off: "OFF"
retain: true
I´ve changed nothing on the NodeMCU and the hass.io has the same IP Adress as the old hassbian.
Does anyone have an idea what´s the probelm?
Thanks
Ingo
Do you see something in the mosquitto logs?
I would setup a mosquitto client and look if the ModeMCU publishes to the topic.
If not the MCU is the problem.
vergo
August 25, 2018, 4:29pm
3
I have this in the log:
1535214078: New client connected from 192.168.2.130 as ESPClient0 (c1, k15, u’pi’).
1535214086: New connection from 192.168.2.136 on port 1883.
1535214086: Client ESPClient0 already connected, closing old connection.
1535214086: Client ESPClient0 disconnected.
I think it´s OK because the broker receive new data.
Are there multiple MCU’s?
There are two different IP’s.
vergo
August 25, 2018, 4:36pm
5
I have five of them. Just for testing I have just one in the cinfiguration.yaml.
Looks like they have the same MQTT Client ID?
Should be different on every Client.
vergo
August 25, 2018, 4:38pm
7
Können wir nicht auch deutsch sprechen, oder besser englisch, damit alle mitlesen können?
Ich bin so oft hier, ich denke schon in Englisch, also weiter damit alle mitlesen können.
vergo
August 25, 2018, 4:42pm
9
How can I solve the problem with the ID? My setup of NodeMCU´s and DHT22 sensors worked fine on hassbian?
Which sketch runs on the MCU’s?
vergo
August 25, 2018, 4:53pm
11
I´ve flashed the NodeMCU´s withe ESP easy. Do you need some screenshots?
Have one with Easy.
Under Config -> Unit Number maybe?
Try it different on every MCU.
EDIT: The topics will change then so you need to look with a mqtt client.
Did you use the embedded MQTT Broker in hassbian or mosquitto too?
vergo
August 25, 2018, 5:06pm
14
Sorry, have to go now. Thank you for your help so far. I´m back tomorrow morning.
There’s an issue with espeasy and ClientID’s.
opened 06:56AM - 23 Mar 18 UTC
closed 09:12PM - 12 Aug 21 UTC
Type: Enhancement
Category: Controller
### Steps to reproduce
**How can we trigger this problem?**
Visible every time… ESP connects to the MQTT broker (in MQTT broker logs)
**Does the problem persists after powering off and on? (just resetting isn't enough sometimes)**
Yes
### Expected behavior
Client ID of MQTT client for controller should use %sysname% as in case of MQTT client for Generic MQTT import device (or there should be possibility to define it manually - at least set some prefix).
### Actual behavior
It seems that the ESP uses separate MQTT clients - one for the controller (like Open HAB) and one for Generic MQTT Import device. As far as the client ID of the Import device is set to the "%sysname%-Import", client ID for controller is set to hardcoded "ESPClient_xxxxx" with no control over it (apart customized build).
Such behavior causes that simple MQTT broker security mechanism of accepting only the clients with predefined prefix (clientid_prefixes option in case of Mosquitto broker on RPi) fails - for %sysname% containing desired prefix, ESP receives MQTT data via Generic MQTT Import device correctly, but is not able to respond using configured controller (thus also via Publish function in rules) as it does not have required prefix in the client ID ("ESPClient_xxxxx").
### System configuration
Hardware:
ESP-01 (1024k)
Software or git version:
ESPEasy_v2.0-20180220
I’m not sure if this is your problem as it worked in hassbian, but i’m 100% sure that MQTT ClientID’s should be different.
Maybe the ESPEasy forum can help.
And here’s something to read. Good luck!
Hello everyone. I am very new to HA and MQTT but I have done a lot of searching for answers. I have successfully setup HA on Rpi and ESPEASY on a NodeMCU with a BME280 sensor attached to it. I can’t find anywhere how I could get the values from ESPEASY to HA. I have come across many threads where someone is using OpenHAB on ESPEasy side and something else in HA’s side for MQTT broker, I am very confused. Here are some info that might be useful
*ESPEASY- In devices, the BME280 is named BME280, t…
vergo
September 8, 2018, 4:35am
17
Hello again,
I solved the problem in an different way. I´ve replaced all my NodeMCU´s with Sonoff´s an connect a DHT22 on gpio14 and everything worked fine.
I have no idea why the NodeMCU´s didn´t work.
1 Like
jakin
(Jakin)
July 17, 2020, 2:15am
18
Please show some photos with your solution!? Tks