I have a lot of variables in Domoticz like this "0|0|Er staat niets open. Geen regen verwacht.|10|666666".
I would like to get the different elements from this variable, just like a Temp/Hum sensor. For example v123_1 or v123_3 . Is that possible??
Variable with sub IDX Topic is solved
Moderators: leecollings, htilburgs, robgeerts
-
michelscholte
- Posts: 75
- Joined: Friday 08 January 2016 10:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Nederland
- Contact:
-
Lokonli
- Posts: 2292
- Joined: Monday 29 August 2016 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Variable with sub IDX
You could create a custom getStatus function in custom.js:michelscholte wrote: Sunday 25 October 2020 19:44 I have a lot of variables in Domoticz like this "0|0|Er staat niets open. Geen regen verwacht.|10|666666".
I would like to get the different elements from this variable, just like a Temp/Hum sensor. For example v123_1 or v123_3 . Is that possible??
Code: Select all
function getStatus_myvar0(block) {
block.value = block.device.Value.split('|')[0]; //to get the first part of the variable value
}
function getStatus_myvar1(block) {
block.value = block.device.Value.split('|')[1]; //to get the second part of the variable value
}
Code: Select all
blocks['myvar0'] = {
idx: 'v123'
}
blocks['myvar1'] = {
idx: 'v123'
}
https://dashticz.readthedocs.io/en/mast ... -idx-block
-
michelscholte
- Posts: 75
- Joined: Friday 08 January 2016 10:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Nederland
- Contact:
Re: Variable with sub IDX
This is exacly what I mean and it works. Thanks a lot.
Who is online
Users browsing this forum: No registered users and 1 guest