Violation errors console
Moderators: leecollings, htilburgs, robgeerts
-
- Posts: 75
- Joined: Friday 08 January 2016 10:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Nederland
- Contact:
Violation errors console
My Dashticz is very slow since a few weeks. I run it on a newly Samsung Tablet. Clickinh on a button takes seconds before Domoticz notice it.
Websocket is working, so that's not the problem.
When I open Dashticz on my pc, I'm getting a lot of "Violation" messages in the console of Chrome and I tink thats yhe reason of the slow tablet.
Anybody any idea what the "Violation" messages might be?
Websocket is working, so that's not the problem.
When I open Dashticz on my pc, I'm getting a lot of "Violation" messages in the console of Chrome and I tink thats yhe reason of the slow tablet.
Anybody any idea what the "Violation" messages might be?
- gizmocuz
- Posts: 2481
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: Violation errors console
"My Dashticz is very slow since a few weeks. I run it on a newly Samsung Tablet"
Okey, are you able to run it on the thing you previously used to see if that is faster?
Okey, are you able to run it on the thing you previously used to see if that is faster?
Quality outlives Quantity!
-
- Posts: 75
- Joined: Friday 08 January 2016 10:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Nederland
- Contact:
Re: Violation errors console
Thanks for you reply.
I have the tablet Samsung Tab A8 for about 3 months. In the beginning it was really fast.
As I said, the errors are in Chrome on a Windos PC. I have a lot of them. Domoticz itself runs on an Rasp4.
I have the tablet Samsung Tab A8 for about 3 months. In the beginning it was really fast.
As I said, the errors are in Chrome on a Windos PC. I have a lot of them. Domoticz itself runs on an Rasp4.
-
- Posts: 2287
- Joined: Monday 29 August 2016 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Violation errors console
Maybe first try with a dashboard that only contains one switch, without custom.js and check whether that performs normally.
You can create a new config file, for instance test.js, and load it with /?cfg=test.js
If Dashticz has good performance with the test config file, switch back to your current config and check the following :
Did you configure a block with a low refresh value?
Any functionality in custom.js that may make things slowly? (post it here)
Verzonden vanaf mijn iPhone met Tapatalk
You can create a new config file, for instance test.js, and load it with /?cfg=test.js
If Dashticz has good performance with the test config file, switch back to your current config and check the following :
Did you configure a block with a low refresh value?
Any functionality in custom.js that may make things slowly? (post it here)
Verzonden vanaf mijn iPhone met Tapatalk
-
- Posts: 75
- Joined: Friday 08 January 2016 10:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Nederland
- Contact:
Re: Violation errors console
I think I found the problem. It is what you suggested a custom.js problem. I will display and hide blocks depending of the status and combination of the statuses of other blocks. Therefor I use the function "afterGetDevices()". When I delete this function with all the checks from my custom.js the errors are gone.
For example, if the radio is turned on, it shows me the "radio-blocks" and if the radio is off and the tv is on then it shows the "TV-blocks". See below:
I've attached the custom.js also. Hopefully there is a better way to show and hide these blocks?
Thanks in forward.
For example, if the radio is turned on, it shows me the "radio-blocks" and if the radio is off and the tv is on then it shows the "TV-blocks". See below:
I've attached the custom.js also. Hopefully there is a better way to show and hide these blocks?
Thanks in forward.
- Attachments
-
- custom.js
- (88.46 KiB) Downloaded 49 times
-
- Posts: 2287
- Joined: Monday 29 August 2016 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Violation errors console
Impressive size of custom.js, especially the afterGetDevices function...
Remember, this function is called at every device change.
That also means a lot of classes are added or removed at every device change.
I can imagine this will make Dashticz somewhat slow.
To make Dashticz faster you could use the deviceHook functionality:
There you know which device is changing, and you only need to update the blocks that depend on this.
I see you make use of a lot of Jquery selections ($) that include wildcards (*). These functions are also expensive. Probably there are ways to make this more efficient.
Some ideas:
Line 4:
can probably be replaced with:
Further, it seems you want to bring a set of blocks to the same state: hidden or visible for instance.
Instead of add classes to every block every time, you could set a css parameter, and make use of that parameter in the css class definitions.
For instance, in custom.css add:
In CONFIG.js add this class to every block that should follow this tvstatus:
Then you can set the tvstatus css variable via the deviceHook function:
This will make run Dashticz much faster.
Remember, this function is called at every device change.
That also means a lot of classes are added or removed at every device change.
I can imagine this will make Dashticz somewhat slow.
To make Dashticz faster you could use the deviceHook functionality:
There you know which device is changing, and you only need to update the blocks that depend on this.
I see you make use of a lot of Jquery selections ($) that include wildcards (*). These functions are also expensive. Probably there are ways to make this more efficient.
Some ideas:
Line 4:
Code: Select all
$('div[data-screenindex="1"] div[class*="block_tv_woonkamer_selectie_input"]').addClass('displaynone');
Code: Select all
$('.block_tv_woonkamer_selectie_input').addClass('displaynone');
Instead of add classes to every block every time, you could set a css parameter, and make use of that parameter in the css class definitions.
For instance, in custom.css add:
Code: Select all
.tvstatus {
display: var(--tvstatus)
}
Code: Select all
blocks["tv_woonkamer_selectie_input"] = {
...
addClass: 'tvstatus',
...
}
Code: Select all
function deviceHook(device) {
if (device.idx == 2628 || device.idx == 2630) setTVStatus(device);
}
function setTVStatus(device) {
var device2628=Domoticz.getAllDevices()[2628] || {};
var device2630=Domoticz.getAllDevices()[2630] || {};
if (device.idx==2628) device2628=device;
if (device.idx==2630) device2630=device;
var css_tvstatus='unset';
if (device2628.Data=='On') css_tvstatus='none';
$(':root').css('--tvstatus', css_tvstatus);
}
-
- Posts: 75
- Joined: Friday 08 January 2016 10:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Nederland
- Contact:
Re: Violation errors console
Thanks a lot. I tried it and it works great. I have some work to do
.
One question. Is it also possible, for example, to greyed out the underlying col-data of a block? See picture below:
Thank for your great effort.

One question. Is it also possible, for example, to greyed out the underlying col-data of a block? See picture below:
Thank for your great effort.
-
- Posts: 2287
- Joined: Monday 29 August 2016 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Violation errors console
Everything is possiblemichelscholte wrote: ↑Saturday 30 December 2023 19:22 Thanks a lot. I tried it and it works great. I have some work to do.
One question. Is it also possible, for example, to greyed out the underlying col-data of a block? See picture below:
tv2.JPG
Thank for your great effort.

However, I don't understand your question.
'Zender' is a selector switch I guess. Can you post the block definition?
You want to have it greyed out? It look greyed out already... (The selection box with 'Selecteer' inside)
-
- Posts: 75
- Joined: Friday 08 January 2016 10:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Nederland
- Contact:
Re: Violation errors console
"Zender" is a selector switch indeed. I want to greyed out it (opacity: 0.4) if the "Input" switch is not TV (in the screendump, for example "Netflix" is selected).
I don't want to greyed out (opacity: 0.4) the block itself, but only col-data.
What you see is exactly what I want but I have to reconfigure it, to reduce the afterGetDevices function.
I don't want to greyed out (opacity: 0.4) the block itself, but only col-data.
What you see is exactly what I want but I have to reconfigure it, to reduce the afterGetDevices function.
-
- Posts: 2287
- Joined: Monday 29 August 2016 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Violation errors console
Several ways ...
I would adapt the deviceHook function:
and in custom.css:
I would adapt the deviceHook function:
Code: Select all
function deviceHook(device) {
if (device.idx == 2628 || device.idx == 2630) setTVStatus(device);
//start of change
if (device.idx == 2630)
if (device.Level == 0) //check your device idx and device level for TV
Domoticz.setBlock('tv_woonkamer_selectie_zender', {addClass: ''}); //normal input selection
else Domoticz.setBlock('tv_woonkamer_selectie_zender', {addClass: 'datagrayedout'}); //input selection should be grayed
//end of change
}
Code: Select all
.datagrayedout .col-data {
opacity: 0.4;
}
Who is online
Users browsing this forum: No registered users and 0 guests