setcolor results in openurl 0.0.0.0:80 [solved with workarround]

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

Moderator: leecollings

ravaoo
Posts: 39
Joined: Friday 14 October 2022 10:46
Target OS: NAS (Synology & others)
Domoticz version: 2024-7
Location: Nederland
Contact:

setcolor results in openurl 0.0.0.0:80 [solved with workarround]

Post by ravaoo »

Hi,
I want to change the color of my hue GU10 spot in dzVents

Code: Select all

return
{
    active = true,
    on =
    {
        devices = {'DZVENTS tester'}
    },
    	
logging =
    {   
        level = domoticz.LOG_DEBUG,
        marker = "Hue light test",
    },
    execute = function(domoticz)

          domoticz.devices('Huespot 1').setColor(0, 255, 0)

    --end
        end
}
Results in :
OpenURL: url = http://0.0.0.0:80/json.htm?type=command ... :255,"b":0}


Is this a bug or is de script wrong?
Last edited by ravaoo on Monday 29 April 2024 9:48, edited 1 time in total.
Running latest BETA on on Docker (Container Manager) in Synology NAS using zwave_js_ui with mqtt. Getting started with homebridge.

Living in an automated house is a survival but it is worth it
Kedi
Posts: 575
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: setcolor results in openurl 0.0.0.0:80

Post by Kedi »

What should be a bug? Does the light not change to green?
Logic will get you from A to B. Imagination will take you everywhere.
User avatar
waltervl
Posts: 5846
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: setcolor results in openurl 0.0.0.0:80

Post by waltervl »

For color settings DzVents probably uses the API instead of LUA integration so then it uses 0.0.0.0.
So this seems normal.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
ravaoo
Posts: 39
Joined: Friday 14 October 2022 10:46
Target OS: NAS (Synology & others)
Domoticz version: 2024-7
Location: Nederland
Contact:

Re: setcolor results in openurl 0.0.0.0:80

Post by ravaoo »

Nothing changes (should be green) And i get this message in the log.

2024-03-13 14:16:13.776 Error: Error opening url: http://0.0.0.0:80/json.htm?type=command ... :255,"b":0}
Running latest BETA on on Docker (Container Manager) in Synology NAS using zwave_js_ui with mqtt. Getting started with homebridge.

Living in an automated house is a survival but it is worth it
User avatar
waltervl
Posts: 5846
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: setcolor results in openurl 0.0.0.0:80

Post by waltervl »

Check your security settings, so that it allows basic authorisation for HTTP.
Also check that the internal IP of your Domoticz container is in the security trusted networks setting. Both options can be found in Domoticz menu setup - Settings, tab Security.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
ravaoo
Posts: 39
Joined: Friday 14 October 2022 10:46
Target OS: NAS (Synology & others)
Domoticz version: 2024-7
Location: Nederland
Contact:

Re: setcolor results in openurl 0.0.0.0:80

Post by ravaoo »

waltervl wrote: Wednesday 13 March 2024 22:44 Check your security settings, so that it allows basic authorisation for HTTP.
Also check that the internal IP of your Domoticz container is in the security trusted networks setting. Both options can be found in Domoticz menu setup - Settings, tab Security.
Thanks for helping!
basic authorisation for HTTP is checked
I mist de container IP and i added it.
Stil not working. Also after restarting Domoticz (if this could be necessary)

I tried it on a other Hue device, color bulp in stat of spot, and still not working.

Something else i can check/try?
Running latest BETA on on Docker (Container Manager) in Synology NAS using zwave_js_ui with mqtt. Getting started with homebridge.

Living in an automated house is a survival but it is worth it
ravaoo
Posts: 39
Joined: Friday 14 October 2022 10:46
Target OS: NAS (Synology & others)
Domoticz version: 2024-7
Location: Nederland
Contact:

Re: setcolor results in openurl 0.0.0.0:80

Post by ravaoo »

I also tried switchOn() and this works! In the log i don't see the use of OpenUrl so my gues is it is using some other mechanism
Running latest BETA on on Docker (Container Manager) in Synology NAS using zwave_js_ui with mqtt. Getting started with homebridge.

Living in an automated house is a survival but it is worth it
bvdf0251
Posts: 24
Joined: Saturday 09 July 2022 14:38
Target OS: -
Domoticz version:
Contact:

Re: setcolor results in openurl 0.0.0.0:80

