Page 1 of 1

openUrl (

Posted: Sunday 20 August 2017 9:29
by bing69
Another problem instead of "os.execute (" curl ") I try to fit" openUrl ("https:" to.

Get an error:
2017-08-20 09: 21: 16,548 Error: dzVents: Error: An error occured when calling event deals testpushover
2017-08-20 09: 21: 16,548 Error: dzVents: Error: ... oticz / scripts / dzVents / generated_scripts / testpushover.lua: 13: attempt to call global 'openUrl' (a nil value)

My full code is:

Code: Select all

 return {
    active = true,
    on = {
        devices = {
            'Test Dummy'
        }
    },
    execute = function(domoticz, TestDummy)
            local DeurBergingBuiten = domoticz.devices('Deur berging buiten')
            local LampBerging = domoticz.devices('Lamp berging')
         
        if (TestDummy.state == 'On')  then
            openUrl('https://api.telegram.org/botxxxxxxx:mycode/sendMessage?chat_id=xxxxxxx&text=Test van Ad')
        end   
    end
}
Or can I use osexecute better?

Re: openUrl (

Posted: Sunday 20 August 2017 9:58
by Freemann
Docs says
"openURL(url): Function. Have Domoticz 'call' a URL."

So URL should be in uppercase.


So this should, according to the docs, work;

Code: Select all

return {
    active = true,
    on = {
        devices = {
            'Test Dummy'
        }
    },
    execute = function(domoticz, TestDummy)
            local DeurBergingBuiten = domoticz.devices('Deur berging buiten')
            local LampBerging = domoticz.devices('Lamp berging')
         
        if (TestDummy.state == 'On')  then
            -- openUrl('https://api.telegram.org/botxxxxxxx:mycode/sendMessage?chat_id=xxxxxxx&text=Test van Ad')
               openURL('https://api.telegram.org/botxxxxxxx:mycode/sendMessage?chat_id=xxxxxxx&text=Test van Ad')
        end   
    end
}

Re: openUrl (

Posted: Sunday 20 August 2017 11:04
by bing69
Freemann wrote: Sunday 20 August 2017 9:58 Docs says
"openURL(url): Function. Have Domoticz 'call' a URL."

So URL should be in uppercase.


So this should, according to the docs, work;

Code: Select all

return {
    active = true,
    on = {
        devices = {
            'Test Dummy'
        }
    },
    execute = function(domoticz, TestDummy)
            local DeurBergingBuiten = domoticz.devices('Deur berging buiten')
            local LampBerging = domoticz.devices('Lamp berging')
         
        if (TestDummy.state == 'On')  then
            -- openUrl('https://api.telegram.org/botxxxxxxx:mycode/sendMessage?chat_id=xxxxxxx&text=Test van Ad')
               openURL('https://api.telegram.org/botxxxxxxx:mycode/sendMessage?chat_id=xxxxxxx&text=Test van Ad')
        end   
    end
}
Thank you, but that makes no difference

Re: openUrl (

Posted: Sunday 20 August 2017 11:30
by Doler
Try domoticz.openURL(url).

Re: openUrl (

Posted: Sunday 20 August 2017 11:31
by bing69
In a other tread i found domoticz.openURL en that works!!!!

Re: openUrl (

Posted: Sunday 20 August 2017 11:34
by bing69
Doler wrote: Sunday 20 August 2017 11:30 Try domoticz.openURL(url).
Just one minute later found in another thread, thanks! :D

Re: openUrl (

Posted: Saturday 24 March 2018 19:21
by jandirkv
Hello Bing 69. Can you tell what post that is. I also want to use this for my pilot home automation notifications

Re: openUrl (

Posted: Sunday 25 March 2018 13:38
by waaren