Page 3 of 3
Re: Dashticz - v3.4.9 beta
Posted: Sunday 11 October 2020 11:52
by madpatrick
Lokonli wrote: ↑Thursday 28 May 2020 23:26
Something like:
Code: Select all
function getStatus_145(block){
var idx = block.idx;
var device = block.device;
if(parseFloat(device['Data'])>23){
block.addClass='warning';
}
else {
block.addClass='';
}
}
To set the color in the icon part:
Code: Select all
.warning .col-icon {
color: red !important
}
Hi,
Is it possible to get data from 1 block, but change the colour of another block.
What i like to have is a message or color change of a block on the standby screen when a value reached a high value.
Since the standby screen is almost always on you will not see the alarms. Espacially when they are on page 2 or 3
Re: Dashticz - v3.4.9 beta
Posted: Monday 12 October 2020 11:17
by Vomera
madpatrick wrote: ↑Sunday 11 October 2020 11:52
Lokonli wrote: ↑Thursday 28 May 2020 23:26
Something like:
Code: Select all
function getStatus_145(block){
var idx = block.idx;
var device = block.device;
if(parseFloat(device['Data'])>23){
block.addClass='warning';
}
else {
block.addClass='';
}
}
To set the color in the icon part:
Code: Select all
.warning .col-icon {
color: red !important
}
Hi,
Is it possible to get data from 1 block, but change the colour of another block.
What i like to have is a message or color change of a block on the standby screen when a value reached a high value.
Since the standby screen is almost always on you will not see the alarms. Espacially when they are on page 2 or 3
Here is an example i use.
Code: Select all
// geeft regenmelding een kleur op basis van aantal mm per uur
function getStatus_9450(block){
var Data = block.device.Data;
var idx = block.idx;
var device = block.device;
if(parseFloat(Data) > 100){
Dashticz.setBlock('3962', {addClass: 'bovendehonderd'});
}
else if(parseFloat(Data) >10){
Dashticz.setBlock('3962', {addClass: 'tientothonderd'});
}
else if(parseFloat(Data) >5){
Dashticz.setBlock('3962', {addClass: 'vijftottien'});
}
else if(parseFloat(Data) >2){
Dashticz.setBlock('3962', {addClass: 'tweetotvijf'});
}
else if(parseFloat(Data) >0){
Dashticz.setBlock('3962', {addClass: 'nultottwee'});
}
else {
Dashticz.setBlock('3962', {addClass: 'none'});
}
}
Re: Dashticz - v3.4.9 beta
Posted: Monday 12 October 2020 19:08
by madpatrick
Vomera wrote: ↑Monday 12 October 2020 11:17
Here is an example i use.
Thanks. This is working.
I'm trying to make 2 sensors change, but only 1 is changing.
This is what i've tried
Code: Select all
// geeft alarm melding van andere sensor
function getStatus_262(block){
var Data = block.device.Data;
var idx = block.idx;
var device = block.device;
else if(parseFloat(Data) <1.5){
Dashticz.setBlock('regen', {addClass: 'warning'});
Dashticz.setBlock('262', {addClass: 'warning'});
}
else {
Dashticz.setBlock('regen', {addClass: 'none'});
}
}
Re: Dashticz - v3.4.9 beta
Posted: Monday 12 October 2020 20:26
by Vomera
madpatrick wrote: ↑Monday 12 October 2020 19:08
Vomera wrote: ↑Monday 12 October 2020 11:17
Here is an example i use.
Thanks. This is working.
I'm trying to make 2 sensors change, but only 1 is changing.
This is what i've tried
Code: Select all
// geeft alarm melding van andere sensor
function getStatus_262(block){
var Data = block.device.Data;
var idx = block.idx;
var device = block.device;
else if(parseFloat(Data) <1.5){
Dashticz.setBlock('regen', {addClass: 'warning'});
Dashticz.setBlock('262', {addClass: 'warning'});
}
else {
Dashticz.setBlock('regen', {addClass: 'none'});
}
}
And you are sure "regen" and "262" are valid blocks ? maybe you can insert some script from your config.js
Re: Dashticz - v3.4.9 beta
Posted: Monday 12 October 2020 21:10
by Lokonli
madpatrick wrote: ↑Monday 12 October 2020 19:08
Vomera wrote: ↑Monday 12 October 2020 11:17
Here is an example i use.
Thanks. This is working.
I'm trying to make 2 sensors change, but only 1 is changing.
This is what i've tried
Code: Select all
// geeft alarm melding van andere sensor
function getStatus_262(block){
var Data = block.device.Data;
var idx = block.idx;
var device = block.device;
else if(parseFloat(Data) <1.5){
Dashticz.setBlock('regen', {addClass: 'warning'});
Dashticz.setBlock('262', {addClass: 'warning'});
}
else {
Dashticz.setBlock('regen', {addClass: 'none'});
}
}
Your function is not complete. You start with an 'else' statement, but you should start with an 'if' statement.
Further, the getStatus_262 is called when device 262 changes. You can modify this block directly with:
(no need to use the setBlock function)
So, I think you are trying to achieve the following:
Code: Select all
// geeft alarm melding van andere sensor
function getStatus_262(block) {
var Data = block.device.Data;
var idx = block.idx;
var device = block.device;
if(parseFloat(Data) <1.5){
Dashticz.setBlock('regen', {addClass: 'warning'});
block.addClass = 'warning'; // set the addClass parameter for block 262
}
else {
Dashticz.setBlock('regen', {addClass: 'none'});
block.addClass = ''; // reset the addClass parameter for block 262
}
}
Re: Dashticz - v3.4.9 beta
Posted: Tuesday 13 October 2020 12:21
by madpatrick
Thanks guys.
This works !
The else if function was because i deleted some line to make the post smaller
Re: Dashticz - v3.4.9 beta
Posted: Tuesday 13 October 2020 16:48
by madpatrick
Guys,
Need you support again.
When i want to use more sensors in the script, theupdate of block "regen" doesn't work any more.
Only the applicable sensors gets a warning.
Code: Select all
/ geeft alarm melding sensor
function getStatus_262(block) {
var Data = block.device.Data;
var idx = block.idx;
var device = block.device;
if(parseFloat(Data) <1.5){
Dashticz.setBlock('regen', {addClass: 'warning'});
block.addClass = 'warning'; // set the addClass parameter for block 262
}
else {
Dashticz.setBlock('regen', {addClass: 'none'});
block.addClass = ''; // reset the addClass parameter for block 262
}
}
// geeft alarm melding sensor
function getStatus_25(block) {
var Data = block.device.Data;
var idx = block.idx;
var device = block.device;
if(parseFloat(Data) >80){
Dashticz.setBlock('regen', {addClass: 'warning'});
block.addClass = 'warning'; // set the addClass parameter for block
}
else {
Dashticz.setBlock('regen', {addClass: 'none'});
block.addClass = ''; // reset the addClass parameter for block
}
}
The trick is that i want to set this up for a the sensors and when the alarm of one of the is triggered i see this also on the main screen (block "regen")
Re: Dashticz - v3.4.9 beta
Posted: Tuesday 13 October 2020 17:40
by Lokonli
madpatrick wrote: ↑Tuesday 13 October 2020 16:48
Guys,
Need you support again.
When i want to use more sensors in the script, theupdate of block "regen" doesn't work any more.
Only the applicable sensors gets a warning.
Code: Select all
/ geeft alarm melding sensor
function getStatus_262(block) {
var Data = block.device.Data;
var idx = block.idx;
var device = block.device;
if(parseFloat(Data) <1.5){
Dashticz.setBlock('regen', {addClass: 'warning'});
block.addClass = 'warning'; // set the addClass parameter for block 262
}
else {
Dashticz.setBlock('regen', {addClass: 'none'});
block.addClass = ''; // reset the addClass parameter for block 262
}
}
// geeft alarm melding sensor
function getStatus_25(block) {
var Data = block.device.Data;
var idx = block.idx;
var device = block.device;
if(parseFloat(Data) >80){
Dashticz.setBlock('regen', {addClass: 'warning'});
block.addClass = 'warning'; // set the addClass parameter for block
}
else {
Dashticz.setBlock('regen', {addClass: 'none'});
block.addClass = ''; // reset the addClass parameter for block
}
}
The trick is that i want to set this up for a the sensors and when the alarm of one of the is triggered i see this also on the main screen (block "regen")
I think I would approach it as follows:
Code: Select all
// geeft alarm melding sensor
var trigger_262 = false;
var trigger_25 = false;
function handleRegen() {
if (trigger_262 || trigger_25)
Dashticz.setBlock('regen', { addClass: 'warning' });
else
Dashticz.setBlock('regen', { addClass: '' });
}
function getStatus_262(block) {
var Data = block.device.Data;
var idx = block.idx;
var device = block.device;
if (parseFloat(Data) < 1.5) {
trigger_262 = true;
block.addClass = 'warning'; // set the addClass parameter for block 262
}
else {
trigger_262 = false;
block.addClass = ''; // reset the addClass parameter for block 262
}
handleRegen();
}
// geeft alarm melding sensor
function getStatus_25(block) {
var Data = block.device.Data;
var idx = block.idx;
var device = block.device;
if (parseFloat(Data) > 80) {
trigger_25 = true;
block.addClass = 'warning'; // set the addClass parameter for block
}
else {
trigger_25 = false;
block.addClass = ''; // reset the addClass parameter for block
}
handleRegen();
}
Re: Dashticz - v3.4.9 beta
Posted: Tuesday 13 October 2020 18:57
by madpatrick
Lokonli wrote: ↑Tuesday 13 October 2020 17:40
I think I would approach it as follows:
Many thanks Lokonli !!
Added 10 sensors with the script
Re: Dashticz - v3.4.9 beta
Posted: Saturday 31 October 2020 16:21
by madpatrick
Hi
Is it also possible to get a sound when the warning is triggered ?
The speech function is not working on my tablet (
viewtopic.php?t=20426)
Re: Dashticz - v3.4.9 beta
Posted: Saturday 31 October 2020 16:52
by Lokonli
Do you have an Android tablet? Did you install Google speech synthesis engine, and set it as default?
You can use the playsound block parameters to play a sound.
See:
https://dashticz.readthedocs.io/en/mast ... parameters
Re: Dashticz - v3.4.9 beta
Posted: Saturday 31 October 2020 19:11
by madpatrick
Hi Lokonli,
Yes. It is an Android tablet.
I've found out that it is related to Fully Kiosk browser app.
When i'm using the chrome browser it is working
Re: Dashticz - v3.4.9 beta
Posted: Saturday 07 November 2020 13:35
by madpatrick
I know you play a sound when you click on a block, but is it possible when the warning gets trigger via custom.js
Code: Select all
function handleMessage() {
if (trigger_182 && trigger_188)
Dashticz.setBlock('emptyblock1', { addClass: 'message4' });
else if (trigger_182)
Dashticz.setBlock('emptyblock1', { addClass: 'message2' });
else if (trigger_188)
Dashticz.setBlock('emptyblock1', { addClass: 'message3' });
else
Dashticz.setBlock('emptyblock1', { addClass: '' });
}