I was trying to get home modes to set with my alarm, but I have noticed that variables come back empty. I am having this issue with other variables (like day night plugin) as well.
I tried emailing the state variable to myself and its empty.
local state = luup.variable_get("urn:schemas-micasaverde-com:device:ConcordAlarmPartition:1", "DetailedArmMode", "uuid:4d494342-5342-5645-00d5-00000216571d")
if (state == "Stay") then
luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1","SetHouseMode", {Mode = 3}, 0)
elseif (state == "Armed") then
luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1","SetHouseMode", {Mode = 2}, 0)
else
luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1","SetHouseMode", {Mode = 1}, 0)
end
return true
I figured out the issue, its not well documented but you can’t use a deviceID in luup.variable_get it has to be a ServiceId.
This worked: luup.variable_get(“urn:micasaverde-com:serviceId:AlarmPartition2”, “DetailedArmMode”, “uuid:4d494342-5342-5645-00d5-00000216571d”)
I created a scene that triggers on any alarm arm or disarm and then sets the home mode. I am adding it below in case anyone wants to adapt it for their own alarm system. You just need to change the state1 variable to be your own alarm partition serviceid and deviceid.
[code]
function changeState()
local state1 = luup.variable_get(“urn:micasaverde-com:serviceId:AlarmPartition2”, “DetailedArmMode”, “uuid:4d494342-5342-5645-00d5-00000216571d”)
local state = tostring(state1)
if (state == “Stay”) then
luup.call_action(“urn:micasaverde-com:serviceId:HomeAutomationGateway1”,“SetHouseMode”, {Mode = 3}, 0)
elseif (state == “Armed”) then
luup.call_action(“urn:micasaverde-com:serviceId:HomeAutomationGateway1”,“SetHouseMode”, {Mode = 2}, 0)
else
luup.call_action(“urn:micasaverde-com:serviceId:HomeAutomationGateway1”,“SetHouseMode”, {Mode = 1}, 0)
end
find the d_**.xml file in the advanced tab of the device. then go to apps tab, develop apps, find the .xml file and open it. should see something with a service id.
Open the Advanced tab for the device and hover the mouse cursor over the name of the variable you are interested in. E.g. Status. This will show the service ID for that variable as a tooltip.
Open the Advanced tab for the device and hover the mouse cursor over the name of the variable you are interested in. E.g. Status. This will show the service ID for that variable as a tooltip.[/quote]
Rex
Does the tooltip only work in UI7? I can’t seem to get it to work in UI5.