Hi,
I regularly have the problem that my raspberry pi 4 is no longer connected to the cloud. This week I have had it twice. It was offline from 7to 7h(12h) I think there is a reconnect somewhere every 12h?
I get status code 500ter back in my app. All notifications are still working though.
I noticed that the problem is solved after unplugging and directly deer plugging in the network cable.
Can anyone help me?
Hi,
I am sorry that I cannot help you but just to add on to this: I have had more than ten ups/downs the last two days - I have a rule that activates when the connector goes down so I know from the emails coming in. Before that rule it went down and up many times but I just didnât notice. But sometimes it stays down as it has the last couple of days and then you of course notice more.
I have the impression that it is supposed to connect automatically again but sometimes it doesnât and that is when you notice.
Note: I do NOT know if this is a local problem, internet connection problem or something else. I have never really found out what this is depending on. Many times it just fixes itself after a number of days.
I also have from time to time the issue that openhab disconnects from cloud âhttps://myopenhab.org/â and does not reconnect by itself. I have to restart openhab to have it working again.
Iâm currently running OH 3.3 in Docker.
Any hints how to solve this? Or is there at least a way to automaticly discover the disconnect and restart a service or OH itself?
The strange thing is that in the openhab.log the last state is actually that it did reconnect.
2022-10-09 10:03:57.975 [INFO ] [io.openhabcloud.internal.CloudClient] - Disconnected from the openHAB Cloud service (UUID = 5d5ef6dd-3454-4c29-95aa-6cf49XXXXXXX, base URL = http://localhost:4050)
2022-10-09 10:04:58.902 [INFO ] [io.openhabcloud.internal.CloudClient] - Connected to the openHAB Cloud service (UUID = 5d5ef6dd-3454-4c29-95aa-6cf49XXXXXXX, base URL = http://localhost:4050)
From cloud side it reports âYour openHAB is not onlineâ
I get this quite often during the day, Itâs never been an issue for me as itâs reconnected before Iâve noticed it and I donât have anything mission critical hanging off it.
Iâve just assumed this is âthe way it worksâ as itâs a free service etc so not an AWS â99.9999999% uptime guaranteedâ.
Watching thread with interest.
Hi,
I donât know if this will help you but I found something like this and rewrote it. It works more or less for me, at least I know when there is a problem. It was a long time ago I did it so I donât really remember exactly what I did but here you have the code and the things connected to it. Maybe it will help you a bit. Not a professional coder in any way so keep that in mind. Room for improvements I am sure.
rule "Check Cloud Connector status"
when
//Channel "MyLogReader:reader:openhabcloud:newCustomEvent" triggered
Item CloudConnectorStatus changed
then
if (CloudConnectorStatus.toString.contains("Disconnected from")) {
postUpdate(OpenHABConnectorStatusIndicator, OFF)
mailActions.sendMail([my email address], "Cloud Connector DOWN", "OpenHAB Cloud Connector just went DOWN.")
logError("Cloud Connector", "Cloud Connector possibly offline")
//Restart the Cloud Connector
if(lastReset === null || lastReset.isBefore(now.minusSeconds(30)) ){
lastReset = now
RestartCloudConnector.sendCommand(ON)
mailActions.sendMail([my email address], "Restarting Cloud Connector", "OpenHAB Cloud Connector just went DOWN and has now been Restarted with a rule.")
}
}
if (CloudConnectorStatus.toString.contains("Connected to")) {
postUpdate(OpenHABConnectorStatusIndicator, ON)
mailActions.sendMail([my email address], "Cloud Connector UP", "OpenHAB Cloud Connector just went UP again.")
logError("Cloud Connector", "Cloud Connector online again")
}
end
The number 294 is the list of the bundle, use bundle:list -s to get the number for the cloud connector
Hi,
cool code! I donât quite get this. The one trigger is in comments. Should another item be created? And what should it be linked to? To what is âCloudConnectorStatusâ linked?
En lastRest is so?
Hi,
I have added one more screenshot in the reply above, that should make it more clear. The channel on the LogReader is connected to the CloudConnectorStatus and whenever LogReader change (with the selected parameters for the cloud service) it is firing the event. The comment is just to understand (for myself) what channel it is that triggers the event.
I donât understand your sentence âEn lastRest is so?â but lastReset is just a time to compare with so this event does not trigger too often.
I hope it is clearer now.
Hi
Thanks for you replay! I will try this out tommorow! Was wondering how you assigned your LastReset at the top. Just var lastReset == null?
En where comes theOpenHABConnectorStatusIndicator variabele from?
Have a nice day!
Looks like the exec binding is used somewhere. Commands that are executed using that binding need to be white listed in /etc/openhab/misc/exec.whitelist
Please do not post screenshots, paste and copy the text using code fences.
That WARN tells: You try to use the REGEX transformation although it is not installed!
Hi,
I donât think itâs working. I ran the stop command once and see that the process 302 keeps running.
302 â Active â 80 â 3.3.0 â org.openhab.io.openhabcloud