Post by bvdf0251 »

From Wiki

setColor(r, g, b, br, cw, ww, m, t): Function. Sets the light to requested color. r, g, b required, others optional. Supports command options. Meaning and limits of parms can be found here.

setRGB(red, green, blue): Function. Set the lamps RGB color. Values are from 0-255. Supports command options.

Looks like you need to either change command or parameters
ravaoo
Posts: 39
Joined: Friday 14 October 2022 10:46
Target OS: NAS (Synology & others)
Domoticz version: 2024-7
Location: Nederland
Contact:

Re: setcolor results in openurl 0.0.0.0:80

Post by ravaoo »

bvdf0251 wrote: Thursday 14 March 2024 10:56 From Wiki

setColor(r, g, b, br, cw, ww, m, t): Function. Sets the light to requested color. r, g, b required, others optional. Supports command options. Meaning and limits of parms can be found here.

setRGB(red, green, blue): Function. Set the lamps RGB color. Values are from 0-255. Supports command options.

Looks like you need to either change command or parameters
Thank you for helping.

I tried "setRGB(0, 255, 0)" and get also an error.

setColor() error:
2024-03-14 11:10:10.406 Error: Error opening url: http://0.0.0.0:80/json.htm?type=command ... white=true

setRGB() error:
2024-03-14 11:10:10.407 Error: Error opening url: http://0.0.0.0:80/json.htm?type=command ... :255,"b":0}

Different url but still an error!
Running latest BETA on on Docker (Container Manager) in Synology NAS using zwave_js_ui with mqtt. Getting started with homebridge.

Living in an automated house is a survival but it is worth it
ravaoo
Posts: 39
Joined: Friday 14 October 2022 10:46
Target OS: NAS (Synology & others)
Domoticz version: 2024-7
Location: Nederland
Contact:

Re: setcolor results in openurl 0.0.0.0:80

Post by ravaoo »

I do not know what the difference is but when i go to the switch in domoticz and i change the color in de color selector then the color changes in the bulp and i get no errors! The same change i want to do with dzVents.

In the log i saw
Status: setcolbrightnessvalue: ID: 9, bri: 11, color: '{m: 3, RGB: 314fff, CWWW: 0000, CT: 0}'

So i tried setcolbrightness(0,255,0) and it gives the same result is setColor()
Running latest BETA on on Docker (Container Manager) in Synology NAS using zwave_js_ui with mqtt. Getting started with homebridge.

Living in an automated house is a survival but it is worth it
Kedi
Posts: 575
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: setcolor results in openurl 0.0.0.0:80

Post by Kedi »

It looks like you are running Domoticz on port 80 (default is 8080)
Is there nothing else running on that port? Because you script runs fine at my place.
Logic will get you from A to B. Imagination will take you everywhere.
ravaoo
Posts: 39
Joined: Friday 14 October 2022 10:46
Target OS: NAS (Synology & others)
Domoticz version: 2024-7
Location: Nederland
Contact:

Re: setcolor results in openurl 0.0.0.0:80

Post by ravaoo »

It took me some wile but i managed to get Domoticz to run on port 8080. I think there was nothing else running on port 80 but to rule out this posibility i changed the setup. The result is disapointing and i get the same error but only on a different port

Error:
2024-03-19 12:06:21.782 Error: Error opening url: http://0.0.0.0:8080/json.htm?type=comma ... hite=false
Running latest BETA on on Docker (Container Manager) in Synology NAS using zwave_js_ui with mqtt. Getting started with homebridge.

Living in an automated house is a survival but it is worth it
ravaoo
Posts: 39
Joined: Friday 14 October 2022 10:46
Target OS: NAS (Synology & others)
Domoticz version: 2024-7
Location: Nederland
Contact:

Re: setcolor results in openurl 0.0.0.0:80

Post by ravaoo »

New input for this problem (maybe)
I restarted Domoticz and in the log was this message:
2024-03-20 10:57:42.491 Status: WebServer(HTTP) startup failed on address :: with port: 8082: resolve: Host not found (authoritative) [asio.netdb:1 at /usr/local/include/boost/asio/detail/resolver_service.hpp:84 in function 'resolve'], trying ::
2024-03-20 10:57:42.491 Status: WebServer(HTTP) startup failed on address :: with port: 8082: resolve: Host not found (authoritative) [asio.netdb:1 at /usr/local/include/boost/asio/detail/resolver_service.hpp:84 in function 'resolve'], trying 0.0.0.0

