Imperihome - missing devices
-
Just another one of those things that have not been done for the ZWay plugin. AFAIK, you can set these manually?
It's a side-product of not having a device database, although it should be possible to start with a reasonable set. It's all back to Vera's failings, again, since what is the point of having a device type if you also need a category/subcategory (OK, it's for the UI, but you get the point.)
-
That would be great, @mrFarmer. Again, i think i can help with basic code generation if its a set format you can show me.
One of the devices i've manually changed categories on doen't work properly:
from Imperihome:
2020-11-20 17:18:44.869 openLuup.server:: GET /data_request?id=lu_status2&output_format=json&DataVersion=879952081&Timeout=60&MinimumDelay=1500&_=1605887227784 HTTP/1.1 tcp{client}: 0x55a32131d328 2020-11-20 17:18:44.983 openLuup.server:: request completed (55233 bytes, 4 chunks, 114 ms) tcp{client}: 0x55a32131d328 2020-11-20 17:18:45.108 openLuup.server:: GET /data_request?id=lu_status2&output_format=json&DataVersion=879952111&Timeout=60&MinimumDelay=1500&_=1605887227785 HTTP/1.1 tcp{client}: 0x55a32131d328 2020-11-20 17:18:45.602 openLuup.server:: GET /cgi/imperihome.lua?query=/devices/20170/action/setStatus/1 HTTP/1.1 tcp{client}: 0x55a3228a48d8 2020-11-20 17:18:45.603 luup.call_action:: 20170.urn:upnp-org:serviceId:SwitchPower1.SetTarget 2020-11-20 17:18:45.603 luup.call_action:: action will be handled by parent: 198 2020-11-20 17:18:45.603 luup.variable_set:: 20170.urn:upnp-org:serviceId:SwitchPower1.Target was: 0 now: 0 #hooks:0 2020-11-20 17:18:45.629 openLuup.server:: request completed (37 bytes, 0 chunks, 26 ms) tcp{client}: 0x55a3228a48d8 2020-11-20 17:18:45.735 openLuup.server:: request completed (12708 bytes, 1 chunks, 626 ms) tcp{client}: 0x55a32131d328 2020-11-20 17:18:45.771 openLuup.server:: GET /cgi/imperihome.lua?query=/devices HTTP/1.1 tcp{client}: 0x55a3228a48d8 2020-11-20 17:18:45.779 openLuup.server:: request completed (16819 bytes, 0 chunks, 8 ms) tcp{client}: 0x55a3228a48d8
From AltUI:
2020-11-20 17:18:53.135 openLuup.server:: GET /data_request?id=action&output_format=json&DeviceNum=20170&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1 HTTP/1.1 tcp{client}: 0x55a321d47e58 2020-11-20 17:18:53.136 luup.call_action:: 20170.urn:upnp-org:serviceId:SwitchPower1.SetTarget 2020-11-20 17:18:53.136 luup.call_action:: action will be handled by parent: 198 2020-11-20 17:18:53.137 luup.variable_set:: 20170.urn:upnp-org:serviceId:SwitchPower1.Target was: 0 now: 1 #hooks:0 2020-11-20 17:18:53.172 openLuup.server:: request completed (35 bytes, 1 chunks, 36 ms) tcp{client}: 0x55a321d47e58 2020-11-20 17:18:53.596 openLuup.server:: request completed (12708 bytes, 1 chunks, 3688 ms) tcp{client}: 0x55a32131d328
Any ideas why Imperihome doesnt work? Other devices (local and verabridge) works fine.
-
Ok, so i've looked into what happens. This is what is fed into the call_action at line 684 in luup.lua.
Format:
e,m,j,a = dev: call_action (service, action, arguments, devNo)
Switching a local device from AltUI (Works):
e,m,j,a = dev: call_action ("urn:micasaverde-com:serviceId:SecuritySensor1", "SetArmed",{DeviceNum = "65", action = "SetArmed", newArmedValue = "1", serviceId = "urn:micasaverde-com:serviceId:SecuritySensor1"}, 65)
Switching a local device from Imperihome device (Works):
e,m,j,a = dev: call_action ("urn:micasaverde-com:serviceId:SecuritySensor1", "SetEnabled", {newArmedValue = "0"}, 65)
Switching a VeraBridge device from AltUI (Works):
e,m,j,a = dev: call_action ("urn:upnp-org:serviceId:SwitchPower1", "SetTarget", {DeviceNum = "10308", action = "SetTarget", newTargetValue = "1", serviceId = "urn:upnp-org:serviceId:SwitchPower1"}, 10308)
Switching a VeraBridge device from Imperihome device (Fails):
e,m,j,a = dev: call_action ("urn:upnp-org:serviceId:SwitchPower1", "SetTarget", {newTarget = "0"}, 10308)
No error messages in the luup log, just no end result.. Any ideas?
-
-
Careful here.
Vera/MiOS has an appallingly bad trait of using different names for the same thing in different places. It's worthwhile checking the documentation between the action Luup call and the HTTP request. I'm not aware of a significant change in openLuup in this area, but have vivid recollections of the pains that this put me through in the relatively early stages of development.
I might be wrong, it could be a latent error lain undiscovered for years, but you're perhaps in a better position than I to investigate this (I don't use, or even have, Imperihome.)
-
That was it.
/cgi/Imperihome.lua: Changed "newTarget" to "newTargetValue" at line 385, 672 and 675. (i would upload the updated lua file, but im missing priveleges)
This was not an issue before, has there been changes on this in openluup?
@mrFarmer - FYI
@perh said in Imperihome - missing devices:
That was it.
/cgi/Imperihome.lua: Changed "newTarget" to "newTargetValue" at line 385, 672 and 675. (i would upload the updated lua file, but im missing priveleges)
This was not an issue before, has there been changes on this in openluup?
@mrFarmer - FYI
I modified the right lines, it really works now!
At the same time, I can see the icons on the imperihome flashing as if they are constantly reloading ... -
@PerH, haven't you experienced this?
-
EDIT: code improved after strict correction.
Finally got all devices into imperihome.
ran this script in "test code":
local oldparent = 198 for i, d in pairs (luup.devices) do if d.device_num_parent == oldparent then if d.device_type == "urn:schemas-upnp-org:device:BinaryLight:1" then if d.category_num == 0 then print (i, d.name, d.device_type, d.category_num, d.subcategory_num) luup.attr_set("category_num", 3, i) if d.subcategory_num == 0 then luup.attr_set("subcategory_num", 1, i) end print (i, d.name, d.device_type, d.category_num, d.subcategory_num) end end if d.device_type == "urn:schemas-upnp-org:device:DimmableLight:1" then if d.category_num == 0 then print (i, d.name, d.device_type, d.category_num, d.subcategory_num) luup.attr_set("category_num", 2, i) if d.subcategory_num == 0 then luup.attr_set("subcategory_num", 3, i) end print (i, d.name, d.device_type, d.category_num, d.subcategory_num) end end if d.device_type == "urn:schemas-upnp-org:device:HVAC_ZoneThermostat:1" then if d.category_num == 0 then print (i, d.name, d.device_type, d.category_num, d.subcategory_num) luup.attr_set("category_num", 5, i) if d.subcategory_num == 0 then luup.attr_set("subcategory_num", 1, i) end print (i, d.name, d.device_type, d.category_num, d.subcategory_num) end end if d.device_type == "urn:schemas-micasaverde-com:device:SceneController:1" then if d.category_num == 0 then print (i, d.name, d.device_type, d.category_num, d.subcategory_num) luup.attr_set("category_num", 14, i) if d.subcategory_num == 0 then luup.attr_set("subcategory_num", 0, i) end print (i, d.name, d.device_type, d.category_num, d.subcategory_num) end end if d.device_type == "urn:schemas-micasaverde-com:device:DoorSensor:1" then if d.category_num == 0 then print (i, d.name, d.device_type, d.category_num, d.subcategory_num) luup.attr_set("category_num", 4, i) if d.subcategory_num == 0 then luup.attr_set("subcategory_num", 1, i) end print (i, d.name, d.device_type, d.category_num, d.subcategory_num) end end if d.category_num == 0 then print (i, d.name, d.device_type, d.category_num, d.subcategory_num) end end end return true
It took a while before they actually sticked, and survived luup reloads, and they still arent updated in the openluup or altui gui?
anyway, it works! Still have to rerun this script when i add new/other devices though, but thats how it is.
-
EDIT: code improved after strict correction.
Finally got all devices into imperihome.
ran this script in "test code":
local oldparent = 198 for i, d in pairs (luup.devices) do if d.device_num_parent == oldparent then if d.device_type == "urn:schemas-upnp-org:device:BinaryLight:1" then if d.category_num == 0 then print (i, d.name, d.device_type, d.category_num, d.subcategory_num) luup.attr_set("category_num", 3, i) if d.subcategory_num == 0 then luup.attr_set("subcategory_num", 1, i) end print (i, d.name, d.device_type, d.category_num, d.subcategory_num) end end if d.device_type == "urn:schemas-upnp-org:device:DimmableLight:1" then if d.category_num == 0 then print (i, d.name, d.device_type, d.category_num, d.subcategory_num) luup.attr_set("category_num", 2, i) if d.subcategory_num == 0 then luup.attr_set("subcategory_num", 3, i) end print (i, d.name, d.device_type, d.category_num, d.subcategory_num) end end if d.device_type == "urn:schemas-upnp-org:device:HVAC_ZoneThermostat:1" then if d.category_num == 0 then print (i, d.name, d.device_type, d.category_num, d.subcategory_num) luup.attr_set("category_num", 5, i) if d.subcategory_num == 0 then luup.attr_set("subcategory_num", 1, i) end print (i, d.name, d.device_type, d.category_num, d.subcategory_num) end end if d.device_type == "urn:schemas-micasaverde-com:device:SceneController:1" then if d.category_num == 0 then print (i, d.name, d.device_type, d.category_num, d.subcategory_num) luup.attr_set("category_num", 14, i) if d.subcategory_num == 0 then luup.attr_set("subcategory_num", 0, i) end print (i, d.name, d.device_type, d.category_num, d.subcategory_num) end end if d.device_type == "urn:schemas-micasaverde-com:device:DoorSensor:1" then if d.category_num == 0 then print (i, d.name, d.device_type, d.category_num, d.subcategory_num) luup.attr_set("category_num", 4, i) if d.subcategory_num == 0 then luup.attr_set("subcategory_num", 1, i) end print (i, d.name, d.device_type, d.category_num, d.subcategory_num) end end if d.category_num == 0 then print (i, d.name, d.device_type, d.category_num, d.subcategory_num) end end end return true
It took a while before they actually sticked, and survived luup reloads, and they still arent updated in the openluup or altui gui?
anyway, it works! Still have to rerun this script when i add new/other devices though, but thats how it is.
-
The newTargetValue for BinarySwitch is correct and my current code is wrong. I am making updates and expect to publish them one of these days. I never noticed it to be wrong as I control all standard devices on the Veras rather than through openLuup. I might change this so in imperihome I only need the openLuup device setup and no longer the Vera's. The latter loose their connection frequently so I would solve that too.
Cheers Rene
-
Sound good, Any chance of getting it into altAppStore? nice to have the automatic updates.
One thing the code I mentioned does not to is to update categories of the children of combodevices. You can however just rerun the code with the combodeviceID as parent.
-
Hi,
From what I could see is that the z-way devices are not having a category or subcategory number set. These are used to map to an Imperihome device type and thus failing and ignored. Are these numbers being left out intentionally, or is this some bug? (@akbooer ?)
Cheers@mrfarmer said in Imperihome - missing devices:
From what I could see is that the z-way devices are not having a category or subcategory number set.
Latest development release of the ZWay plugin (v20.11.24) sets
category_num
...https://smarthome.community/topic/71/openluup-z-way-bridge-version-log?_=1606232724236
-
@PerH , as this is a CGI file and not a plugin it cannot go into the app store.
AK, nice to hear of your update to set de device types as I am struggling with the last few. If you only look at the device type then you cannot distinguish some devices like HVAC vs Heater. Means I need to do a little more work on it.
Cheers Rene
-
@PerH , as this is a CGI file and not a plugin it cannot go into the app store.
AK, nice to hear of your update to set de device types as I am struggling with the last few. If you only look at the device type then you cannot distinguish some devices like HVAC vs Heater. Means I need to do a little more work on it.
Cheers Rene