I have a some 30 devices that start with the name 'Zolder' and 1 group called 'Zolder'
All devices work fine and some are controlled by dzVents.
I have 1 device (switch) called 'Zolder Airco' which dzVents does not know about.
sName = dz.devices('Zolder Airco') give nil for sName
Half of the devices have a space in the name after 'Zolder' the other half not.
If I change the name to 'Zolder_Airco' (notice the underscore) then the dzVents scripts works fine.
There are no duplicate names that start with 'Zolder'
I deleted the device and let Domoticz create it again, but the problem is still present.
Has anyone a solution or knows what the problem is?
dzVents says device does not exist
Moderators: leecollings, remb0
Forum rules
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.
Use the following template when posting here:
Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....
If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly
If you are replying, please do not quote images/code from the first post
Please mark your topic as Solved when the problem is solved.
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.
Use the following template when posting here:
Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....
If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly
If you are replying, please do not quote images/code from the first post
Please mark your topic as Solved when the problem is solved.
-
Kedi
- Posts: 624
- Joined: Monday 20 March 2023 14:41
- Target OS: Linux
- Domoticz version: latest
- Location: Somewhere in NL
- Contact:
dzVents says device does not exist
Logic will get you from A to B. Imagination will take you everywhere.
- habahabahaba
- Posts: 288
- Joined: Saturday 18 March 2023 14:44
- Target OS: Windows
- Domoticz version: 2024.4
- Contact:
Re: dzVents says device does not exist
The solution is to use idx of device
-
Kedi
- Posts: 624
- Joined: Monday 20 March 2023 14:41
- Target OS: Linux
- Domoticz version: latest
- Location: Somewhere in NL
- Contact:
Re: dzVents says device does not exist
That's not a solution, but a workaround.
I don't use idx in my scripts, it is meaningless.
From a name you can follow the flow of a script.
I have scripts that use more then 3 devices, and then it hard to follow the flow when idxes are used.
Some of those script sizes are greater then 10 Kb (including comments and comments may be 60%)
I don't use idx in my scripts, it is meaningless.
From a name you can follow the flow of a script.
I have scripts that use more then 3 devices, and then it hard to follow the flow when idxes are used.
Some of those script sizes are greater then 10 Kb (including comments and comments may be 60%)
Logic will get you from A to B. Imagination will take you everywhere.
- habahabahaba
- Posts: 288
- Joined: Saturday 18 March 2023 14:44
- Target OS: Windows
- Domoticz version: 2024.4
- Contact:
Re: dzVents says device does not exist
Meaningless??!! This is the only correct solution IMHO to avoid getting confused by device names if you have quite a lot of them.
What if you suddenly decide to rename a device? Will you look for all the scripts in which it is involved?
And if you know the device’s ID, there’s no problem with logging its name.
What if you suddenly decide to rename a device? Will you look for all the scripts in which it is involved?
And if you know the device’s ID, there’s no problem with logging its name.
- imautohuttraeger
- Posts: 482
- Joined: Saturday 14 March 2020 13:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: lat.beta
- Location: Germany
- Contact:
Re: dzVents says device does not exist
I also use IDX in scripts in order to avoid problems when a device is renamed. For better "readability", I simply put the name of the device in a comment in the same line.
Stop, look and listen.