Page 2 of 2

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

Posted: Wednesday 06 December 2023 23:34
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

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

Posted: Wednesday 06 December 2023 23:35
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.

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

Posted: Wednesday 06 December 2023 23:36
by waltervl
Addition, are you using a proxy for externally access?

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

Posted: Wednesday 06 December 2023 23:38
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.*

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

Posted: Wednesday 06 December 2023 23:44
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.

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

Posted: Wednesday 06 December 2023 23:46
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?

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

Posted: Wednesday 06 December 2023 23:53
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

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

Posted: Wednesday 06 December 2023 23:58
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?

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

Posted: Thursday 07 December 2023 0:12
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

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

Posted: Thursday 07 December 2023 17:12
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.

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

Posted: Thursday 07 December 2023 17:27
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"

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

Posted: Thursday 07 December 2023 17:59
by JanvdW
Right; that leads to the same error:

Code: Select all

<html><head><title>Unauthorized</title></head><body><h1>401 Unauthorized</h1></b 

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

Posted: Thursday 07 December 2023 20:03
by waltervl
Than that IP adress you filled in is not correct.

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

Posted: Thursday 07 December 2023 21:42
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!

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

Posted: Thursday 07 December 2023 22:24
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......