-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Domoticz Controller sends non JSON Format #869
Comments
Does this also apply to other MQTT controllers, like OpenHAB? So should we add a check mark to force json on all messages? |
I looked into the Messages with different Controllers with:
Tested with OpenHAB Controller (First Line) and Domoticz Controller (Second Line):
For example Sonoff-Tasmota sends a different MQTT message for this "Debug" message (Online, Offline instead of Connected, Connection Lost):
Maybe this could be a possible solution but a checkbox to force JSON output messages could solve the problem as well (i hope :D). |
Just to make sure I get it... Does Tasmota send to a different topic? Or is it just that they send another word? |
Is it possible the Offline message of Tasmota is not a regular message, but a "Last Will and Testament" message sent by the broker? |
I'm sorry, I'm not sure, but I think it's a "Last Will Testament", because that's what it's called "tele/Thermostat/LWT". I do not know exactly yet with MQTT and I'm still learning about things, etc., but noticed the problem with the non JSON format and wanted to know if there might be a solution for it. Sorry, please keep me up to date if there is any news on this topic. |
I was just reading about MQTT (all a bit new to me too) and saw this on the TASMOTA wiki.
And given that the "LWT" part is still part of the topic (separated with a '/' thus still part of the topic), to what topic(s) are you subscribed? Currently we don't have support for LWT, but that's probably not too hard to implement. |
Yes the Controller Status by example Topic: devicename/controller/LWT |
Well I don't know a lot about MQTT, also just learning. It appeared asking google for "MQTT essentials" is quite a good keyword ;) |
But you will still look for the problem? I would be glad! |
I still working on it ;) There will be a pull request within the hour I guess and not sure when @psy0rz will start merging, but I guess he will do that tomorrow evening so it will be in the next build (Saturday morning) I guess. |
Okay Nice thank you for your quick help. Thats super cool! :) |
… CPU load See letscontrolit#869 for discussion on Last Will Topic. Also changed the way it tried to reconnect to make it return a lot faster when connection is not (yet) possible and call the PubSubClient::loop() at a much slower pace to reduce CPU usage. (See letscontrolit#847) This higher CPU load was probably introduced when fixing letscontrolit#683.
You can test it if you like. |
Thank you for your help. I will try it tomorrow :) |
* [issue #869] Added 'LWT' to last will topic and improved CPU load See #869 for discussion on Last Will Topic. Also changed the way it tried to reconnect to make it return a lot faster when connection is not (yet) possible and call the PubSubClient::loop() at a much slower pace to reduce CPU usage. (See #847) This higher CPU load was probably introduced when fixing #683. * [MQTT] Fix error reporting success status with longer payloads Applied PR https://github.com/knolleary/pubsubclient/pull/360/files * made MQTT_CALLBACK_SIGNATURE for esp32 functional Applied PR knolleary/pubsubclient#336
Closing the issue, so I can conclude the fix works as expected? |
Oh yes sorry, my fault. It works perfectly! |
@jannnfe hi,How does mq9 intervene in espeasy, what do you choose in Devices? |
@1043717432 Hello, i use it with the Analog Input Device. Check out Google or take a look at this post: http://www.letscontrolit.com/forum/viewtopic.php?t=681 |
Steps to reproduce
If I activate the controller Domoticz MQTT and want to send my temperature and humidity from the DHT22 sensor or PPM from the MQ-9 sensor to Domoticz, a "Connected" or "Connection Lost" in "domoticz/out" will be sent in non JSON format. This causes problems with the use of the Homebridge plugin eDomoticz because it does not work as long as the MQTT topic does not contain all messages in the JSON format. This message is sent every time the controller connects or breaks the connection. I do not know if that is the case with other plugins, but I noticed with these two plugins:
Environment - DHT11/12/22 and Analog input - internal
Please have a look at this Issue from eDomoticz.
Expected behavior
There should be no status message when connecting or disconnecting in non JSON format in the "domoticz/out" topic.
Actual behavior
The controller sends a "Connected" or "Connection Lost" to the "domoticz/out" topic in non JSON format, which causes an error with the use of the Homebridge plugin eDomoticz.
System configuration
Hardware:
ESP8266 Wemos D1 Mini
DHT22
MQ-9 Gas Sensor
Software or git version:
mega-20180114
P005 & P025
Domoticz MQTT Controller
The text was updated successfully, but these errors were encountered: