The Vera Community forums have moved!

Advanced => Programming => Plugins & Plugin Development => Topic started by: rigpapa on January 16, 2018, 06:35:31 pm

Title: Plugin: DeusExMachinaII (Deus Ex Machina for UI7 and beyond)
Post by: rigpapa on January 16, 2018, 06:35:31 pm
I am creating this thread as the (official) new home of DeusExMachinaII.

DeusExMachinaII (aka DEMII) is the UI7 (and beyond) version of beowulfe's Deus Ex Machina plugin. It is a "vacation ghost" that manipulates a configurable set of lights on a random pattern. It can be triggered to run at sunset, or a specific time, and will run until a configurable "lights out" time. At lights out, it will turn off any lights it has turned on.

Documentation (https://github.com/toggledbits/DeusExMachina/blob/master/README.md) is available in the GitHub repository (https://github.com/toggledbits/DeusExMachina) for the project.


UPDATE HISTORY
2018-12-23: Version 2.8 released.

2018-10-15: Version 2.8RC1 release candidate.

2018-02-23: Version 2.8beta1. This version implements three previously requested enhancements: the ability to have a "wake up" scene that runs before cycling of lights begins, the full ability to control start and end of cycling from scenes, PLEG, Lua, etc. (disabling DEMIIs schedule entirely); and the ability to run different "Final" scenes when the house mode changes to an "inactive" mode.

2018-01-15: Version 2.7 (approved 2018-01-22) This version reverses a change introduced in 2.6 that was an attempt to address a minor issue with certain Fibaro and Qubino dimmers. Unfortunately, the fix works for those (apparently rare) products, but causes many other dimmers to turn on to 100% rather than the configured brightness level. I'll look into other ways of handling the Fibaro/Qubino matter. Upcoming for the next release is the addition of a "wake up" scene that runs before lights begin cycling, the ability to have different scenes run when DEMII stops due to a house mode change, and the ability to more easily circumvent all of DEMII's native timing and run as directed by "Wake" and "Sleep" actions (driven by PLEG, scenes, Lua, etc.). Longer-term, I'm looking at smarter algorithms for cycling, rather than just random selection.
Title: Re: Plugin: DeusExMachinaII (Deus Ex Machina for UI7 and beyond)
Post by: Thorden on January 17, 2018, 03:50:04 am
@rigpapa, thanks again for this wonderful plugin. 
It is great now, if you succeed in implementing the future plans described above, it is going to achieve total awesomeness! :)

Just for your information, all my dimmers are all Fibaro (FGD-211 and FGD-212). They did not work correctly for dimming level before the 2.6 patch, with the patch they are working perfect. Was there another Fibaro dimmer that had the issues addressed in 2.6? I never had any issues with them that I am aware of prior to 2.6.
Title: Re: Plugin: DeusExMachinaII (Deus Ex Machina for UI7 and beyond)
Post by: rigpapa on January 17, 2018, 08:17:03 am
It was related to a firmware issue on the dimmer. I'm looking for my notes, but it had something to do with certain low-demand loads. The fix was an attempt to work around the issue and relieve users of the need to upgrade firmware on the dimmer unit (which apparently requires it be removed from its normally-installed location). Another case of cure worse than disease. The change gave my network of dozens of dimmers of various brands (Leviton, Cooper, GE/Jasco, Evolve, but no Fibaro) no issues. That is, I'm sure, a taste of what the folks at Vera get to deal with every day in dealing with all of these different elements.
Title: Re: Plugin: DeusExMachinaII (Deus Ex Machina for UI7 and beyond)
Post by: Quixote on January 17, 2018, 05:00:25 pm
Just wanted to say thanks as well. Keep up the amazing work!
Title: Re: Plugin: DeusExMachinaII (Deus Ex Machina for UI7 and beyond)
Post by: nutshellml on February 18, 2018, 07:12:30 pm
Awesome plugin - looking for clarification on two items:

1) The Max ON Time - If I were to put 45 minutes for a device (light), that device (lights) would stay on for exactly 45 mins then turn off, will it cycle back through again?  OR only be on during the entire Start - Lights-Out time for 45mins?

2) The Maximum ON Target - Does that correspond with how many devices would be on at once?   If I were to pick 7, would there always be 7 devices on or not necessarily, just the max would be 7?

Title: Re: Plugin: DeusExMachinaII (Deus Ex Machina for UI7 and beyond)
Post by: rigpapa on February 18, 2018, 07:49:43 pm
1) The Max ON Time - If I were to put 45 minutes for a device (light), that device (lights) would stay on for exactly 45 mins then turn off, will it cycle back through again?  OR only be on during the entire Start - Lights-Out time for 45mins?
The max on time is a maximum, but if Deus decides to turn the light off sooner, it will. The light may also be turned on again later, but any time it is turned on, it will not be on for more than the max on time.

