How to change the value of a device? Topic is solved

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

Post Reply
TroisSix
Posts: 92
Joined: Monday 11 January 2016 9:29
Target OS: -
Domoticz version: 2022.2
Location: France
Contact:

How to change the value of a device?

Post by TroisSix »

Hi huys,

I have some shutters (blinds) and I would like to change the value displayed cause it's in uppercase.
I tried the textOn/textOff but it's not working.
I tried the custom.js with function getStatus_MyBlind(block), and I can change the title (with block.title=), but how to change the value?

Thanks for your help ;)
Last edited by TroisSix on Monday 08 March 2021 18:28, edited 1 time in total.
VM Debian - Domoticz stable v2024.7, RFXtrx433, Aeotec Z-Stick Gen5, Two APC
- rts: dio, oregon, somfy
- zwave: fibaro fgs212, aeotec smart switch, vision ZG8101
- IO Homecontrol: Velux Connexoon
- logitech harmony hub, philips hue, Pilot app.
Lokonli
Posts: 2290
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to change the value of a device?

Post by Lokonli »

TroisSix wrote: Friday 05 March 2021 17:53 Hi huys,

I have some shutters (blinds) and I would like to change the value displayed cause it's in uppercase.
I tried the textOn/textOff but it's not working.
I tried the custom.js with function getStatus_MyBlind(block), and I can change the title (with block.title=), but how to change the value?

Thanks for your help ;)
It was hardcoded as ON and OFF (translated according your language setting).

I've just changed in latest beta that the textOn/textOff parameters can be used. Can you test?
TroisSix
Posts: 92
Joined: Monday 11 January 2016 9:29
Target OS: -
Domoticz version: 2022.2
Location: France
Contact:

Re: How to change the value of a device?

Post by TroisSix »

Ok I will search a way to upgrade from the master to the beta, and come back to you, thanks ;-)
Edit: is that enough to upgrade from master to beta: (with a copy of the config js and co) ?

Code: Select all

. <(wget -qO - https://raw.githubusercontent.com/Dashticz/dashticz/beta/scripts/dashticz_install.sh )
and is there a way to hide a block? cause I discovered that I need some buttons for the js and change the colors of other blocks, but I don't want to display these ones.
VM Debian - Domoticz stable v2024.7, RFXtrx433, Aeotec Z-Stick Gen5, Two APC
- rts: dio, oregon, somfy
- zwave: fibaro fgs212, aeotec smart switch, vision ZG8101
- IO Homecontrol: Velux Connexoon
- logitech harmony hub, philips hue, Pilot app.
Lokonli
Posts: 2290
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to change the value of a device?

Post by Lokonli »

TroisSix wrote: Friday 05 March 2021 22:25 Ok I will search a way to upgrade from the master to the beta, and come back to you, thanks ;-)
Edit: is that enough to upgrade from master to beta: (with a copy of the config js and co) ?

Code: Select all

. <(wget -qO - https://raw.githubusercontent.com/Dashticz/dashticz/beta/scripts/dashticz_install.sh )
and is there a way to hide a block? cause I discovered that I need some buttons for the js and change the colors of other blocks, but I don't want to display these ones.
To be able to recover from mistakes, make a copy of CONFIG.js, custom.css and custom.js.

Then, normally the following should be sufficient to switch to beta:

Code: Select all

git checkout beta
Update to latest version with:

Code: Select all

git pull
If git reports errors, then check this first:
https://dashticz.readthedocs.io/en/beta ... 27-12-2020
TroisSix
Posts: 92
Joined: Monday 11 January 2016 9:29
Target OS: -
Domoticz version: 2022.2
Location: France
Contact:

Re: How to change the value of a device?

Post by TroisSix »

Hi
I removed the master version in /home/pi/dev/dashticz, and installed the beta with :

Code: Select all

 git clone https://github.com/Dashticz/dashticz dashticz --branch beta
 cd dashticz/
 git pull
 sudo apt-get update
 sudo apt-get install apache2 php php-xml php-curl libapache2-mod-php
 sudo systemctl restart apache2
 sudo ln -s /home/pi/dashticz/ /var/www/html
 chmod -R a+rX /home/pi/dashticz
 sudo a2enmod php7.3
 sudo systemctl restart apache2
My dashticz is not working anymore, it displays "Dashticz v3 is loading..." and I don't know where to search :o

Edit: I was trying to reach dashticz on the port 8082, it was simply the port 80... I continue my tests :arrow:
VM Debian - Domoticz stable v2024.7, RFXtrx433, Aeotec Z-Stick Gen5, Two APC
- rts: dio, oregon, somfy
- zwave: fibaro fgs212, aeotec smart switch, vision ZG8101
- IO Homecontrol: Velux Connexoon
- logitech harmony hub, philips hue, Pilot app.
TroisSix
Posts: 92
Joined: Monday 11 January 2016 9:29
Target OS: -
Domoticz version: 2022.2
Location: France
Contact:

Re: How to change the value of a device?

Post by TroisSix »

@Lokonli
So I confirm the textOn/textOff is working fine with the latest beta: I can specify the text I want even for my blinds, great guys ;)

