Icloud binding after internet connection renewal

Every night I turn off my internet router for 6 hours with a rule and then turn it on again. After that, the iCloud bridge thing is offline. I solve the problem by saving the bridge thing with “Save” in the GUI. The alternative solution is to completely restart the Rasperry Pi. Of course, both are not elegant. Is there a command that implements “save” for the ting in the GUI or can the binding be modified by the developer? Thanks

Did you try if restaring the binding works, too ?
In case it works you can try to restart it from within a scheduled cronjob via karaf console.
This is done by others for other bindings.

Thinking about it and trying it out.

rule Switch_FBOX_ON
when    Time cron "0 56 5 ? * MON,TUE,WED,THU,FRI *" or Time cron "0 56 7 ? * SUN,SAT *"
then 
        
        logInfo("FB vor ON=",Itm_SW_FBOX.state.toString())
        if(Itm_SW_FBOX.state!=ON)Itm_SW_FBOX.sendCommand(ON) 
        logInfo("FB nach ON=",Itm_SW_FBOX.state.toString())
        prvItm_FB_SWITCH_OFF_Mode.sendCommand(OFF)
        RestartIcloudBindingTimer = createTimer(now.plusSeconds(180), [|
        executeCommandLine(Duration.ofSeconds(6), "sudo", "/usr/bin/ssh", "-p", "8101", "-i", "/home/openhabian/.ssh/id_rsa", "openhab@localhost", "bundle:restart", "org.openhab.binding.icloud")
        ])
      
end

But no reaction in the log .I keep researching. But , sorry, I`m not an experienced Linux user

First try if this works from linux command line:

echo bundle:restart org.openhab.binding.icloud | /usr/bin/openhab-cli console -p habopen

sudo in your command should not be required as it is not required to run the command with root privileges.

Hello Wolfgang, thank you very much, I tried it. There was only one error message that I can’t do anything with, but it still worked. Now all it has to do is work with executeCmdLine

Put the working line into a script:

#!/bin/sh
echo bundle:restart org.openhab.binding.icloud | /usr/bin/openhab-cli console -p habopen

make the script executable: chmod ugo+rx /path/to/your/script
execute the script from within executeCommandLine

I’m a fan of this solution, which would translate to your issue.
I like the added data it provides for when it last ran etc.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.