Dashticz - Feature Requests

Moderators: leecollings, htilburgs, robgeerts

User avatar
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

Post by EdwinK »

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).
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
lzwfkv
Posts: 37
Joined: Sunday 11 August 2019 16:54
Target OS: -
Domoticz version:
Contact:

Re: Dashticz - Feature Requests

Post by lzwfkv »

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).
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.):
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');
}
}
User avatar
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

Post by EdwinK »

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
User avatar
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

Post by EdwinK »

Added above code to dashboard, and the icon changes colour when there is an alert, but it doesn't give the reason any more.
Screen Shot 2019-12-29 at 10.15.24.png
Screen Shot 2019-12-29 at 10.15.24.png (13.42 KiB) Viewed 3376 times
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
User avatar
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

Post by clinkadink »

EdwinK wrote: Sunday 29 December 2019 10:16 Added above code to dashboard, and the icon changes colour when there is an alert, but it doesn't give the reason any more.

Screen Shot 2019-12-29 at 10.15.24.png
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."
User avatar
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

Post by EdwinK »

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
lzwfkv
Posts: 37
Joined: Sunday 11 August 2019 16:54
Target OS: -
Domoticz version:
Contact:

Re: Dashticz - Feature Requests

Post by lzwfkv »

EdwinK wrote: Sunday 29 December 2019 10:16 Added above code to dashboard, and the icon changes colour when there is an alert, but it doesn't give the reason any more.

Screen Shot 2019-12-29 at 10.15.24.png
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.
User avatar
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

Post by EdwinK »

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
janumix
Posts: 21
Joined: Wednesday 06 November 2019 15:32
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz - Feature Requests

Post by janumix »

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 ?
Lokonli
Posts: 2260
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz - Feature Requests

Post by Lokonli »

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 ?
I think it's a cross-origin issue. As a workaround you could try to use the following url:

Code: Select all

'./vendor/dashticz/nocache.php?https://user:apssword@<IP>
janumix
Posts: 21
Joined: Wednesday 06 November 2019 15:32
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz - Feature Requests

Post by janumix »

Thanks !
In 'btnimage' works good.
In 'url' it doesn't seem so.

BR
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: Dashticz - Feature Requests

Post by dannybloe »

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
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
Locked

Who is online

Users browsing this forum: No registered users and 0 guests