And it’s done! A new version of Deus Ex Machina is now approved and available.
First, I’d again like to thank Andy for being super-cool and turning over the code base to me for ongoing support. The plugin code and the documentation can be found here: GitHub - toggledbits/DeusExMachina: Vacation Plugin for Vera Home Automation
Use the usual Vera install process. But first, take a minute to read…
Here’s the “express” version of what you need to know about DEMII:
[ol][li]This new version is published as a new plugin called “Deus Ex Machina II” (I call it DEMII for short). The reasons for this were two: (1) The old plugin is under Andy’s account on apps.mios.com, and there’s no obvious way to transfer it, and adding me as a contributor wasn’t working either; and (2) I no longer have access to UI5, so while I’ve made every effort to keep this new plugin compatible with UI5, it’s untested on that firmware, so leaving Andy’s old plug-in that’s at least well-understood on UI5 seemed like a good idea until I can get a UI5 test platform myself. So…[/li]
[li]I have only tested this version on UI7. It may work on UI5, but it may not. If it doesn’t, I will make an effort to resolve the problems, but since I don’t have UI5 to test on at the moment, I will need to rely on others to give me good quality bug reports, or even dig in and find my errors and make contributions to the Github repository. For UI6, I have no idea. Want to help?[/li]
[li]If you are currently using the old Deus Ex Machina plugin v1.1, do not delete the old device or uninstall the old plugin yet. This new plugin will copy your old configuration when it installs, but if you delete it, it’s not there to copy, of course. This may apply to very few people, I understand, since the old plugin really didn’t work on UI7, but some discovered workarounds for the problems.[/li]
[li]After installation, two full refreshes of the browser are recommended (ctrl-F5 on Windows and whatever you normally do on Mac, etc.).[/li][/ol]
What’s fixed?
Again, even though this is published as a new plugin, it is a revision of Andy’s code. Here’s what’s changed:
[ul][li]The problem of operating incorrectly when the “Lights Out” time was before midnight has been fixed. (UI5 and UI7)[/li]
[li]The problem of not saving configuration changes on UI7 has been fixed. (UI7)[/li]
[li]The way controlled lights are stored in configuration has been changed to a single state variable containing a list of devices (UI5 and UI7)[/li]
[li]The timing of the “Lights Out” mode has been reduced. DEM v1.1 used the same 300 to 1800 second (5 to 30 minute) range for randomly shutting off controlled lights as it did for cycling them. The problem with that is that if you have a large number of controlled lights and even modestly bad luck with the random number generator, it could take hours for DEM v1.1 to shut off all the lights. DEMII uses a 60 to 300 second (1 to 5 minute) range for random delays in the shutdown mode, making it look (I think) more like a natural “bedtime” behavior. (UI5 and UI7)[/li]
[li]DEMII on UI7 can be enabled or disabled by a scene. It can also be enabled/disabled in Lua, as it was before, but that’s been more clearly documented.[/li]
[li]DEMII on UI7 can trigger a scene (or PLEG/PLTS) when it changes state from enabled to disabled.[/li]
[li]DEMII on UI7 can trigger a scene (or PLEG/PLTS) when it changes operating state. That is, when DEMII hits sunset and is ready to start cycling lights, it sends an event that it’s now in the cycling operational mode. When the “Lights Out” time is reached, it sends an event to indicate it’s going into the shutdown mode. When all the lights have been shut off, it sends an event to indicate it’s going into its “idle” mode (waiting for the next sunset).[/li]
[li]DEMII keeps its timing delays in state variables you can see and modify (they were previously hard-coded). While I haven’t made a UI on the Configure tab for these yet (and I’m not sure how valuable that may be), you can at least change them on the Advanced tab. The four variables are: MinCycleTime, MaxCycleTime, MinOffTime, MaxOffTime. The two cycle time variables are the range used for choosing a random delay between cycling lights. The off time variables are the delay range used when shutting off lights for “bedtime”. All of these are in seconds. Please make sure any values you enter are valid integers, and the min must be less than or equal to the max.[/li]
[li]If DEMII is disabled while it is cycling lights, it will immediately shut off all controlled lights.[/li][/ul]
Let me know what you guys think.
Oh, I did a cursory test under openLuup/ALTUI while I was trying those projects out just for fun, and it seems to mostly work, although the UI layout isn’t correct. I’ll be asking those projects for guidance to resolve those issues, and it is a goal to have DEMII working there.