dzvents JSON call for Evohome device results in an error  [Solved]

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

Moderator: leecollings

JanvdW
Posts: 118
Joined: Saturday 21 December 2019 8:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: dzvents JSON call for Evohome device results in an error

Post by JanvdW »

willemd wrote: Wednesday 06 December 2023 22:46 And I guess running the same curl command from the command line using ssh to that machine works without problems.......
Correct; on the command line there's no problem. Results as expected
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: dzvents JSON call for Evohome device results in an error

Post by waltervl »

And there is my doubt, I think the server IP is not correct.
Also Domoticz log should give a message about unauthorized access with an IP.
Also all tests should be done without user:password entries in the url.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: dzvents JSON call for Evohome device results in an error

Post by waltervl »

Addition, are you using a proxy for externally access?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
JanvdW
Posts: 118
Joined: Saturday 21 December 2019 8:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: dzvents JSON call for Evohome device results in an error

Post by JanvdW »

willemd wrote: Wednesday 06 December 2023 23:24
waltervl wrote: Wednesday 06 December 2023 22:53
willemd wrote: Wednesday 06 December 2023 22:46 And I guess running the same curl command from the command line using ssh to that machine works without problems.......
My guess is that it will not but we will see.
dZvents opens a new session with openUrl() so the IP of the server has to be in the trusted network settings. It has always been so (documentation still uses old menu names): https://www.domoticz.com/wiki/DzVents:_ ... h_Domoticz
And JanvdW confirmed all relevant IP addresses are in the trusted network list
Indeed, trusted networks contains:
127.0.0.*;192.xxx.x.*
JanvdW
Posts: 118
Joined: Saturday 21 December 2019 8:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: dzvents JSON call for Evohome device results in an error

Post by JanvdW »

waltervl wrote: Wednesday 06 December 2023 23:35 And there is my doubt, I think the server IP is not correct.
Also Domoticz log should give a message about unauthorized access with an IP.
Also all tests should be done without user:password entries in the url.
I am sure about the IP address and checked it over and over again. And, it works fine in the browser/ command line (with copy/paste).
I have done all test with http and https; the outcome was the same.
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: dzvents JSON call for Evohome device results in an error

Post by waltervl »

So please answer my questions:
Are you using docker?
Are you using a proxy for external access, and if yes, how did you configure it?
Do you see an entry for unauthorized access in your Domoticz log when you run the dZvents acript?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
JanvdW
Posts: 118
Joined: Saturday 21 December 2019 8:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: dzvents JSON call for Evohome device results in an error

Post by JanvdW »

waltervl wrote: Wednesday 06 December 2023 23:46 So please answer my questions:
Are you using docker?
Are you using a proxy for external access, and if yes, how did you configure it?
Do you see an entry for unauthorized access in your Domoticz log when you run the dZvents acript?
Yes, I use Docker
No, I don't use a proxy for external access
Yes, there are entries for unauthorized access in the Domoticz log, but they do not contain an IP address
JanvdW
Posts: 118
Joined: Saturday 21 December 2019 8:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: dzvents JSON call for Evohome device results in an error

Post by JanvdW »

Recently I restored the Domoticz database on the Docker implementation. I can't find any, but maybe a reference to the previous Docker implementation (on another IP address) is left somewhere?
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: dzvents JSON call for Evohome device results in an error

Post by waltervl »

If you are using docker you have to add the internal IP adress of the docker container to the trusted network setting . So check that in the container with

Code: Select all

docker exec -it domoticz 
cat /etc/hosts
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
JanvdW
Posts: 118
Joined: Saturday 21 December 2019 8:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: dzvents JSON call for Evohome device results in an error

Post by JanvdW »

waltervl wrote: Thursday 07 December 2023 0:12 If you are using docker you have to add the internal IP adress of the docker container to the trusted network setting . So check that in the container with

Code: Select all

docker exec -it domoticz 
cat /etc/hosts
I checked this IP address but it's already in the trusted network list. I saw this IP address in Portainer (see post of 06 December 2023 20:24) and added it, just to be sure that this didn't cause the issue.
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: dzvents JSON call for Evohome device results in an error

Post by waltervl »

What if you run the curl with a correct idx in the docker container (that is what dzvents is doing)

Code: Select all

docker exec -it domoticz
curl "http://ip:port/json.htm?type=command&param=getdevices&rid=idx"
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
JanvdW
Posts: 118
Joined: Saturday 21 December 2019 8:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: dzvents JSON call for Evohome device results in an error

Post by JanvdW »

Right; that leads to the same error:

Code: Select all

<html><head><title>Unauthorized</title></head><body><h1>401 Unauthorized</h1></b 
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: dzvents JSON call for Evohome device results in an error

Post by waltervl »

Than that IP adress you filled in is not correct.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
JanvdW
Posts: 118
Joined: Saturday 21 December 2019 8:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: dzvents JSON call for Evohome device results in an error  [Solved]

Post by JanvdW »

Problem solved. I changed the IP address in the json/curl commands with the internal IP address of the Docker container. That was probably what you meant, right? Works fine now!
Anyway, in case of Docker one should use the internal Docker IP address for json/curl commands.
I learned a lot about the way this works too. Thanks a lot waltervl and willemd!
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: dzvents JSON call for Evohome device results in an error

Post by waltervl »

Well not exactly what I was expecting as the issue :) But good you found the solution. That docker part is always giving an extra layer of complexity on Domoticz......
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest