I have two scenes setup that have schedules in them to turn lights on some time after sunset. “Lounge On” & “Kids Bed Lamp On”
I have another new scene called “Leaving House” this scene turns all the lights off in the house and arms some security sensors.
I have programmed my new ZME_KeyFob to run the Leaving House scene on button 1 which I can use when leaving.
Obviously if the scenes with the lights on schedules have already run (i.e. after sunset), then if I press the button 1 on the fob, all lights will then go out as I am leaving the house.
But if I leave the house before the scenes with the lights on schedules have run (i.e before sunset), the lights would come on whilst I am still out.
My question is: is it somehow possible to override or stop the scenes with schedules in them from turning on the lights, if I have run the Leaving House scene?
I have also created another new scene called “Welcome Home” and programmed button 2 on the key fob, this scene turns on some lights (If its night time) and disarms the security sensors.
Search for “Virtual Device” for information on how to implement a virtual device.
My “Leaving Home” scene will turn on a virtual device, and my “Welcome Home” will turn the virtual device off. You can then check the state of the virtual device in your other scenes, before proceeding with whatever the scene does.
I have additional virtual devices, for other states, such as “Vacation”.
I followed this page here to create a virtual device using the D_BinaryLight1.xml
I now have this new device in the VeraLite UI see screen shot:
If I manually click the On or Off button on this Virtual Device it says “No implementation”
I then edited the “Leaving House” scene to turn on this virtual device and saved / reloaded etc.
If I run the Leaving House scene, the On button on the Virtual Device in the Vera UI is not highlighted, I don’t see any errors however at the top of the Vera page.
Perhaps I have not setup the virtual device correctly ?
4. If the device requires an implementation file enter the name of the implementation filename in the “Upnp Implementation Filename” field (e.g. I_BinaryLight1.xml). Most devices already specify the implementation file in the device file; in this case specifying the implementation file yourself is not necessary.
I have now added I_BinaryLight1.xml in to the impl_file field on the Advanced tab.
Now when I press the buttons on the virtual device it no longer says “No Implementation” but now it says “Device not ready”
1. Go to Apps >> Develop Apps >> Luup Files and upload files (e.g. I_BinaryLight1.xml or I_DimmableLight1.xml or I_HVAC_ZoneThermostat1.xml or I_WindowCovering1.xml)
I didn’t upload any xml files I don’t have any xml files LOL.
In the Vera UI when I go to apps → develop apps - Luup files it lists on the page lots of current xml files. Am I meant to upload my own xml files or something ?
I’ve uploaded both his XML files and created another new device see screen shot, but this new device also says: “Device not ready” when clicking the buttons. Is that expected? I must be missing a step? Are there no step by step dummy guides for creating Virtual Switches ?
Also since adding this new StateDevice it keeps saying: “StateDevice[30] : Running Lua Startup” at the top of the Vera webpage.
I now have a Virtual Switch device and if I press the On / Off buttons they work OK.
I then edited the Leaving House scene to turn on the Virtual Switch and the Welcome Home scene to turn off the virtual switch.
So I guess I now need to know how to query the On / Off status of this virtual device from other scenes ?
I’ve been struggling with this, but I think I’ve made some progress now.
“Leaving House” scene turns VirtualSwitch1: ON
“Welcome Home” scene turns VirtualSwitch1: OFF
Previously I had a scene called “Kids Bed Lamp On” and within this scene I had added a schedule to turn on this lamp 30 mins after sunset. I wanted to prevent this lamp coming on it we were out of the house, i.e the “Leaving House” scene had been run and the Virtual Switch was ON.
What I did was delete the schedule from the “Kids Bed Lamp On” scene. I then created a new scene called: “Schedule - Kids Lamp On”
Within this new scene I added a schedule to run everyday at 30 mins after sunset, I also added this Luup code:
Home_or_away = luup.variable_get("urn:upnp-org:serviceId:VSwitch1","Status",29)
if(Home_or_away=="0")then
luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1","RunScene",{SceneNum="12"},0)
end
Home_or_away==0 i.e. the Virtual Switch is OFF (We are home) then run Scene Number 12 which is the “Kids Bed Lamp On” scene.
Home_or_away==1 i.e. the Virtual Switch is ON (We are away) then don’t run Scene Number 12 which is the “Kids Bed Lamp On” scene.
I’ve tested it and it seems to be working, I have some other lights I would like to not turn on when we are out, I will setup new Scenes for those and hopefully it will all work!
Seems the mControl Vera Luup Driver does not work with Virtual Switches in Vera
I just added a new Vera Luup device in to the mControl editor for the Device ID # of this Virtual switch in Vera and set it as a Binary Light, I then get a new device in the mControl UI with an On/Off button etc, but these buttons don’t actually seem to turn on or off the Virtual Device in Vera.
I do not use or know mControl my self. But usually developpers of software or apps like that have to do some adjustments to support the different plugins. The problem is that a BinarySwitch and a VirtualSwitch have a different urn.
This means when you set it up as a binary switch the wrong commands get sent to the vera. I don’t know if you can set this up in mControl, maybe you have to file a request there…
[quote=“chixxi, post:13, topic:172762”]I do not use or know mControl my self. But usually developpers of software or apps like that have to do some adjustments to support the different plugins. The problem is that a BinarySwitch and a VirtualSwitch have a different urn.
This means when you set it up as a binary switch the wrong commands get sent to the vera. I don’t know if you can set this up in mControl, maybe you have to file a request there…[/quote]
Thanks I have already reported this issue to mControl support.
Or you can use the original virtual switch, which is based on a binary switch (for that reason). However, it was never turned into a (point-and-click) plug-in. The Virtual State Device files are here.
Best Home Automation shopping experience. Shop at Ezlo!