Dashticz - Function - Trigger action on specific value

Dashticz, alternative dashboard based on HTML, CSS, jQuery

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 - Function - Trigger action on specific value

Post by EdwinK »

I use idx 'XX_1' for the first and 'XX_2' for the second
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
User avatar
htilburgs
Posts: 464
Joined: Tuesday 03 November 2015 11:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Dashticz - Function - Trigger action on specific value

Post by htilburgs »

Can you try changing Data into Temp (in your Config.js code)?
Hardware:
RPi3 - Aeon Labs Z-Stick GEN5 - Fibaro Dimmer 2 - Fibaro Roller Shutter 2 - Fibaro Smoke Sensor - Yeelight RGBW Led bulb - Yeelight Smart LED Light Strip - Neo Coolcam PIR Motion Sensor - Neo Coolcam PowerPlug - Nest Thermostat v3
woody4165
Posts: 476
Joined: Monday 14 March 2016 13:55
Target OS: Linux
Domoticz version: beta
Location: Rome, Italy
Contact:

Re: Dashticz - Function - Trigger action on specific value

Post by woody4165 »

Hi

This is a very powerful feature, just discovering.

I would like to color the Netatmo Thermostat SetPoint when boiler is on, so when SetPoint Temp is higher than Temp measured by sensor.

The two values are a different.

From SetPoint I can use
"Data" : "18.0",
"SetPoint" : "18.0",

From Sensor I can use
"Data" : "23.2 C",
"Temp" : 23.199999999999999,

What kind of comparison I can use ?
I'm a little bit confused...

Thanks
Cubietruck - Linux cubietruck 4.13.16 (Debian GNU/Linux 8 (jessie)) + Domoticz + RFLink, Xiaomi Gateway, Owl USB, Yeelight Color and B/W, ESP8266, Broadlink RM2, Netatmo Thermostat
Wob76
Posts: 110
Joined: Wednesday 19 April 2017 6:31
Target OS: Linux
Domoticz version:
Contact:

Re: Dashticz - Function - Trigger action on specific value

Post by Wob76 »

Hi,

Just wondering if it is possible to use getstatus to monitor a User Variable from Domoticz? I am using a few User Variables in scripts and would like to colour some tiles based on those variables status, if not I'll have look at incorporating some switches into the scripts.

Thanks,
Wob
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: Dashticz - Function - Trigger action on specific value

Post by robgeerts »

I think you need switches with the value of the user-variable.
BUT, I think you can hide these switches so you wont see them ;)
Something like (if the switch you want to check is 1 and block you want to colour is idx 2)

Code: Select all

function getStatus_1(idx,value,device){
	$('div.block_1').hide();
		if(device['Data']=='somevalue'){
			$('div.block_2').addClass('warning');
		}
		else {
			$('div.block_2').removeClass('warning');
		}
	
}
Wob76
Posts: 110
Joined: Wednesday 19 April 2017 6:31
Target OS: Linux
Domoticz version:
Contact:

Re: Dashticz - Function - Trigger action on specific value

Post by Wob76 »

Thanks, I thought that might be the case, I have plenty of other hidden switches :) and the user variable is just a 0/1 state, so easy enough to change it to use switches.
Wob76
Posts: 110
Joined: Wednesday 19 April 2017 6:31
Target OS: Linux
Domoticz version:
Contact:

Re: Dashticz - Function - Trigger action on specific value

Post by Wob76 »

Ok, my problem now is that I want to have the switch hidden in Domoticz, so prefix it with a $, but it seems these switches are filtered upstream somewhere and will not show in Dashticz, is there a way to have it hidden in both interfaces?
User avatar
DewGew
Posts: 581
Joined: Thursday 21 April 2016 12:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10618
Location: Sweden
Contact:

Re: Dashticz - Function - Trigger action on specific value

Post by DewGew »

Wob76 wrote: Tuesday 09 January 2018 6:18 Ok, my problem now is that I want to have the switch hidden in Domoticz, so prefix it with a $, but it seems these switches are filtered upstream somewhere and will not show in Dashticz, is there a way to have it hidden in both interfaces?
I place my hidden devices in a hidden room also. Now you can only find theese device under settings/devices and room manager. You create hidden room with name starts with $ (eg. $roomtohide).
Raspberry Pi 3 | domoticz | Aeon Labs Z-Stick GEN5 | RFlink gateway
NanoPi NEO-air | REGO6XX interface | Machinon theme | Homebridge | Domoticz Google Assistant | ideAlarm
Wob76
Posts: 110
Joined: Wednesday 19 April 2017 6:31
Target OS: Linux
Domoticz version:
Contact:

Re: Dashticz - Function - Trigger action on specific value

Post by Wob76 »

Thanks for the tip, I have done that in past, but for some reason Domoticz is no longer hiding devices in hidden rooms from my All tab, I'll have to investigate.

Update:
Maybe a bug in the beta versions of Domoticz, and new room I create with a $ doesn't seem to work, devices in those rooms still show in the All Room, I have a few old ones that seem to work, but only for the devices already in there, if I add a new device to one it still shows in All. :(

I tried adding the devices into "$Hidden Devices" and removing the $ from the name, but again they are filtered from Dashticz,the above code works if I move it out of $Hidden Devices, But I do have to have the switch configured for a row and then hide it.
t3v3h
Posts: 14
Joined: Tuesday 06 August 2019 9:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz - Function - Trigger action on specific value

Post by t3v3h »

Hi Guys,

I would liket to change the color of the icon with this method, but I cannpot figure out what to put in css...
this one is not working:

.warning {
.fas.fa-sun {color:orange;}
}

Any idea?

Thanks,
t
Lokonli
Posts: 2290
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz - Function - Trigger action on specific value

Post by Lokonli »

If you just want to change the color of the sun icon, then the following should work:

Code: Select all

.fa-sun {color:orange !important;}
}
if you want to change the icon color depending on the state of a switch, have a look here:
https://dashticz.readthedocs.io/en/late ... icz-switch

If you want to change the icon depending on the value of a device, first have a look here:
https://dashticz.readthedocs.io/en/late ... lue-device

Attach a class (for instance warning) to a whole block via the getStatus_xxx function in custom.js, and use a class selector in custom.css to change the color of the item you want to change. Something like:

Code: Select all

.warning .col-icon {
   color: orange !important
}
t3v3h
Posts: 14
Joined: Tuesday 06 August 2019 9:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz - Function - Trigger action on specific value

Post by t3v3h »

Lokonli wrote: Tuesday 06 August 2019 14:53
Attach a class (for instance warning) to a whole block via the getStatus_xxx function in custom.js, and use a class selector in custom.css to change the color of the item you want to change. Something like:

Code: Select all

.warning .col-icon {
   color: orange !important
}
Great, thanks a lot!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest