Skip to content
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

[kodi] Thing status spam if device is offline #5755

Closed
5iver opened this issue Jun 21, 2019 · 2 comments · Fixed by #5793
Closed

[kodi] Thing status spam if device is offline #5755

5iver opened this issue Jun 21, 2019 · 2 comments · Fixed by #5793
Assignees
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@5iver
Copy link

5iver commented Jun 21, 2019

OH S1618. After #5715 was resolved, I'm receiving an awful lot of spam. Since a Channel has never been implemented for the system state, like was available in the 1.x version of the binding, I have a rule that triggers on Thing state updates to toggle a switch Item. This rule has worked and is still working without issue, but writes a log entry which has revealed a lot of Thing status update spam.

2019-06-20 23:31:43.582 [DEBUG] [jsr223.jython.Alert: Kodi system status update] - Kodi system update: [DS_FamilyRoom_Kodi_System]: [OFFLINE (COMMUNICATION_ERROR): Connection could not be established]
2019-06-20 23:31:43.586 [DEBUG] [jsr223.jython.Alert: Kodi system status update] - Kodi system update: [DS_FamilyRoom_Kodi_System]: [OFFLINE (COMMUNICATION_ERROR): No connection established]
2019-06-20 23:31:48.185 [DEBUG] [jsr223.jython.Alert: Kodi system status update] - Kodi system update: [US_MasterBedroom_Kodi_System]: [OFFLINE (COMMUNICATION_ERROR): Connection could not be established]
2019-06-20 23:31:48.387 [DEBUG] [jsr223.jython.Alert: Kodi system status update] - Kodi system update: [DS_MasterBedroom_Kodi_System]: [OFFLINE (COMMUNICATION_ERROR): Connection could not be established]
2019-06-20 23:31:51.254 [DEBUG] [jsr223.jython.Alert: Kodi system status update] - Kodi system update: [US_MasterBedroom_Kodi_System]: [OFFLINE (COMMUNICATION_ERROR): No connection established]
2019-06-20 23:31:51.445 [DEBUG] [jsr223.jython.Alert: Kodi system status update] - Kodi system update: [DS_MasterBedroom_Kodi_System]: [OFFLINE (COMMUNICATION_ERROR): No connection established]

I am getting two log entries every 10s (default refresh interval) for each Kodi system that is offline. This is coming from here...

https://github.com/openhab/openhab2-addons/blob/master/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/handler/KodiHandler.java#L560

and...

https://github.com/openhab/openhab2-addons/blob/master/bundles/org.openhab.binding.kodi/src/main/java/org/openhab/binding/kodi/internal/handler/KodiHandler.java#L611

An easy fix would be to change the status text for each of these to be the same, and then change the rule to 'changed'. But something changed recently and it seems like this solution would be masking an underlying issue. I haven't spent the time needed to dig into the binding code and recent changes to the binding and core to understand what has changed recently that could cause the Kodi Thing status to be getting both of these messages.

@wborn wborn added the bug An unexpected problem or unintended behavior of an add-on label Jun 23, 2019
@cweitkamp
Copy link
Contributor

The reason for the recurring messages is the solution for #5715 (#5730) itself because now the onError() method calls the onClose() method every time which calls KodiHandler.java#L611. And the error is caused by the scheduled checkConnection() in KodiHandler.java#L560. I think I can come up with a solution for this. Let me think about it a few days.

@cweitkamp
Copy link
Contributor

It does not make much sense to change something in the logic. I decided to adjust the message of the ThingStatusInfo (see #5793).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants