dzVents says device does not exist Topic is solved
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: 625
- Joined: Monday 20 March 2023 14:41
- Target OS: Linux
- Domoticz version: latest
- Location: Somewhere in NL
- Contact:
dzVents says device does not exist
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?
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?
Logic will get you from A to B. Imagination will take you everywhere.
- habahabahaba
- Posts: 290
- 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: 625
- 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: 290
- 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: 486
- 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.
- waltervl
- Posts: 7047
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2026.3
- Location: NL
- Contact:
Re: dzVents says device does not exist
Using IDX is NOT the solution.
Dzvents is developed on top of the Domoticz Lua integration and the Lua integration can only select devices based on name.
So if you use IDX in a dzvents script dzvents asks Lua which device could be the given IDX. It will return the first device name.
But why it cannot find device 'Zolder Airco' while it could find something like 'Zolder Light' is indeed a little bit strange.
Dzvents is developed on top of the Domoticz Lua integration and the Lua integration can only select devices based on name.
So if you use IDX in a dzvents script dzvents asks Lua which device could be the given IDX. It will return the first device name.
But why it cannot find device 'Zolder Airco' while it could find something like 'Zolder Light' is indeed a little bit strange.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
- imautohuttraeger
- Posts: 486
- 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
It seems that I am too dull-witted and missing something. Why do I have to care that in the background it searches for the match of the idx to it's name? It works (never had problems) and I can rename a device whenever I want ...waltervl wrote: Wednesday 25 November 2026 18:58 So if you use IDX in a dzvents script dzvents asks Lua which device could be the given IDX. It will return the first device name.
Last edited by imautohuttraeger on Wednesday 25 November 2026 22:31, edited 1 time in total.
Stop, look and listen.
- habahabahaba
- Posts: 290
- Joined: Saturday 18 March 2023 14:44
- Target OS: Windows
- Domoticz version: 2024.4
- Contact:
Re: dzVents says device does not exist
Try this code
- Spoiler: show
- waltervl
- Posts: 7047
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2026.3
- Location: NL
- Contact:
Re: dzVents says device does not exist
As long as you have unique names there is no issue. But when you have the same names for devices you can have issues with using either IDX or names in dzvents. It could go right but it also can go wrong and select the incorrect device (in both cases).imautohuttraeger wrote: Wednesday 25 November 2026 21:02It seems that I am too dull-witted and missing something. Why do I have to care that in the background it searches for the match of the idx to it's name? It works (never had problems) and I can rename a device whenever I want ...waltervl wrote: Wednesday 25 November 2026 18:58 So if you use IDX in a dzvents script dzvents asks Lua which device could be the given IDX. It will return the first device name.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
- habahabahaba
- Posts: 290
- Joined: Saturday 18 March 2023 14:44
- Target OS: Windows
- Domoticz version: 2024.4
- Contact:
Re: dzVents says device does not exist
Waltervl, i think you are wrong.waltervl wrote: Wednesday 25 November 2026 18:58 Using IDX is NOT the solution.
Dzvents is developed on top of the Domoticz Lua integration and the Lua integration can only select devices based on name.
So if you use IDX in a dzvents script dzvents asks Lua which device could be the given IDX. It will return the first device name.
But why it cannot find device 'Zolder Airco' while it could find something like 'Zolder Light' is indeed a little bit strange.
In dzVents/runtime/Domoticz.lua - link there is the function
Code: Select all
function self._getItemFromData(baseType, id)
local res
for index, item in pairs(_G.domoticzData) do
if (item.baseType == baseType) then
if (item.id == id or item.name == id) then
if (res == nil) then
res = item
else
utils.log('Multiple items found for ' .. tostring(id) .. ' (' .. tostring(baseType) .. '). Please make sure your names are unique or use ids instead.', utils.LOG_ERROR)
end
end
end
end
return res
end- waltervl
- Posts: 7047
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2026.3
- Location: NL
- Contact:
Re: dzVents says device does not exist
Yes, it is somewhat more complicated, see issue: https://github.com/domoticz/domoticz/issues/7143
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
- imautohuttraeger
- Posts: 486
- 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
Ah - thank you for the explanation. Now I've got you. This is indeed a problem. But if you use a device name and two devices have identical names, it can also go wrong, if the first match is not the intended one, right?waltervl wrote: Wednesday 25 November 2026 23:37As long as you have unique names there is no issue. But when you have the same names for devices you can have issues with using either IDX or names in dzvents. It could go right but it also can go wrong and select the incorrect device (in both cases).imautohuttraeger wrote: Wednesday 25 November 2026 21:02It seems that I am too dull-witted and missing something. Why do I have to care that in the background it searches for the match of the idx to it's name? It works (never had problems) and I can rename a device whenever I want ...waltervl wrote: Wednesday 25 November 2026 18:58 So if you use IDX in a dzvents script dzvents asks Lua which device could be the given IDX. It will return the first device name.
Stop, look and listen.
- waltervl
- Posts: 7047
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2026.3
- Location: NL
- Contact:
Re: dzVents says device does not exist
Yes, that was what I am trying to tellimautohuttraeger wrote: Thursday 26 November 2026 12:21Ah - thank you for the explanation. Now I've got you. This is indeed a problem. But if you use a device name and two devices have identical names, it can also go wrong, if the first match is not the intended one, right?waltervl wrote: Wednesday 25 November 2026 23:37 As long as you have unique names there is no issue. But when you have the same names for devices you can have issues with using either IDX or names in dzvents. It could go right but it also can go wrong and select the incorrect device (in both cases).
For identical names in Domoticz beta, dzvents will warn about it in the log file when you try to find a device that has a twin device (see the github issue I mentioned before)
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
Kedi
- Posts: 625
- 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
Found it, and its quite stupid.habahabahaba wrote: Wednesday 25 November 2026 21:13 Try this codeMay be there are hidden simbols in the name
- Spoiler: show
In Zigbee I never user names with spaces. So in Domotics it gets no space when the device is created
So I change the name in Domoticz after the device was created. (it looks / reads better.)
Now I have tested, and I am sure that is the way it went wrong.
By typing I accedently typed a <shift> space, and that looks like a normal space, so you cannot see it.
Again sorry for the fuss....
Lesson learned.
Logic will get you from A to B. Imagination will take you everywhere.