NEW frontpage.html - request comments
Moderator: leecollings
- domoticzfanman
- Posts: 7
- Joined: Saturday 14 March 2020 2:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.10717
- Location: Netherlands
- Contact:
Re: NEW frontpage.html - request comments
All coding and pages can be found in my Dutch Forum including instructions in Dutch.
https://contactkring.nl/phpbb
https://contactkring.nl/phpbb
-
- Posts: 39
- Joined: Monday 19 January 2015 14:35
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: The Netherlands
- Contact:
Re: NEW frontpage.html - request comments
Thanks!domoticzfanman wrote: ↑Thursday 26 March 2020 14:07 All coding and pages can be found in my Dutch Forum including instructions in Dutch.
https://contactkring.nl/phpbb
Raspberry 3
Aeon Labs Z-Wave Stick Series 2 - RFLink USB Gateway
Z-Wave switches
433 MHz Temperature + Humidity sensors
Philips Hue Lights
Mi-Light WiFi Bridge + RGBW Controllers
Aeon Labs Z-Wave Stick Series 2 - RFLink USB Gateway
Z-Wave switches
433 MHz Temperature + Humidity sensors
Philips Hue Lights
Mi-Light WiFi Bridge + RGBW Controllers
-
- Posts: 29
- Joined: Friday 29 November 2019 18:01
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: Gent
- Contact:
Re: NEW frontpage.html - request comments
frontpage.html is not displayed correctly from domoticz.
* html on windows pc everything is shown.
* html on domoticz is not shown (see above)
On Raspberry via vnc viewer in browser:
* html is not shown (see above)
* http://mydomoticz:8080/json.htm?type=devices&plan=0 the browser shows data
Anyone have an idea what's going wrong?
Domoticzurl = hostname:8080* html on windows pc everything is shown.
* html on domoticz is not shown (see above)
On Raspberry via vnc viewer in browser:
* html is not shown (see above)
* http://mydomoticz:8080/json.htm?type=devices&plan=0 the browser shows data
Anyone have an idea what's going wrong?
- domoticzfanman
- Posts: 7
- Joined: Saturday 14 March 2020 2:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.10717
- Location: Netherlands
- Contact:
Re: NEW frontpage.html - request comments
Have you tried your own ip of the raspberry and is the idx set correctly ?
-
- Posts: 29
- Joined: Friday 29 November 2019 18:01
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: Gent
- Contact:
Re: NEW frontpage.html - request comments
Found it. There was an error in the html file. Copied to Windows desktop and was also wrong view.
Now he is doing well.
Now he is doing well.
- barts2108
- Posts: 25
- Joined: Wednesday 17 June 2020 18:31
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Arnhem
- Contact:
Re: NEW frontpage.html - request comments
To all frontpage desingers...
I just started to discover the frontpage following the original frontpage.html and because I "have the need for speed" I set the refresh interval to 1 seconds. Surprisingly my browser memory usage sky rocket to over 10GB
I have done some quick debugging, and found that the refreshTimer is started BEFORE the getJSON() has recevied its reply. Of course that leads to a race condition in both memory usage and CPU load. Below the snippets of the RefreshData() inside the frontpage.html
With the console.log you can see that the timer is restarted before the reply is received, making faster update times giving problems.
Below snippet shows .done, .fail and .always that can be used to execute code when the received reply is handled, a failure happend or when everything is complete.
Furthermore there I think there is no need to get the length of the PageArray in the for loop where len is even in the global namespace.
can be simply replaced with
or if you really like to use a len variable do like this:
Further optimization may be done by changing the for loop inside the $.each(). When you have 1000 indexes and 14 items in the PageArray, this will execute the forloop 1000 times. Regardless if an index is found in the PageArray, the forloop runs always over all items.
It might be better sort the PageArray, then loop all 14 items of the PageArray and find the data in the data.result.
$.each() { forloop PageArry } --> 1000 * 14 = 14000 iterations (always) before it is ready.
forloop PageArray { loop items } --> 1000 * 14 = 14000 iterations worst case. Worst case is only when all PageArray items have the idx of the last item in the $.each(), which normally won't be the case.
I will check if is better for performance to convert the received json data into an object and build a dictionary with it.
I just started to discover the frontpage following the original frontpage.html and because I "have the need for speed" I set the refresh interval to 1 seconds. Surprisingly my browser memory usage sky rocket to over 10GB
I have done some quick debugging, and found that the refreshTimer is started BEFORE the getJSON() has recevied its reply. Of course that leads to a race condition in both memory usage and CPU load. Below the snippets of the RefreshData() inside the frontpage.html
Code: Select all
$.getJSON(jurl,
{
format: "json"
},
function(data) {
console.log("reply received");
if (typeof data.result != 'undefined') {
// Code left out because of not being trivial to the problem
}
});
console.log("timer restarted)
$.refreshTimer = setInterval(RefreshData, 10000);
Below snippet shows .done, .fail and .always that can be used to execute code when the received reply is handled, a failure happend or when everything is complete.
Code: Select all
$.getJSON(jurl,
{
format: "json"
},
function(data) {
if (typeof data.result != 'undefined') {
// Code left out because of not being trivial to the problem
}
}).done(function(){;
console.log("second success");
}).fail(function() {
console.log( "error" );
}).always(function() {
console.log( "complete" );
$.refreshTimer = setInterval(RefreshData, 10000);
});
Code: Select all
for( var ii = 0, len = $.PageArray.length; ii < len; ii++ ) {
Code: Select all
for( var ii = 0; ii < $.PageArray.length; ii++ ) {
Code: Select all
var len = $.PageArray.length;
for( var ii = 0; ii < len; ii++ ) {
It might be better sort the PageArray, then loop all 14 items of the PageArray and find the data in the data.result.
$.each() { forloop PageArry } --> 1000 * 14 = 14000 iterations (always) before it is ready.
forloop PageArray { loop items } --> 1000 * 14 = 14000 iterations worst case. Worst case is only when all PageArray items have the idx of the last item in the $.each(), which normally won't be the case.
I will check if is better for performance to convert the received json data into an object and build a dictionary with it.
- barts2108
- Posts: 25
- Joined: Wednesday 17 June 2020 18:31
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Arnhem
- Contact:
Re: NEW frontpage.html - request comments
The $.each() with the nested for loop could be replaced with something like this:
Note that I also changed the line (not creating a new string object)
On my system I have only 91 entries in the data returned from the getJSON and I do not see much difference in performance. Receiving the data takes more time than handling it. However on systems that contain much more data in the JSON it may help to improve performance.
Code: Select all
$.each($.PageArray, function(i, item) {
var vtype=item[1];
var vlabel=item[2];
var idxIndex = dataObject.map(function(x) { return x.idx; }).indexOf(item[0]);
if (idxIndex != -1) {
var vdata=dataObject[idxIndex][vtype];
}
var vstr = "";
if (typeof vdata == 'undefined') {
vstr="??";
}
else {
vstr=vdata.toString().split(" ",1)[0];
}
$('#'+vlabel).html(vstr);
});
Code: Select all
vdata=new String(vdata).split(" ",1)[0];
- barts2108
- Posts: 25
- Joined: Wednesday 17 June 2020 18:31
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Arnhem
- Contact:
Re: NEW frontpage.html - request comments
Please all take a read on https://developer.mozilla.org/en-US/doc ... ributes/id
And take another look at the frontpage.html (the oringal file but also the newer updated ones)
All div's with id="frame" violate the html spec. It would be much better to use class="frame" and change the #frame css to .frame
And take another look at the frontpage.html (the oringal file but also the newer updated ones)
Code: Select all
<div id="frame">
<div id="cycb" style="font-size:40px;">--</div>
<div id="label_lg">Temp Floorheat In</div>
</div>
<div id="frame">
<div id="cyce" style="font-size:40px;">--</div>
<div id="label_lg">Temp Floorheat Out</div>
</div>
<div id="frame">
<div id="state" style="font-size:40px;">--</div>
<div id="label_lg">Hvac State</div>
</div>
<div id="frame">
<div id="tmpb" style="font-size:40px;">--</div>
<div id="label_lg">Temp Hot Water</div>
</div>
-
- Posts: 2
- Joined: Wednesday 08 July 2020 12:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: NEW frontpage.html - request comments
What value format to use for LUX
//format: idx, value, label, description, [override css], [alarm value]
Is there somewhere a list of all supported value format to use. EX Temp, Status, Humidity...?
//format: idx, value, label, description, [override css], [alarm value]
Is there somewhere a list of all supported value format to use. EX Temp, Status, Humidity...?
Re: NEW frontpage.html - request comments
When I want to display a selector, I don't see a name.
It then indicates undifined and does not indicate a level name.
Does anyone know where I should look for this.
It then indicates undifined and does not indicate a level name.
Does anyone know where I should look for this.
-
- Posts: 249
- Joined: Sunday 09 October 2016 20:20
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2021.1
- Location: Nederland
- Contact:
Re: NEW frontpage.html - request comments
Does someone know how to show just two
Devices in the screen?
Gas usage and electric usage so just two big blocks
Can someone please explain
Thanks
Devices in the screen?
Gas usage and electric usage so just two big blocks
Can someone please explain
Thanks
-
- Posts: 75
- Joined: Monday 11 November 2013 18:04
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Solved Re: NEW frontpage.html - request comments
SOLVED, replace
/json.htm?type=command¶m=getdevices&plan="+$.roomplan+"&jsoncallback=?
with
/json.htm?type=devices&plan="+$.roomplan
in the html code
After upgrading from the november 2022 to the february 2024 version, none of the values are retrieved anymore. I tried enabling 'allow plain text auth over http', and my LAN ip address range is in the trusted networks. Also the json call to retrieve all devices in the designated roomplan still works when called from a browser, but the fornmtpage.html isnt working anymore and i don't understand where to look further.
/json.htm?type=command¶m=getdevices&plan="+$.roomplan+"&jsoncallback=?
with
/json.htm?type=devices&plan="+$.roomplan
in the html code
After upgrading from the november 2022 to the february 2024 version, none of the values are retrieved anymore. I tried enabling 'allow plain text auth over http', and my LAN ip address range is in the trusted networks. Also the json call to retrieve all devices in the designated roomplan still works when called from a browser, but the fornmtpage.html isnt working anymore and i don't understand where to look further.
Domoticz v 1.16xx
1X RFXtrx433 USB 433.92MHz Transceiver Firmware version: 71
1X Synology Nas DS918+ DSM 7 (12Gb RAM mod)
1X RFXtrx433 USB 433.92MHz Transceiver Firmware version: 71
1X Synology Nas DS918+ DSM 7 (12Gb RAM mod)
Re: NEW frontpage.html - request comments
Hello
I try using custom.html. On my Macbook through Safari or Firefox, this page is visible but no parameters is updated. They are empty.
But using Safari on my iphone or ipad, the page is OK.
I don't understand why...
"http://192.168.-.--:8080/json.htm?type=command¶m=getdevices&plan=9" show a correct JSON.
domoticz on RPI.
I try using custom.html. On my Macbook through Safari or Firefox, this page is visible but no parameters is updated. They are empty.
But using Safari on my iphone or ipad, the page is OK.
I don't understand why...
"http://192.168.-.--:8080/json.htm?type=command¶m=getdevices&plan=9" show a correct JSON.
domoticz on RPI.
- waltervl
- Posts: 5149
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: NEW frontpage.html - request comments
Did you recently change the frontpage to get new API commands?Filnet wrote: ↑Wednesday 13 March 2024 16:41 Hello
I try using custom.html. On my Macbook through Safari or Firefox, this page is visible but no parameters is updated. They are empty.
But using Safari on my iphone or ipad, the page is OK.
I don't understand why...
"http://192.168.-.--:8080/json.htm?type=command¶m=getdevices&plan=9" show a correct JSON.
domoticz on RPI.
Then clear your browser cache. You can also try to connect with a browser session in private/incognito mode.
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
Re: NEW frontpage.html - request comments
thanks for your post.
Cleaning cache on Safari was the solution. (I thought I had doing this yesterday...)
But no action on firefox, parameters leaves empty. Not better with private connection.
Cleaning cache on Safari was the solution. (I thought I had doing this yesterday...)
But no action on firefox, parameters leaves empty. Not better with private connection.
- waltervl
- Posts: 5149
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: NEW frontpage.html - request comments
Then it still seems to be caching issue in Firefox. Clean better....
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
Re: NEW frontpage.html - request comments
I cleaned the cache several times...
I finally found the issue: Firefox had protect the access... Unprotect option for the IP of my domoticz does the job...
Thanks again for your quick help.
I finally found the issue: Firefox had protect the access... Unprotect option for the IP of my domoticz does the job...
Thanks again for your quick help.
-
- Posts: 8
- Joined: Monday 13 February 2023 19:36
- Target OS: Windows
- Domoticz version: 2024.4
- Location: NL (Echtenerbrug)
- Contact:
Re: NEW frontpage.html - request comments
Hallo, I have a problem with my frontpage. I switched from open zwave to zwave-JS. Now my dummy sensors won't show on my frontpage.
If I put this code in at // remove too much text
then it shows all my data of the dummy sensors but the value of my dimmer switches are gone and replaced by Set, and my date and time, only the date is showing not the time anymore
Who has a solution that I can try
Greetings Jan
If I put this code in at // remove too much text
Code: Select all
vdata=new String(vdata).split(" ",1)[0];
Who has a solution that I can try
Greetings Jan
praet mar frysk
- waltervl
- Posts: 5149
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: NEW frontpage.html - request comments
That should not be related. I think you also updated Domoticz to a new version and new Domoticz version have gone through some API changes. See the warning in the wiki https://www.domoticz.com/wiki/Domoticz_ ... d_newer.29
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