Could this cause my problem and if so how do i fix it?

By the way: To rule out conflict on port 8080 a changed Domoticz to port 8082. (i learned how to do this so was easy this time :) )
Running latest BETA on on Docker (Container Manager) in Synology NAS using zwave_js_ui with mqtt. Getting started with homebridge.

Living in an automated house is a survival but it is worth it
User avatar
waltervl
Posts: 5846
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: setcolor results in openurl 0.0.0.0:80

Post by waltervl »

Check the Docker container configuration, perhaps you changed it the wrong way. https://www.domoticz.com/wiki/Synology

Code: Select all

Port settings:
Local port 7080, container port 80
Environment:
WWW_PORT: 80
SSL_PORT: 0
So WWW_PORT and Container port should be the same but could be set both to 8082 in your case.
Local port is the port you are looking to to get to Domoticz from another PC in your network eg http://NAS-IP:7080
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
ravaoo
Posts: 39
Joined: Friday 14 October 2022 10:46
Target OS: NAS (Synology & others)
Domoticz version: 2024-7
Location: Nederland
Contact:

Re: setcolor results in openurl 0.0.0.0:80

Post by ravaoo »

Thanks for responding Waltervl:
I think my config voor de container is okay. I use a project in container manager now. this is my yaml file content:

Code: Select all

version: '3.3'

services:
  domoticz:
    image: domoticz/domoticz:latest
    container_name: domoticz
    restart: on-failure:5 
    privileged: true
    ports:
      - "8082:80"
    volumes:
      - /volume1/docker/domoticz:/opt/domoticz/userdata 
    environment:
      - TZ=Europe/Amsterdam
      - WWW_PORT=80
      - LOG_PATH=/opt/domoticz/userdata/domoticz.log
During testing I shortly switched off firewall in DMS so settings there should not be the problem
Running latest BETA on on Docker (Container Manager) in Synology NAS using zwave_js_ui with mqtt. Getting started with homebridge.

Living in an automated house is a survival but it is worth it
Kedi
Posts: 575
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: setcolor results in openurl 0.0.0.0:80

Post by Kedi »

Try it with the line " privileged: true" removed.
Logic will get you from A to B. Imagination will take you everywhere.
ravaoo
Posts: 39
Joined: Friday 14 October 2022 10:46
Target OS: NAS (Synology & others)
Domoticz version: 2024-7
Location: Nederland
Contact:

Re: setcolor results in openurl 0.0.0.0:80

Post by ravaoo »

Kedi wrote: Monday 25 March 2024 9:30 Try it with the line " privileged: true" removed.
I tested it but got the same error.

(By the way : I use de privileged modes for zwave stick and smart energy meter)
Running latest BETA on on Docker (Container Manager) in Synology NAS using zwave_js_ui with mqtt. Getting started with homebridge.

Living in an automated house is a survival but it is worth it
ravaoo
Posts: 39
Joined: Friday 14 October 2022 10:46
Target OS: NAS (Synology & others)
Domoticz version: 2024-7
Location: Nederland
Contact:

Re: setcolor results in openurl 0.0.0.0:80

Post by ravaoo »

I got a idee!
Can someone provide me with code do the same in LUA or Python? I want to test if it is a environment problem or a dzVents problem.
Running latest BETA on on Docker (Container Manager) in Synology NAS using zwave_js_ui with mqtt. Getting started with homebridge.

Living in an automated house is a survival but it is worth it
Kedi
Posts: 575
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: setcolor results in openurl 0.0.0.0:80

Post by Kedi »

What's the output of

Code: Select all

sudo docker ps -a
when you ssh into your NAS
it should be something like

Code: Select all

0f788fe90201   domoticz/domoticz:latest             "docker-entrypoint.s…"   45 hours ago    Up 45 hours             443/tcp, 0.0.0.0:8080->8080/tcp, :::8080->8080/tcp
Special IP 0.0.0.0:<port> should be present.
Logic will get you from A to B. Imagination will take you everywhere.
Kedi
Posts: 575
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: setcolor results in openurl 0.0.0.0:80

Post by Kedi »

Try adding an environment variable

Code: Select all

- BIND_ADDR=0.0.0.0:8082
Logic will get you from A to B. Imagination will take you everywhere.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest