Scene for house mode

Is there a way to create a scene that just changed the house mode from away to home I cant seem to find it.

Thank you

Un example of Luup code placed in a scene to be excuted at a certain time or condition ( in this example at10:00PM , :

– Interrogation of house mode state
local res,housemode = luup.inet.wget(“http://127.0.0.1:3480/data_request?id=variableget&Variable=Mode”,5)
luup.log("housemode = ", housemode)

– Change mode NIGHT if mode = HOME

if (housemode == “1”) then
luup.log(“set housemode to Night”)
luup.call_action(“urn:micasaverde-com:serviceId:HomeAutomationGateway1”,“SetHouseMode”, {Mode = 3}, 0)
end

If you don’t need any of the logic, you just use the line

luup.call_action(“urn:micasaverde-com:serviceId:HomeAutomationGateway1”,“SetHouseMode”, {Mode = 3}, 0)

in the scene (in the “also execute the following luup code” box). The 3 in that means night mode. 1 is home, 2 is away, 3 night, 4 vacation if I remember right. So if you want to set to home mode, just use

luup.call_action(“urn:micasaverde-com:serviceId:HomeAutomationGateway1”,“SetHouseMode”, {Mode = 1}, 0)

Thank you very much! I have input the code and will test as soon as I get home. I am not good with the code stuff and this will probably go over my head but is there a way to make it dependent on the iPhone locator plugin? that is how I have my wife’s phone set up to set home and away on Vera.

The House Modes plugin can modify the mode. It just acts as a device you can modify within a scene.

Ok plug in works perfect the only thing is it triggers to home mode as soon as I get home but if my wife is not home with the iphone locator app it sets it to away after about 3-5 mins. Is there a way I can set the iphone locator to look and see if I am home before setting to away?