Is there also a way to modify this state of another block within a function function getStatus_MyBlock(block)?
Dashticz.setBlock('AnotherBlind', {title: 'New title'}); is working to update the title of the blind, but what's the way to modify its data/value/state?
VM Debian - Domoticz stable v2024.7, RFXtrx433, Aeotec Z-Stick Gen5, Two APC
- rts: dio, oregon, somfy
- zwave: fibaro fgs212, aeotec smart switch, vision ZG8101
- IO Homecontrol: Velux Connexoon
- logitech harmony hub, philips hue, Pilot app.
Lokonli
Posts: 2290
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to change the value of a device?

Post by Lokonli »

TroisSix wrote:@Lokonli
So I confirm the textOn/textOff is working fine with the latest beta: I can specify the text I want even for my blinds, great guys ;)

Is there also a way to modify this state of another block within a function function getStatus_MyBlock(block)?
Dashticz.setBlock('AnotherBlind', {title: 'New title'}); is working to update the title of the blind, but what's the way to modify its data/value/state?
You could set the value parameter via the setBlock function.

Can you describe in more detail what you try to achieve?

Sent from my SM-A320FL using Tapatalk

TroisSix
Posts: 92
Joined: Monday 11 January 2016 9:29
Target OS: -
Domoticz version: 2022.2
Location: France
Contact:

Re: How to change the value of a device?

Post by TroisSix »

I would like to do something like:
Dashticz.setBlock('AnotherBlind', {value: 'Opened 80%'})
VM Debian - Domoticz stable v2024.7, RFXtrx433, Aeotec Z-Stick Gen5, Two APC
- rts: dio, oregon, somfy
- zwave: fibaro fgs212, aeotec smart switch, vision ZG8101
- IO Homecontrol: Velux Connexoon
- logitech harmony hub, philips hue, Pilot app.
TroisSix
Posts: 92
Joined: Monday 11 January 2016 9:29
Target OS: -
Domoticz version: 2022.2
Location: France
Contact:

Re: How to change the value of a device?

Post by TroisSix »

I reply to myself, to change the value of a device, we have to change the value displayed in textOn/textOff, nothing else to do.

@Lokonli
Is it possible to change an image the same way?
I tried a

Code: Select all

Dashticz.setBlock('shutter', {imageOn: 'personal/shutter_mi_opened.png'});
but it's not working :?
VM Debian - Domoticz stable v2024.7, RFXtrx433, Aeotec Z-Stick Gen5, Two APC
- rts: dio, oregon, somfy
- zwave: fibaro fgs212, aeotec smart switch, vision ZG8101
- IO Homecontrol: Velux Connexoon
- logitech harmony hub, philips hue, Pilot app.
Lokonli
Posts: 2290
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to change the value of a device?

Post by Lokonli »

It should work like that, but I did not test this for blinds.

Is your image in the folder 'image/personal/'?
Does it work for regular switches?

Sent from my SM-A320FL using Tapatalk

TroisSix
Posts: 92
Joined: Monday 11 January 2016 9:29
Target OS: -
Domoticz version: 2022.2
Location: France
Contact:

Re: How to change the value of a device?

Post by TroisSix »

My images are in img/perso/ yes. I tried with and without the /img
Ok, I will test it with some regular switches 😉
VM Debian - Domoticz stable v2024.7, RFXtrx433, Aeotec Z-Stick Gen5, Two APC
- rts: dio, oregon, somfy
- zwave: fibaro fgs212, aeotec smart switch, vision ZG8101
- IO Homecontrol: Velux Connexoon
- logitech harmony hub, philips hue, Pilot app.
TroisSix
Posts: 92
Joined: Monday 11 January 2016 9:29
Target OS: -
Domoticz version: 2022.2
Location: France
Contact:

Re: How to change the value of a device?

Post by TroisSix »

@Lokonli: Ok, I got it.
In fact, the same way we modify the textOn/textOff, we have to modify the imageOn/imageOff (and not only the image) ;)

Code: Select all

Dashticz.setBlock('MyShutter', {textOff: 'partially closed ' + device['Value'] + '%', imageOff: 'perso/shutter_80.png'});
Could be useful to add it in the tutorial if it can helps the others.

PS: problem solved if you want to close this thread. Thanks Lokonli for your support 8-)
VM Debian - Domoticz stable v2024.7, RFXtrx433, Aeotec Z-Stick Gen5, Two APC
- rts: dio, oregon, somfy
- zwave: fibaro fgs212, aeotec smart switch, vision ZG8101
- IO Homecontrol: Velux Connexoon
- logitech harmony hub, philips hue, Pilot app.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest