-
Notifications
You must be signed in to change notification settings - Fork 43
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
Multiple issues since upgrade to 0.8.1 #366
Comments
I now have more information to share. It seems insteon-mqtt stopped writing to my MQTT broker (mosquitto) but it seems random... Some lights works well but some other don't. Here is a log from a light that I turn on in HA but the toggle remains off. The light turn on OK. The data never get written in MQTT :
|
Hmm:
I would try the following:
|
I am sorry, I am effectively on core 2021.3.4, this was a typo. And also, I am using the Mosquitto addons with no customization. I will try to get debug log from my broker but like I said, it was working fine before the update. Also, my broker serve for other components (rtl, tasmota, etc) and they all work like before. Like you said, I did the compare of the changes for 0.8.1 and effectively, I could not see an area that might cause the issue. However, it might be possible that the issue was present in 0.8.0 as I upgraded to this release not long ago and I did not have time to completely test my environment after. I upgraded to 0.8.1 not long after and I saw the weird behavior then. |
Sorry, the screenshots of the MQTT state made me think that this was some other broker. Why don't you try:
And see what you get. You should see all of the messages published. |
I see this note on the Mosquitto addon: Known issues and limitations Is it possible you are using an anonymous account to connect Insteon-MQTT to the broker? |
Thanks for checking this! I am using a username/password to log in to Mosquito so ot should not be an issue. I am not home right now, I will get back to you with the MQTT debug and listening data when I get back. Also, I am new to the HassIO stuff as I migrated to it only a month ago (from an old venv environment). I am still not sure how I could test your PR for the keypad linc but I will try to report on this too. |
I wrote up some instructions that might help you, depending on how comfortable you are with ssh and git: https://github.com/TD22057/insteon-mqtt/blob/master/docs/hassio_development.md |
This morning, out of nowhere, my light that was not working yesterday was now working. So I could not fetch the log... But as I know I was not crazy and something changed, I reverted to my old Insteon MQTT config with When I toggle the light ON in HA, here is the log from insteon-mqtt :
And when I listen to the |
Ok, weirdly enough, I think I solved my issues... (except the Keypad Linc, which I did not have time to try the PR). It seems that when I migrate to 0.8.1 and migrate my config.yaml to the new default one (to include the new settings like the hidden sensor, etc), I forgot to change the To be honest, I am not sure this is the resolution but my lights started to work correctly again... |
Yeah, I share your skepticism. I tested out setting my Anything is possible, but it seems a strange result to me. Is there anything else that may changed in the config file? Are there any strange characters on the topic templates or something? I am going to add another PR that enables support for debug logging from the Paho MQTT client. The logging only provides slightly more detail, it looks like the log below (it uses the prefix
|
Oh, another thing I just though of. Are you seeing anything interesting in the Insteon-MQTT logs on startup? I don't need the whole log from startup, just thinking that maybe an error is being thrown once at the start that might help us. |
Sorry, the logging to a standard file was not enabled in my config.yaml previously... Like I said, I am new to this HassOS thing and I was using the log in the web interface. It is easier to manage than my old venv but it is a lot less flexible than what I am used to... I remember seeing |
No problem. Agree, the Supervisor design is a little less free wheeling, but I think the additional security, stability, and ease of management makes up for it. I have been able to find solutions to most of my needs, it just requires doing things differently than I am used to. So, we did previously have the ability to log messages from the Paho Client, but the setting was obscure. So if there were errors, it was not being logged even if you had Debug level enabled. I have a PR #369 that moves all Paho Client messages into the log at their assigned levels. It doesn't add much additional logging so it shouldn't be a big deal, but it should now properly log warning and error messages which might provide some more clues. |
OK, I pushed out 0.8.2. Hopefully that will help you debug what is going on. |
It seems the new update fixed the issue with the keypad linc button 1 (maybe it's because it is now considered a switch, but the light bulb inside the HA dashboard does not turn on when the light is on now). However, I am still seeing the issue with MQTT, with nothing in the log... Here is a log from a 3-way switch. The first switch (bathroom_vanity_light) was turned off, it also turned off the second switch correctly (bathroom_light) physically. However, in HA, only bathroom_vanity_light was turned off. The bathroom_light was still showing as ON in HA (and in MQTT)... :
Turning off the bathroom_light in HA switched the status correctly both in HA and MQTT :
Any idea? I am running out of option on where to check for this one... |
Well that log makes it pretty clear that the problem is somewhere between the MQTT Broker and HA. We have a log of the message sent to the Broker and the Ack of it back from the broker.
So I would guess something in the HA configuration. Maybe the look in the HA forums for anything similar about MQTT? |
No, this is the issue I have. Even if we see the ACK in insteon-mqtt log, the data in my broker is not updated and still report as ON (which is why HA still report as ON as well). I am not sure HA is involved in that at all. In fact, in the last message, everything was done outside of HA. I toggled the switch physically and the data in my broker was still reporting ON. |
Could there be 2 brokers running? It's hard to believe that Insteon-MQTT gets an ACK back from the broker for a publish and the message in the broker isn't there. That's just not how the broker works. I know HA has a builtin broker and so you can end up w/ multiple brokers running. Perhaps try running |
I am sure I only have 1 broker running. I am running HassIO with the built in Mosquitto addon. My insteon-mqtt config point to the I will leave a |
OK - but IMO you shouldn't need to leave it running to get some info. As long as retain was set, the broker has all the last messages for each topic. So the first thing to check is that the message that was ACK'ed in the IM log is on the broker as the last message for that topic. If that's true, then the issue is in the broker->HA connection or how the messages in HA are being parsed. It could be something like an incorrect payload template in the HA config which means the message isn't being parsed so the state isn't updating. Or the reverse - the IM payload config could be wrong and so IM is not parsing messages (or sending what HA expects). |
Ok, but like I said previously, I think HA is out of the scope here. I can see in my broker (using MQTT Explorer) that the message is not there (the state still report ON) even after I see the ACK in insteon-mqtt that the state was set to OFF. In my insteon-mqtt log, I have this :
But in my broker, I still have this :
Having that still in my broker, this is why HA still report the light as ON. But I do not think HA is part of the issue. |
I still think the issue is somewhere between the broker and HA. That doesn't mean HA is it, it could just be the broker. I can see a few things:
You could probably discern the issue with a verbose log from the broker itself. But, the issue of whether the message was delivered from Insteon-MQTT to a broker is answered. Again the logs show us sending the message id 363 with qos=1 and retain set to true, to the topic
The payload as reported in the log is:
A broker then confirms receiving message id 363
Something is confirming receiving the message. Again, at this point, I would try to get a verbose log from your MQTT broker and see what it says. Using mosquitto_sub is likely not telling us the full story. |
I hope using mosquitto_sub will show me a history of what my broker received (and confirm if something is overwriting). I need to find how to enable verbose log in the Mosquitto addon, I searched but did not found anything. This is the area I find HassIO more difficult to work with. |
changing the supervisor logging levels to debug and then restarting the MQTT broker should do it. |
Also, I see this rather lengthy issue suggesting the broker may have an issue: |
I looked at the code for the mosquitto broker addon. Sadly, it doesn't look like it is configured to allow for |
Just an update, I do still have issue on my end and, like you mentioned before, it might come from my MQTT addons issue... I will try to downgrade to the previous version and see if the issue persist. |
I did not have much success to find where this issue really come from. I did not touch anything except to update to latest HA and InsteonMQTT version (the MQTT addon did not push an update still). It seems the issue happen a lot less than before. In any case, it seems it is now clear the issue does not come from InsteonMQTT so I will go ahead and close this issue. Thanks a lot for your help in debugging this issue! |
I will add more details tomorrow as I am not in front of my laptop right now but since updating to 0.8.1 from 0.8.0, my environment now has multiple issues... I wanted to raise this rapidly to warn of a possible issue.
First, I needed to set
qos = 1
in my config (instead of 2 like I use since a couple of years). Without this, insteon-mqtt did not send anything to Mosquito.Now I see that all my 3-way automation do not work anymore. The data never get to MQTT. The physical 3-way works but it is never reflected like before in HA.
The text was updated successfully, but these errors were encountered: