MQTT and BHT1750
Moderators: grovkillen, Stuntteam, TD-er
MQTT and BHT1750
I´v setup my 8266 with a SI7021/HTU21D and a BH1750 Sensor. On EasyESP everything works well (Device Dashboards shows both sensors and values). But for my IOBroker MQTT there seems to be a problem. I´ll get only the values from the SI7071 Sensor.
Could anybody help me to troubleshoot EasyESP and MQTT?
------
Build:⋄
20112 - Mega
System Libraries:⋄
ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(38a443e), LWIP: 2.1.2 PUYA support
Git Build:⋄
Plugin Count:⋄
47 [Normal]
Build Time:⋄
Feb 23 2021 12:29:15
Binary Filename:⋄
ESP_Easy_mega_20210223_normal_ESP8266_4M1M
Build Platform:⋄
Linux-5.4.0-54-generic-x86_64-with-glibc2.29
Git HEAD:⋄
mega-20210223_9054eb3
Could anybody help me to troubleshoot EasyESP and MQTT?
------
Build:⋄
20112 - Mega
System Libraries:⋄
ESP82xx Core 2843a5ac, NONOS SDK 2.2.2-dev(38a443e), LWIP: 2.1.2 PUYA support
Git Build:⋄
Plugin Count:⋄
47 [Normal]
Build Time:⋄
Feb 23 2021 12:29:15
Binary Filename:⋄
ESP_Easy_mega_20210223_normal_ESP8266_4M1M
Build Platform:⋄
Linux-5.4.0-54-generic-x86_64-with-glibc2.29
Git HEAD:⋄
mega-20210223_9054eb3
Re: MQTT and BHT1750
A few questions:
- Have you checked the correct controller checkbox on the BHT1750 Device configuration page?
- How is your controller configured?
- Have you checked the correct controller checkbox on the BHT1750 Device configuration page?
- How is your controller configured?
/Ton (PayPal.me)
Re: MQTT and BHT1750
Hi Ath,
thx for your questions.
The controller config should be fine, because the SI7021/HTU21D information from the same device is shown on the mqtt Server.
Find the settings attached. I don´t know if there is a missconfiguration.
thx for your questions.
The controller config should be fine, because the SI7021/HTU21D information from the same device is shown on the mqtt Server.
Find the settings attached. I don´t know if there is a missconfiguration.
Re: MQTT and BHT1750
Did you leave the Controller topics untouched, or are they changed? they should best (at least) include %tskname% and %valname% to send with names as defined at the sensors.
Does IOBroker have any logging available, so you can debug the messages sent from your ESP? (Don't know squat about IOBroker )
Does IOBroker have any logging available, so you can debug the messages sent from your ESP? (Don't know squat about IOBroker )
/Ton (PayPal.me)
Re: MQTT and BHT1750
Find attached the config for the mqtt. This works for the SHT Sensor. I´ve deleted the BHT Sensor and added it again. Still no connect to iobroker/mqtt Server
- Attachments
-
- mqtt.PNG (20.32 KiB) Viewed 14924 times
Last edited by CENG on 12 Mar 2021, 16:32, edited 1 time in total.
Re: MQTT and BHT1750
This looks OK to me, except for 1 remark:
- You haven't configured your Unit number. It is strongly advised to give that a value between 1 and 254, and unique per ESP unit. This setting is on the Config tab. (You should un-check the 'Append Unit Number to hostname' checkbox)
NB: I don't think this is of influence to the MQTT behavior, unless you have another ESP with the same name and unit number (0).
NB2: Sending data to a controller is a global ESPEasy feature, and not implicitly implemented in a plugin, so that's why I think it should have worked already. I'm really surprised it still doesn't.
- You haven't configured your Unit number. It is strongly advised to give that a value between 1 and 254, and unique per ESP unit. This setting is on the Config tab. (You should un-check the 'Append Unit Number to hostname' checkbox)
NB: I don't think this is of influence to the MQTT behavior, unless you have another ESP with the same name and unit number (0).
NB2: Sending data to a controller is a global ESPEasy feature, and not implicitly implemented in a plugin, so that's why I think it should have worked already. I'm really surprised it still doesn't.
/Ton (PayPal.me)
Re: MQTT and BHT1750
In the screenshot I do see the IDX field of one controller is set to "1".
For example Domoticz uses the IDX field and you have to have that value unique for each sensor you plan on using in Domoticz.
Can you also show the controller queue settings?
If you're posting always to the same topic, the value gets overwritten.
You can also add %tskname% to the publish topic if that may be helpful for your application?
For example Domoticz uses the IDX field and you have to have that value unique for each sensor you plan on using in Domoticz.
Can you also show the controller queue settings?
If you're posting always to the same topic, the value gets overwritten.
You can also add %tskname% to the publish topic if that may be helpful for your application?
Re: MQTT and BHT1750
I´ve enabled the unit number... Same..
Some Log from IOBroker:
sonoff.0 2021-03-12 17:36:55.975 info (1178) new object created: sonoff.0.NodeMCU_12345134_1_1.alive
sonoff.0 2021-03-12 17:36:55.954 info (1178) new object created: sonoff.0.NodeMCU_12345134_1_1
sonoff.0 2021-03-12 17:36:55.948 warn (1178) State "sonoff.0.NodeMCU_12345134_1_1.alive" has no existing object, this might lead to an error in future versions
But my NodeMCU would not send the BHT Information.
Where could I find the MQTT Queue on my nodemcu?
Some Log from IOBroker:
sonoff.0 2021-03-12 17:36:55.975 info (1178) new object created: sonoff.0.NodeMCU_12345134_1_1.alive
sonoff.0 2021-03-12 17:36:55.954 info (1178) new object created: sonoff.0.NodeMCU_12345134_1_1
sonoff.0 2021-03-12 17:36:55.948 warn (1178) State "sonoff.0.NodeMCU_12345134_1_1.alive" has no existing object, this might lead to an error in future versions
But my NodeMCU would not send the BHT Information.
Where could I find the MQTT Queue on my nodemcu?
Re: MQTT and BHT1750
It is part of the controller settings.
See also its documentation: https://espeasy.readthedocs.io/en/lates ... parameters
See also its documentation: https://espeasy.readthedocs.io/en/lates ... parameters
Re: MQTT and BHT1750
Find attached the settings
PS: I do not understand, why the SHT Sensors sends like it should, but the bht sensor not.
PS: I do not understand, why the SHT Sensors sends like it should, but the bht sensor not.
- Attachments
-
- mqtt.PNG (20.7 KiB) Viewed 14911 times
Re: MQTT and BHT1750
I have tried another MCU and another BHT Sensor.
Same Problem...
Has anybody a BHT1750 and MQTT working?
Same Problem...
Has anybody a BHT1750 and MQTT working?
Re: MQTT and BHT1750
I'm quite sure there is some configuration mishap, not a sensor or ESP error.
Can you see any MQTT messages for this device when viewing the MQTT subscription '#' ? That should show all traffic to and from your MQTT enabled devices (and server(s)).
What controllers are configured on your ESP? (Names should be enough)
Can you see any MQTT messages for this device when viewing the MQTT subscription '#' ? That should show all traffic to and from your MQTT enabled devices (and server(s)).
What controllers are configured on your ESP? (Names should be enough)
/Ton (PayPal.me)
Re: MQTT and BHT1750
Only the BH1750 Sensor is connected.
IOBroker Log:
2021-03-13 10:02:44.927 - warn: sonoff.0 (1178) State "sonoff.0.NodeMCU_15568697_1_1.alive" has no existing object, this might lead to an error in future versions
2021-03-13 10:02:44.928 - info: sonoff.0 (1178) new object created: sonoff.0.NodeMCU_15568697_1_1
2021-03-13 10:02:44.945 - info: sonoff.0 (1178) new object created: sonoff.0.NodeMCU_15568697_1_1.alive
2021-03-13 12:40:55.090 - info: sonoff.0 (1178) Client [NodeMCU_15568697_1_1] reconnected. Old secret 1615626164895_6938. New secret 1615635655088_112
2021-03-13 12:41:05.149 - info: sonoff.0 (1178) Client [NodeMCU_15568697_1_1] reconnected. Old secret 1615635655088_112. New secret 1615635665147_2045
2021-03-13 14:34:18.322 - info: sonoff.0 (1178) Client [NodeMCU_15568697_1_1] reconnected. Old secret 1615635665147_2045. New secret 1615642458320_4787
IOBroker Log:
2021-03-13 10:02:44.927 - warn: sonoff.0 (1178) State "sonoff.0.NodeMCU_15568697_1_1.alive" has no existing object, this might lead to an error in future versions
2021-03-13 10:02:44.928 - info: sonoff.0 (1178) new object created: sonoff.0.NodeMCU_15568697_1_1
2021-03-13 10:02:44.945 - info: sonoff.0 (1178) new object created: sonoff.0.NodeMCU_15568697_1_1.alive
2021-03-13 12:40:55.090 - info: sonoff.0 (1178) Client [NodeMCU_15568697_1_1] reconnected. Old secret 1615626164895_6938. New secret 1615635655088_112
2021-03-13 12:41:05.149 - info: sonoff.0 (1178) Client [NodeMCU_15568697_1_1] reconnected. Old secret 1615635655088_112. New secret 1615635665147_2045
2021-03-13 14:34:18.322 - info: sonoff.0 (1178) Client [NodeMCU_15568697_1_1] reconnected. Old secret 1615635665147_2045. New secret 1615642458320_4787
Re: MQTT and BHT1750
I've just set up an ESP8266 with a BH1750 Lux sensor, (that took the most time, finding that sensor in the pile of sensors ), configured the Domoticz MQTT controller, created a new dummy device (Lux) in Domoticz, configured the ESP with the BH1750, enabled the device for the controller with the correct IDX (with interval 2 sec.), and as long as I keep the sensor in the light it immediately shows the reading in Domoticz. So all I can say is: it works.
/Ton (PayPal.me)
Re: MQTT and BHT1750
Only one controller: Home Assistant (openHAB) MQTT
I´ve tried also the "Demoticz" Controller -> also nothing on my iobroker
BTW: THX very much for your support
I´ve tried also the "Demoticz" Controller -> also nothing on my iobroker
BTW: THX very much for your support
Re: MQTT and BHT1750
Please be aware you can only have one enabled MQTT controller.
So if you need some platform that needs MQTT using a message format that differs from what Domoticz expects then you should use Domoticz HTTP controller.
So if you need some platform that needs MQTT using a message format that differs from what Domoticz expects then you should use Domoticz HTTP controller.
Re: MQTT and BHT1750
The OpenHab MQTT controller is probably the most generic/universal MQTT controller available in ESPEasy, and as it is sending other sensors fine, you may need to check your setup, please remind that MQTT topics are case-sensitive, so maybe your filtering is using the wrong name? The sensor is named 'LightSensor', and the value 'Lux', so you may need to filter on '#/LightSensor/Lux' (without the quotes, of course).
/Ton (PayPal.me)
Re: MQTT and BHT1750
And also keep in mind a topic with leading slash actually means the first topic level is "".
For example "/mytopic" is actually different from "mytopic"
So when subscribing to "/#" you get different results compared to "#".
For example "/mytopic" is actually different from "mytopic"
So when subscribing to "/#" you get different results compared to "#".
Re: MQTT and BHT1750
Could anybody send me an example config?
To remind, for the SHT my config has worked. But for the bh1750 not. How could that be?
To remind, for the SHT my config has worked. But for the bh1750 not. How could that be?
Re: MQTT and BHT1750
That's really strange indeed, so it makes me think you're maybe looking at the MQTT broker topics in the wrong way?
Can you use some MQTT client tool like MQTT explorer (Windows store) or MQTT.fx to subscribe to "#" as topic to see what is all being processed at the broker?
Maybe that will give some more insights to what is happening?
Can you use some MQTT client tool like MQTT explorer (Windows store) or MQTT.fx to subscribe to "#" as topic to see what is all being processed at the broker?
Maybe that will give some more insights to what is happening?
Re: MQTT and BHT1750
Hi Guys,
I´ve given up.
Now I use the open HAB MQTT Controller on EasyESP and the "MQTT Broker Adapter" instead of "Sonoff MQTT Adapter" in IoBroker. Now it works.
Think there´s is a bug in the "iobroker sonoff adapter".
Thank your very much for your support.
I´ve given up.
Now I use the open HAB MQTT Controller on EasyESP and the "MQTT Broker Adapter" instead of "Sonoff MQTT Adapter" in IoBroker. Now it works.
Think there´s is a bug in the "iobroker sonoff adapter".
Thank your very much for your support.
Re: MQTT and BHT1750
What may be happening here is that the Sonoff MQTT Adapter plugin for ioBroker *only* supports switches, relays and the HTU21D/BMx280 sensors, as that is what is supported to be connected to Sonoff devices. That would sound somewhat logical to me, for being the cause. But I fail to understand why one would limit MQTT message types in a specific adapter, if other adapters will support the full set of sensors. Feels a bit silly to me.
Glad you got it sorted
/Ton (PayPal.me)
Who is online
Users browsing this forum: No registered users and 76 guests