Open / run URL every x hours  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
sammyke007
Posts: 204
Joined: Monday 08 May 2017 20:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Belgium
Contact:

Open / run URL every x hours

Post by sammyke007 »

Hi

I'm running FullyKiosk on a tablet and I would like to restart my FullyKiosk every 6 hours. This is be possible with opening the following URL:

Code: Select all

http://192.168.1.182:2323/?cmd=restartApp&password=mypassword
For now, I have a dummy device with the above URL as "On command" configured with a timer putting the device on+off every 6 hours. This works partially, but sometimes I get

Code: Select all

 Error: Error opening url: http://192.168.1.182:2323/?cmd=restartApp&password=mypassword 
Anyone can help me with putting this in a DZVents script please?
I don't seem to understand all the URL calling methods... (POST/GET/...)
User avatar
erem
Posts: 230
Joined: Tuesday 27 March 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Amsterdam/netherlands
Contact:

Re: Open / run URL every x hours  [Solved]

Post by erem »

something like this

Code: Select all

return {
    on = {
        timer = { 'every 6 hours' }
    },
    execute = function(domoticz, item)
        if (item.isTimer) then
            domoticz.openURL({
            url = 'http://192.168.1.182:2323/?cmd=restartApp&password=mypassword',
            method = 'GET'
            })
        end
    end
}
Regards,

Rob
sammyke007
Posts: 204
Joined: Monday 08 May 2017 20:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Belgium
Contact:

Re: Open / run URL every x hours

Post by sammyke007 »

Works fine, tnx Rob!!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest