openUrl (

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

Moderator: leecollings

Post Reply
bing69
Posts: 139
Joined: Thursday 05 June 2014 10:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: 's-Hertogenbosch, NL
Contact:

openUrl (

Post 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?
Freemann
Posts: 94
Joined: Thursday 24 November 2016 14:55
Target OS: Linux
Domoticz version: >=Béta
Location: Netherlands
Contact:

Re: openUrl (

Post 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
}
Domotica/graphs "freak" :)
NUC8i3BEH(8gb/250gb),
Lubuntu 19.04,
Aeotec Z-Stick S2(Gen5)
HarmonyElite
HUE(5 bulbs, 2 blooms)
NetAtmo(complete setup)
MiLight iboxV6(2 MiLightBulbs)
IP-Cam

https://www.frijduurzaam.nl
bing69
Posts: 139
Joined: Thursday 05 June 2014 10:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: 's-Hertogenbosch, NL
Contact:

Re: openUrl (

Post 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
Doler
Posts: 163
Joined: Friday 31 July 2015 21:02
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Sint-Oedenrode, Netherlands
Contact:

Re: openUrl (

Post by Doler »

Try domoticz.openURL(url).
Mark: Domoticz latest Beta on Virtual machine (Proxmox) running Debian Bookworm - Z-Stick 7 - RFXCom - P1 - SolarEdge - Dahua - Philips Hue - Docker - Zigbee2mqtt (latest, docker) via python plugin - Zwave-js-ui (latest, docker) - dzVents - Nodered
bing69
Posts: 139
Joined: Thursday 05 June 2014 10:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: 's-Hertogenbosch, NL
Contact:

Re: openUrl (

Post by bing69 »

In a other tread i found domoticz.openURL en that works!!!!
bing69
Posts: 139
Joined: Thursday 05 June 2014 10:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: 's-Hertogenbosch, NL
Contact:

Re: openUrl (

Post by bing69 »

Doler wrote: Sunday 20 August 2017 11:30 Try domoticz.openURL(url).
Just one minute later found in another thread, thanks! :D
jandirkv
Posts: 27
Joined: Monday 19 February 2018 6:20
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.9117
Contact:

Re: openUrl (

Post by jandirkv »

Hello Bing 69. Can you tell what post that is. I also want to use this for my pilot home automation notifications
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: openUrl (

Post by waaren »

Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest