Dashticz - Feature Requests
Moderators: leecollings, htilburgs, robgeerts
- EdwinK
- Posts: 1820
- Joined: Sunday 22 January 2017 21:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Rhoon
- Contact:
Re: Dashticz - Feature Requests
I've got the EU meteoalarm plugin for Domoticz running (https://www.domoticz.com/forum/viewtopi ... 65&t=19519). Is it possible to change the icon colours depending on the alert?
For example: green if there is no alert to red for a severe alert (maybe something in between for moderate alerts.
(I believe there is some sort of level in the RSS feed (level:1 through level:4).
For example: green if there is no alert to red for a severe alert (maybe something in between for moderate alerts.
(I believe there is some sort of level in the RSS feed (level:1 through level:4).
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
Re: Dashticz - Feature Requests
You can do it with custom.css and custom.js, e.g. for changing alert icon colors dynamically (you can do likewise for other attributes: fonts, block color, etc.):EdwinK wrote: ↑Monday 02 December 2019 13:03 I've got the EU meteoalarm plugin for Domoticz running (https://www.domoticz.com/forum/viewtopi ... 65&t=19519). Is it possible to change the icon colours depending on the alert?
For example: green if there is no alert to red for a severe alert (maybe something in between for moderate alerts.
(I believe there is some sort of level in the RSS feed (level:1 through level:4).
Assumptions:
today alert IDX in Domoticz=115 (find your own IDX and replace in the code below)
tomorrow alert IDX in Domoticz=116 (find your own IDX and replace in the code below)
Level grades (as defined in Domoticz): Level 1 - normal (no alert, GREEN), Level 2 - Light warning (YELLOW), Level 3 - Warning (ORANGE), Level 4 - Critical (RED).
custom.css:
.alertnormal .col-icon {
color: green !important;
}
.alertlight .col-icon {
color: yellow !important;
}
.alertmedium .col-icon {
color: orange !important;
}
.alerthigh .col-icon {
color: red !important;
}
custom.js:
function getStatus_115(idx,value,device) {
if(device['Level']==1) {
$('div.block_115').addClass('alertnormal');
$('div.block_115').removeClass('alertmedium');
$('div.block_115').removeClass('alerthigh');
$('div.block_115').removeClass('alertlight');
}
else if (device['Level']==2) {
$('div.block_115').addClass('alertlight');
$('div.block_115').removeClass('alertmedium');
$('div.block_115').removeClass('alertnormal');
$('div.block_115').removeClass('alerthigh');
}
else if (device['Level']==3) {
$('div.block_115').addClass('alertmedium');
$('div.block_115').removeClass('alertnormal');
$('div.block_115').removeClass('alerthigh');
$('div.block_115').removeClass('alertlight');
}
else {
$('div.block_115').addClass('alerthigh');
$('div.block_115').removeClass('alertnormal');
$('div.block_115').removeClass('alertmedium');
$('div.block_115').removeClass('alertlight');
}
}
function getStatus_116(idx,value,device) {
if(device['Level']==1) {
$('div.block_116').addClass('alertnormal');
$('div.block_116').removeClass('alertmedium');
$('div.block_116').removeClass('alerthigh');
$('div.block_116').removeClass('alertlight');
}
else if (device['Level']==2) {
$('div.block_116').addClass('alertlight');
$('div.block_116').removeClass('alertmedium');
$('div.block_116').removeClass('alertnormal');
$('div.block_116').removeClass('alerthigh');
}
else if (device['Level']==3) {
$('div.block_116').addClass('alertmedium');
$('div.block_116').removeClass('alertnormal');
$('div.block_116').removeClass('alerthigh');
$('div.block_116').removeClass('alertlight');
}
else {
$('div.block_116').addClass('alerthigh');
$('div.block_116').removeClass('alertnormal');
$('div.block_116').removeClass('alertmedium');
$('div.block_116').removeClass('alertlight');
}
}
- EdwinK
- Posts: 1820
- Joined: Sunday 22 January 2017 21:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Rhoon
- Contact:
Re: Dashticz - Feature Requests
Thanks. Going to add this to my dashboard
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
- EdwinK
- Posts: 1820
- Joined: Sunday 22 January 2017 21:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Rhoon
- Contact:
Re: Dashticz - Feature Requests
Added above code to dashboard, and the icon changes colour when there is an alert, but it doesn't give the reason any more.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
- clinkadink
- Posts: 417
- Joined: Tuesday 31 December 2019 1:15
- Target OS: Linux
- Domoticz version: 2020.2
- Location: Swindon, UK
- Contact:
Re: Dashticz - Feature Requests
Looks like the same value is being set to both fields (title and state).
Btw, you can daisy chain jquery, and add/remove multiple classes at the same time. It is down to user preference at the end of the day
Code: Select all
switch (device['Level']) {
case 1:
$('div.block_116').addClass('alertnormal').removeClass('alertmedium alerthigh alertlight');
break;
case 2:
$('div.block_116').addClass('alertlight').removeClass('alertmedium alertnormal alerthigh');
break;
case 3:
$('div.block_116').addClass('alertmedium').removeClass('alertnormal alerthigh alertlight')
break;
default:
$('div.block_116').addClass('alerthigh').removeClass('alertnormal alertmedium alertlight')
}
"UI is the saddle, the stirrups, & the reins. UX is the feeling you get being able to ride the horse."
- EdwinK
- Posts: 1820
- Joined: Sunday 22 January 2017 21:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Rhoon
- Contact:
Re: Dashticz - Feature Requests
Thanks. Going to work on this.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
Re: Dashticz - Feature Requests
Hi Edwin, this behaviour shuldn't be related to the css styles which do not touch the data section of the block at all. Have you, i some way, redefined the "Title" of the Alert block (e.g. blocks[xxx]['title']='MeteoAlarmEU" in CONFIG.js? If so, please comment the line where you defined the title and try to refresh dashticz page and see the results. I suspect it is due to the strange way the "Alert" blocks are defined in Dashticz code which is different from all the other blocks definitions, where Title and Value variables of the block are upside-down, i.e. Title=<Data>, Value=<Name>.
In particular, in blocks.js code you can find this definition:
blocktypes.SubType['Alert'] = {
icon: 'fas fa-warning',
title: '<Data>',
value: '<Name>'
};
And i have overriden it in custom.js with this one:
function getExtendedBlockTypes(blocktypes){
blocktypes.SubType['Alert'] = {icon: 'fas fa-exclamation-triangle', title: '<Name>', value: '<Data>'};
return blocktypes;
}
(Note: the 'fas fa-warning' icon is not recognized by fontawesome so it is empty, then i redefined it as well)
that should be more starightforward and, most important, lets you redefine the "Title" field without impacting the device' State/Value, as it should be allowed in Dashticz.
- EdwinK
- Posts: 1820
- Joined: Sunday 22 January 2017 21:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: BETA
- Location: Rhoon
- Contact:
Re: Dashticz - Feature Requests
thank. I'll have a try later today
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
-
- Posts: 21
- Joined: Wednesday 06 November 2019 15:32
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Dashticz - Feature Requests
Hi
It'd be nice to have an option to enter credentials in URL i.e. https://user:apssword@<IP> to use in buttons.
I tried several ways to enter login/pass in URL to access camera but all the time it failed (URL and camera tested in browser i.e. chrome and I'm sure it works).
How about it ?
It'd be nice to have an option to enter credentials in URL i.e. https://user:apssword@<IP> to use in buttons.
I tried several ways to enter login/pass in URL to access camera but all the time it failed (URL and camera tested in browser i.e. chrome and I'm sure it works).
How about it ?
-
- Posts: 2260
- Joined: Monday 29 August 2016 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Dashticz - Feature Requests
I think it's a cross-origin issue. As a workaround you could try to use the following url:janumix wrote: ↑Friday 17 January 2020 19:26 Hi
It'd be nice to have an option to enter credentials in URL i.e. https://user:apssword@<IP> to use in buttons.
I tried several ways to enter login/pass in URL to access camera but all the time it failed (URL and camera tested in browser i.e. chrome and I'm sure it works).
How about it ?
Code: Select all
'./vendor/dashticz/nocache.php?https://user:apssword@<IP>
-
- Posts: 21
- Joined: Wednesday 06 November 2019 15:32
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Dashticz - Feature Requests
Thanks !
In 'btnimage' works good.
In 'url' it doesn't seem so.
BR
In 'btnimage' works good.
In 'url' it doesn't seem so.
BR
-
- Posts: 1355
- Joined: Friday 29 August 2014 11:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Ermelo
- Contact:
Re: Dashticz - Feature Requests
Peeps, there's a new sub forum for feature request. Let's use that one from now on. This topic will be locked.
Cheers,
Danny
Cheers,
Danny
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
Who is online
Users browsing this forum: No registered users and 1 guest