Hi
I made a custom html to show and control a webcam.
The camera is a esp32-cam.
Pan and tilt is working via mySensors. In domoticz pan and tilt are dimmers.
I can access the page from wlan and it works perfect.
when I connect from outside wlan (mobile data), i can access the page and the camerapicture works flawless.
Unfortunately the dimmers (pan and tilt) do not respond to the sliders I used in the webpage.
Can someone please have a quick look on the html and tell me what i need to change.
greets paede
custom domoticz page cannot control device from outside wlan
Moderator: leecollings
-
- Posts: 17
- Joined: Tuesday 28 July 2020 13:14
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: custom domoticz page cannot control device from outside wlan
Mabe I need to be more precise. I use the following code to change values on the dimmer devices.
idx 286 is the dimmer for pan.
This works on the same network as domoticz, but it doesn't work from outside this network. All other functions of domoticz work from outside this network.
What do I need to change to have functionality from outside lan
Code: Select all
function dim(devicecode,dimlevel){
execute('PUT', '../json.htm?type=command¶m=switchlight&idx='+devicecode+'&switchcmd=Set%20Level&level='+dimlevel, '');
}
function execute($method,$url,$message){
xmlhttp=new XMLHttpRequest();
xmlhttp.open($method,$url,true)
xmlhttp.send($message);
}
<input type="range" min="5" max="100" value="50" onmouseup="dim(286,this.value);;">
This works on the same network as domoticz, but it doesn't work from outside this network. All other functions of domoticz work from outside this network.
What do I need to change to have functionality from outside lan
- kiddigital
- Posts: 437
- Joined: Thursday 10 August 2017 6:52
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: custom domoticz page cannot control device from outside wlan
Why do you use a ‘PUT’ request? I am not sure if Domoticz handles that correctly.
Try a ‘GET’ request as all data is contained in the URL. No need for a ‘POST’.
Make sure that you have given access to the right IP addresses in Domoticz (remote networks) so it accepts incoming requests.
Try a ‘GET’ request as all data is contained in the URL. No need for a ‘POST’.
Make sure that you have given access to the right IP addresses in Domoticz (remote networks) so it accepts incoming requests.
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
One RPi with Pi foundation standard touch screen to display Dashticz
-
- Posts: 17
- Joined: Tuesday 28 July 2020 13:14
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: custom domoticz page cannot control device from outside wlan
I copied this from someone else.Why do you use a ‘PUT’ request? I am not sure if Domoticz handles that correctly.
So I just change 'PUT' to 'GET' ?
My knowledge in html and javascript is very basic. I usually copy code and change that to my needs.
domoticz works from remote networks. Only the dimmers on my custom page do not work. when i change those in "normal" devices tab they work.
Thanks
paede
- kiddigital
- Posts: 437
- Joined: Thursday 10 August 2017 6:52
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: custom domoticz page cannot control device from outside wlan
Yes, just change PUT to GET.
One RPi with Domoticz, RFX433e, aeon labs z-wave plus stick GEN5, ha-bridge 5.4.0 for Alexa, Philips Hue Bridge, Pimoroni Automation Hat
One RPi with Pi foundation standard touch screen to display Dashticz
One RPi with Pi foundation standard touch screen to display Dashticz
-
- Posts: 17
- Joined: Tuesday 28 July 2020 13:14
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: custom domoticz page cannot control device from outside wlan
ok I changed the PUT to GET.
But that did not make any change.
Controlling of pan and tilt works fine on the custom html in local network, but in remote network it does not work.
But that did not make any change.
Controlling of pan and tilt works fine on the custom html in local network, but in remote network it does not work.
- waltervl
- Posts: 5376
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: custom domoticz page cannot control device from outside wlan
If you use user/password to access domoticz, you have to add that to the json statement in custom page as it is not integrated in Domoticz.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
- waltervl
- Posts: 5376
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: custom domoticz page cannot control device from outside wlan
And additional perhaps add the IP of your domoticz server to the url variable too
see https://github.com/domoticz/domoticz/bl ... om.example
see https://github.com/domoticz/domoticz/bl ... om.example
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Who is online
Users browsing this forum: No registered users and 0 guests