There is no device with that name or id  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
ghulleman
Posts: 9
Joined: Sunday 16 June 2019 10:55
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands / Hilversum
Contact:

There is no device with that name or id

Post by ghulleman »

Hi Everyone,

Using domitcz 4.11570, dzVents 2.5.2, I seem to be unable to access all devices.

Using the direct name id I get an error message:
There is no device with that name or id. <insert name/id here>

If I try the following code:

Code: Select all

		domoticz.devices().forEach(function(device2)
		    domoticz.log('Device ' .. device2.name .. ' has id ' .. device2.id, domoticz.LOG_INFO)    
                end
In the log I get this result:
2019-12-23 13:49:00.480 Status: dzVents: Info: Device Aqara Motion Sensor - Zolder has id 198
2019-12-23 13:49:00.481 Status: dzVents: Info: Device Kerstboom has id 204

So when I try to get the value of device 203, I get this device not found error message. Devices 199..203 are in my device list and have a recent 'last seen' datetime stamp. It is not only Xiaomi devices. I have over a hundred devices, ranging from sonoff, plugwise, xiaomi, P1, evohome, buienradar, fritzbox and sunnyboy. But the iteration only shows about 30.

Anyone some pointers?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: There is no device with that name or id

Post by waaren »

ghulleman wrote: Monday 23 December 2019 13:55 Using domitcz 4.11570, dzVents 2.5.2, I seem to be unable to access all devices.
Anyone some pointers?
dzVents only gets information on the active devices. Are the devices set to active in the devices tab ?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
ghulleman
Posts: 9
Joined: Sunday 16 June 2019 10:55
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands / Hilversum
Contact:

Re: There is no device with that name or id  [Solved]

Post by ghulleman »

Indeed, I did not activate the device. After activation the device became available in script.

Thank you!
User avatar
madpatrick
Posts: 639
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: There is no device with that name or id

Post by madpatrick »

Hi,

I'm trying your script, but i cant get it to work.
Maybe i'm missing a part of the script or names are not correct.
Hopely you can assist.

Thanks
-= HP server GEN8 Xeon(R) E3-1220L_V2 -=- OZW -=- Toon2 (rooted) -=- Domoticz v2024.7 -=- Dashticz v3.12b on Tab8" =-
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: There is no device with that name or id

Post by waaren »

madpatrick wrote: Tuesday 04 February 2020 20:02 I'm trying your script, but i cant get it to work.
The lines in the first post are only a code snippet. Not a complete dzVents script.

You can try this one

Code: Select all

-- this dzVents show all active devices by name / id
return
{
    on =
    {
        timer = 
        { 
            'every minute',
        },
    },

    execute = function(dz, item)
         dz.devices().forEach(function(dv)
            dz.log('Device ' .. dv.name .. ' has id ' .. dv.id, dz.LOG_INFO)    
        end)
    end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
madpatrick
Posts: 639
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2024.7
Location: Netherlands
Contact:

Re: There is no device with that name or id

Post by madpatrick »

Thanks. The script is working
-= HP server GEN8 Xeon(R) E3-1220L_V2 -=- OZW -=- Toon2 (rooted) -=- Domoticz v2024.7 -=- Dashticz v3.12b on Tab8" =-
Post Reply

Who is online

Users browsing this forum: Google [Bot], renerene and 1 guest