Closed PottiMc closed 1 year ago
@PottiMc even after a re-enabling of the thing, you might still get an error. So I updated my rule to simply check every 5 minutes;
rule "Restart Grohe ondus when valve offline" when Time cron "0 0/5 * 1/1 * ? *" then var thingStatusInfo = getThingStatusInfo("groheondus:account:account") if ((thingStatusInfo !== null) && (thingStatusInfo.getStatus().toString() == "OFFLINE")) { logInfo("FILE", "Grohe offline") sendHttpPutRequest("http://USER:PWD@127.0.0.1:8080/rest/things/groheondus%3Aaccount%3Aaccount/enable","text/plain",'false',5000) createTimer(now.plusMinutes(1), [| sendHttpPutRequest("http://USER:PWD@127.0.0.1:8080/rest/things/groheondus%3Aaccount%3Aaccount/enable","text/plain",'true',5000) logInfo("FILE", "Grohe re-enabled") ] ) } end
Hey seime,
first of all, I also want to thank you for your great job and your support. I tried your rule, but for me it does not really seems to work. After a few days the connection lost again. i could reconnect it by update the token again.
Chris
Hi @CyberChris79
please double check you changed all the variables correctly and adjusted them to your binding.
Look at the Username, Password, IP, port, thing name, account name, etc. Make sure you don't have an @ in your password, it could lead to potential problems.
These are very simple commands every openhab installation is capable of when used correctly.
If you can't find the failure please send me the details above, I can rewrite the rule for you. Never post your username and password!
Hello @PottiMc,
thank you very much. I thought the error came from the rule configuration and i reinstalled the binding inclusive the things and item. But it still got some error. My OpenHAB Log show me this error
[ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.groheondus.internal.handler.GroheOndusSenseGuardHandler@b35a48': null
This is my rule `configuration: {} triggers:
inputs: {} id: "2" configuration: type: application/vnd.openhab.dsl.rule script: >- var thingStatusInfo = getThingStatusInfo("groheondus:account:xxxxxxxxxx")
if ((thingStatusInfo !== null) && (thingStatusInfo.getStatus().toString() == "OFFLINE")) {
logInfo("FILE", "Grohe offline")
sendHttpPutRequest("http://username:password@127.0.0.1:8080/rest/things/groheondus:account:xxxxxxxxxx/enable","text/plain",'false',5000)
createTimer(now.plusMinutes(1), [|
sendHttpPutRequest("http://username:password@127.0.0.1:8080/rest/things/groheondus:account:xxxxxxxxxx/enable","text/plain",'true',5000)
logInfo("FILE", "Grohe re-enabled")
] )
}
type: script.ScriptAction `
Thank you in advanced CyberChris
First of all, thanks @seime and @PottiMc for working on this issue. I have as well experienced all the same issues with the Grohe binding as you mention in this thread, but after your input, my setup is now working acceptably. I use version 3, very much (based on @PottiMc comment that this was the most stable one) the contribution i can make to support others have similar issues is that I’ve slightly updated the ”reset-rule” as my issue was that when the connection to the Grohe service broke, I needed to first disable/reenable the Grohe account thing, then followed by disabling/enabling the Grohe sense guard thing to get it working again.
rule "Restart Grohe ondus when valve offline"
when
Time cron "0 0/5 * 1/1 * ? *"
then
var thingStatusInfo2 = getThingStatusInfo("groheondus:senseguard:5cc6aaa3bc:199ff93d-4419-41ad-b83f-f32b0c0b0b5f")
//logInfo("myLog","Grohe Account, Status: " + thingStatusInfo.getStatus().toString() )
//logInfo("myLog","Grohe Sense Guard, Status: " + thingStatusInfo2.getStatus().toString() )
if ((thingStatusInfo2 !== null) && ((thingStatusInfo2.getStatus().toString() == "OFFLINE") || (thingStatusInfo2.getStatus().toString() == "UNINITIALIZED"))) {
logInfo("myLog", "Grohe Sense Guard is OFFLINE, disabling Grohe Account..")
sendHttpPutRequest("http://<your account>:<your password>@192.168.1.5:8080/rest/things/groheondus%3Aaccount%3A5cc6aaa3bc/enable","text/plain",'false',5000)
createTimer(now.plusMinutes(1), [|
sendHttpPutRequest("http://<your account>:<your password>@192.168.1.5:8080/rest/things/groheondus%3Aaccount%3A5cc6aaa3bc/enable","text/plain",'true',5000)
logInfo("myLog", "Grohe Sense Guard, Account re-enabled")
] )
createTimer(now.plusMinutes(2), [|
sendHttpPutRequest("http://<your account>:<your password>@192.168.1.5:8080/rest/things/groheondus%3Asenseguard%3A5cc6aaa3bc%3A199ff93d-4419-41ad-b83f-f32b0c0b0b5f/enable","text/plain",'true',5000)
logInfo("myLog", "Grohe Sense Guard Item re-enabled")
] )
}
end
Expected Behavior
The Grohe Ondus Binding should refresh every 15 minutes (900s) as polling interval.
Current Behavior
The binding is only refreshing when disabled and enabled again. Values are different from Grohe Sense Android App.
I tried uninsalling and reinstalling the binding, did not help. Refresh token is set and account credentials are given.
All I can see in the log files is the following. The java error messages only show up at the first starting, after that, everything looks fine, bridge is online and SenseGuard too.
Steps to Reproduce (for Bugs)
Your Environment
OpenHab 3.0.2 (Issue was in former 3 versions too, didn't test on OH2) RaspberryPi4B