Page 2 of 2

Re: Color and brightness with a zigbee lamp

Posted: Saturday 06 July 2019 14:32
by domogijs
ok thanks, saved it as dzVents

but still get errors.

error:


2019-07-06 12:28:33.363 Error: dzVents: local netWork not open for dzVents openURL call !
2019-07-06 12:28:33.363 Error: dzVents: check dzVents wiki (look for 'Using dzVents with Domoticz')

script

Code: Select all

return {
    on = { devices = { "ThermSwitch" }},
    
    execute = function(dz, item)
        Ikea = dz.devices(793)
        
        if item.active then
            Ikea.setRGB(100,100,0)
        else
            Ikea.switchOff()
        end
    end
}
any ideas?

Re: Color and brightness with a zigbee lamp

Posted: Saturday 06 July 2019 14:51
by EddyG
And did you do the hint from the error message: look in the wiki and do some stuff?

Re: Color and brightness with a zigbee lamp

Posted: Saturday 06 July 2019 15:11
by domogijs
;) yes i get the hint and i did some stuff

the rgb setting seems fine; wiki setRGB(red, green, blue): Function. 2.4.0 Set the lamps RGB color. Values are from 0-255. Supports command options.

i just dont get the openUrl part. I am not using it in the script.

openURL(url/options): Function. Have Domoticz 'call' a URL. If you just pass a url then Domoticz will execute the url after your script has finished but you will not get notified. If you pass a table with options then you have to possibility to receive the results of the request in a dzVents script. Read more about asynchronous http requests2.4.0 with dzVents. Supports command options.

are you willing to give a hint?

Re: Color and brightness with a zigbee lamp

Posted: Saturday 06 July 2019 22:53
by waaren
domogijs wrote: Saturday 06 July 2019 15:11 are you willing to give a hint?
The error message asks you to goto the wiki and look for "Using dzVents with Domoticz"
If you do that you will read:
"In Domoticz go to Setup > Settings > Other and in the section EventSystem make sure the check-box 'dzVents disabled' is not checked. Also make sure that in the Security section in the settings (Setup > Settings > System > Local Networks (no username/password) you allow 127.0.0.1 to not need a password. dzVents uses that port to send certain commands to Domoticz. Finally make sure you have set your current location in Setup > Settings > System > Location, otherwise there is no way to determine nighttime/daytime state.
"
Fact that you don't use openURL in your script explicitly does not mean dzVents is not using it to 'send certain commands to Domoticz'

Re: Color and brightness with a zigbee lamp

Posted: Sunday 07 July 2019 14:40
by domogijs
Thanks! That solved the error, i will rtfm better in the future :)

But now i have a new error :

Error: Error opening url: http://127.0.0.1:8080/json.htm?type=com ... :100,"b":5}


I tried this in the browser:

http://192.168.178.19:8080/json.htm?typ ... es&rid=392 (works)
http://127.0.0.1:8080/json.htm?type=devices&rid=392 (doesnt work)

with ifconfig on the pi i get this. I seem to listen on that adres

Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:40 errors:0 dropped:0 overruns:0 frame:0
TX packets:40 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2840 (2.7 KiB) TX bytes:2840 (2.7 KiB)


With netstat -anl|grep -i "listen"|grep -i "tcp" i get this. no 8080



tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:1880 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp6 0 0 :::8080 :::* LISTEN
tcp6 0 0 :::22 :::* LISTEN
tcp6 0 0 ::1:25 :::* LISTEN
tcp6 0 0 :::443 :::* LISTEN
tcp6 0 0 :::6144 :::* LISTEN



In dont know anymore what to try next. Any ideas?

Greets Gijs

Re: Color and brightness with a zigbee lamp

Posted: Sunday 07 July 2019 21:35
by waaren
domogijs wrote: Sunday 07 July 2019 14:40 I have a new error :
Error: Error opening url: http://127.0.0.1:8080/json.htm?type=com ... :100,"b":5}
What do you see if you give

Code: Select all

sudo curl -s 'http://127.0.0.1:8080/json.htm?type=devices' | grep version
from the CLI ?

Re: Color and brightness with a zigbee lamp

Posted: Sunday 07 July 2019 23:22
by domogijs
Hi waaren thanks for the help

I see :

pi@raspberrypi:~$ sudo curl -s 'http://127.0.0.1:8080/json.htm?type=devices'
Unauthorized

401 Unauthorized

pi@raspberrypi:~$ 

Greets Gijs

Re: Color and brightness with a zigbee lamp

Posted: Monday 08 July 2019 1:14
by waaren
domogijs wrote: Sunday 07 July 2019 23:22 pi@raspberrypi:~$ sudo curl -s 'http://127.0.0.1:8080/json.htm?type=devices'
Unauthorized
Can you try and modify the local networks settings in the domoticz gui ?

Setup -> Settings -> System setup -> local networks (NO USERNAME/PASSWORD) field filled with "127.0.0.*;192.168.178.*"

Re: Color and brightness with a zigbee lamp  [Solved]

Posted: Monday 08 July 2019 19:13
by domogijs
yes! it works. Thanks!