Quote
2) The Maximum ON Target - Does that correspond with how many devices would be on at once?   If I were to pick 7, would there always be 7 devices on or not necessarily, just the max would be 7?
The max is 7, but at any given time, there could be fewer than 7.
Title: Re: Plugin: DeusExMachinaII (Deus Ex Machina for UI7 and beyond)
Post by: nutshellml on February 18, 2018, 08:32:15 pm
Thank you! 
Title: Re: Plugin: DeusExMachinaII (Deus Ex Machina for UI7 and beyond)
Post by: rigpapa on February 23, 2018, 05:10:40 pm
I have a beta release of v2.8 of DeusExMachinaII up on GitHub. See the head of this thread for a link to the release.

This release includes three features previously promised:

It also has a lot of code cleanup and "modernization" ported in from my evolving style and knowledge gained doing other plugins (this is my oldest plugin, and it still has a way to go).
Title: Re: Plugin: DeusExMachinaII (Deus Ex Machina for UI7 and beyond)
Post by: rafale77 on April 12, 2018, 12:34:45 pm
I think this could be published on the AltAppStore too  ;)
Title: Re: Plugin: DeusExMachinaII (Deus Ex Machina for UI7 and beyond)
Post by: rigpapa on April 12, 2018, 03:05:38 pm
And done.
Title: Re: Plugin: DeusExMachinaII (Deus Ex Machina for UI7 and beyond)
Post by: nutshellml on May 29, 2018, 06:22:58 pm
So I have the "start time" to blank (sunset), but in the past few weeks I've been noticing that the lights are coming on during the day.  Is there a way to trouble shoot this?   I'm still running DE2.7 w/ Vera Plus with UI7
Title: Re: Plugin: DeusExMachinaII (Deus Ex Machina for UI7 and beyond)
Post by: rigpapa on May 29, 2018, 08:22:10 pm
Without turning on debug, DEMII logs some pretty helpful information, so next time you see lights coming on when you think they should not, grab your log file and email it to me (my email address is on my profile).
Title: Re: Plugin: DeusExMachinaII (Deus Ex Machina for UI7 and beyond)
Post by: nutshellml on May 29, 2018, 09:06:46 pm
Without turning on debug, DEMII logs some pretty helpful information, so next time you see lights coming on when you think they should not, grab your log file and email it to me (my email address is on my profile).

10-4, thanks. is there a way i can go back until this morning during a specific time frame?  I have cameras so i can look back and see when they came on.
Title: Re: Plugin: DeusExMachinaII (Deus Ex Machina for UI7 and beyond)
Post by: rigpapa on May 29, 2018, 09:11:31 pm
Odds are your logs have rotated, possibly many times over. It's best if you can catch it fresh.
Title: Re: Plugin: DeusExMachinaII (Deus Ex Machina for UI7 and beyond)
Post by: nutshellml on May 29, 2018, 09:19:28 pm
Duhh.. So I started to look through my logs and notice the date was 5/30 at 1:00am... My vera for some odd reason has the wrong time... :)  THANK YOU, you did help me
Title: Re: Plugin: DeusExMachinaII (Deus Ex Machina for UI7 and beyond)
Post by: bobgor on August 27, 2018, 03:50:35 pm
Does DEMII provide any guarantee that there will be at least one light on between startup and when it begins shutting down?
I think not, but just want to check my understanding.

Thanks.
Title: Re: Plugin: DeusExMachinaII (Deus Ex Machina for UI7 and beyond)
Post by: rigpapa on August 29, 2018, 08:37:34 am
Does DEMII provide any guarantee that there will be at least one light on between startup and when it begins shutting down?
I think not, but just want to check my understanding.

Thanks.
When it starts up and does its first random cycle, if all controlled lights are off, the only thing it can do is turn something on, so in the most general sense of your question, yes, unless the active period is shorter than the cycle delay, at least one will be turned on.

Does it guarantee that one light is on throughout the entire active period? No. It's 100% random, so there always exists the possibility that it could turn off every light it has turned on at some point during the cycling period. But the odds go down, the more devices there are.
Title: Re: Plugin: DeusExMachinaII (Deus Ex Machina for UI7 and beyond)
Post by: bobgor on August 29, 2018, 10:50:04 am
Makes sense, thanks.
Title: Re: Plugin: DeusExMachinaII (Deus Ex Machina for UI7 and beyond)
Post by: nutshellml on October 14, 2018, 10:53:41 pm
Tried to update to the beta, exactly as described, but doesn't update.  I unchecked restart, I manually reloaded and refreshed and still shows 2.7. 
Title: Re: Plugin: DeusExMachinaII (Deus Ex Machina for UI7 and beyond)
Post by: rigpapa on October 15, 2018, 08:53:45 am
Tried to update to the beta, exactly as described, but doesn't update.  I unchecked restart, I manually reloaded and refreshed and still shows 2.7.

When I made the beta package, I neglected to change the version number in the code (hate when I do that). So the beta will show 2.7 when installed.

At this point, there have been some other fixes applied, so it's probably better than I make an updated package; it's now a release candidate. You can download that here: https://github.com/toggledbits/DeusExMachina/releases/tag/v2.8-RC1

Installation via same method.