My UI7 network has crashed 3 times. I had to exclude and re-include my entire network so much that some of my devices are into the 200’s. Maybe I shouldn’t sweat it but it annoys me.
Can anything be done to “clean up” the device count so I show 1-50 or whatever and not have skipped device ID’s taking me up this high?
Not trying to flog a dead horse, but why would is it so difficult to do this? shouldn’t there be a master table that says this device id points to this particular device? The reason i want to be able to do this is because i have several of these units and when i create some programming logic i want to create it once and have it work for all the units. it’s kind of a pain to go through and re-assign variables for devices in each of the units. I’m open to suggestions if anyone has them on how to make my code and variables more standard…
[quote=“akbooer, post:6, topic:189557”]I generate a lookup table automatically at startup between device name and id, and thereafter simply refer to devices by name.
Soooo. i have a file with a bunch of functions that i call at startup via startup code like this:
sebbyCode = require("sebbyLuaCode")
in there i defined the a global variable to hold the device IDs:
DEV = {}
then i fill the variable with the device names per your suggestion:
for i,d in pairs(luup.devices) do
DEV[d.description] = i
end
i out in some log calls in there so i know the variable DEV is being populated with the devices, but when i go to call that array from the “test lua code”, it tells me it is nill…
02/14/16 8:26:58.180 LuaInterface::StartEngine failed run: 0 [string "sebbyCode.vLog("d vatiable is ".. DEV["Tem..."]:1: attempt to index global 'DEV' (a nil value) <0x2e6fc680>
is there a special designator for a global variable in Lua? i though just defining it there in my file would make it available globally.
i do have an issue with this that maybe you can help with. I use the iphon locator plugin to figure out who is home so i can control scenes by proximity. when i populate the device table, it looks like it is all going in there no problem. here is a snippet from my log where i load them:
DESCRIPTION: Sonos ===> DEVICE ID = 67 <0x2b8ba680>
DESCRIPTION: Outdoor Switch ===> DEVICE ID = 4 <0x2b8ba680>
DESCRIPTION: (*)Seb\'s Super Seis ===> DEVICE ID = 70 <0x2b8ba680>
DESCRIPTION: (*)Ida\'s six ===> DEVICE ID = 71 <0x2b8ba680>
DESCRIPTION: Webcam Dropbox Uploa ===> DEVICE ID = 40 <0x2b8ba680>
when i try to re-call them, they all work great, except for the iphone devices. i believe it’s because they have special character in them. so, how would i go about calling this for those special cases since this does not work:
There really shouldn’t be a need to quote the reverse solid us (backslash). What does the stored string actually look like? Have you tried “Seb’s…” instead of “Seb's” ?
Best Home Automation shopping experience. Shop at Ezlo!