Page 1 of 1

There is no device with that name or id

Posted: Monday 23 December 2019 13:55
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?

Re: There is no device with that name or id

Posted: Monday 23 December 2019 15:01
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 ?

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

Posted: Monday 23 December 2019 15:26
by ghulleman
Indeed, I did not activate the device. After activation the device became available in script.

Thank you!

Re: There is no device with that name or id

Posted: Tuesday 04 February 2020 20:02
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

Re: There is no device with that name or id

Posted: Wednesday 05 February 2020 2:40
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
}

Re: There is no device with that name or id

Posted: Wednesday 05 February 2020 19:38
by madpatrick
Thanks. The script is working