Author Topic: New Plugin: Reactor  (Read 3703 times)

Offline rigpapa

  • Sr. Member
  • ****
  • Posts: 467
  • Karma: +66/-0
Re: New Plugin: Reactor
« Reply #30 on: July 05, 2018, 10:23:19 am »
this is the result after the next entry

Love it. Screen shots make everything clear for me. Thank you.

OK. I see two issues here, one expected, one not. The expected issue is the presentation of the condition in the status view. It's punting and showing you the stored JSON, the internal representation that is being used to represent the condition, rather than a human-readable form, and this is related to a matter I'll discuss more below. It's ugly, but doesn't interfere with operation.

The other issue I see, which is subtle, is that the date menus are not properly reloading your selected month. This is caused by an off-by-one error I didn't catch (a difference between JavaScript's representation of arrays and Lua's). I can get you a fix for this with just a single JS file you can upload to your Vera, so look for that later today.

I think, more importantly, your relatively simple condition is highlighting for me a challenge created by my attempt to have the date selector be more "infinitely flexible." Asynchronously from your experiment, I've been working on documentation, and it has been proving difficult to clearly explain how the date filters actually work. This is a red flag, of course. It should be crystal clear how the date filters work. You even demonstrate in your example that you have very clear expectations about how it should work. And, it doesn't actually work that way--by introducing what I was hoping would be flexibility, I think I'm clashing too much with both simplicity and reasonable expectations of how it should work based on how other systems do it. As an example of this, consider, what is your expectation if the condition specified the start date as month and year only, but the end date specified only day of the month and hour/minute time. What would that do? It's a legal combination in the current system.

So, I need to revise this, and I will for the next release. It will make my life simpler, as well, because that approach is well-understood, and easy to document. It's clearly better to have more flavors of date condition than it is to try to make one form of condition handle every case. Stay tuned for that (I'll support the current one for a few releases but deprecate it). But I'll get you the JavaScript update so at least you can move forward with that's currently there.
Author of Rachio, Deus Ex Machina II, Intesis WMP Gateway, SiteSensor, DelayLight, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3 sandbox.

Offline rigpapa

  • Sr. Member
  • ****
  • Posts: 467
  • Karma: +66/-0
Re: New Plugin: Reactor
« Reply #31 on: July 05, 2018, 10:36:41 am »
Just to ensure I do understand it, if I have the below sensor setup as a trigger for a scene:

Code: [Select]
Service/Variable#84 Guest Mode Status = on for 600 secs(0) false as of 3:50:43 PM
House ModeHome(1) true as of 3:50:43 PM
Service/Variable#66 Garage Door Status = open(0) false as of 3:50:43 PM

will it see if my Virtual Switch called "Guest Mode" has been active for at least 600 seconds before checking that both HomeMode = 1 (Home) and the Garage Door Status = open? I assume if after 10 mins and all 3 conditions being true, it will then "trigger" activating the vera scene I have using it as a trigger?

Conditions are not sequential unless you explicitly make them sequential. If you are running 1.1 (update if not), there is an additional option with the "for (duration)" condition option to sequence the operations. But, I don't think you need that in this case. Or maybe you do...

It seems odd to me to have a duration restriction on the Guest Mode vswitch--if I'm looking at just that condition in isolation, why would it matter if Guest Mode has been on for 10 minutes? What's magical about that? There may be a good reason, but since you've only copied your logic, and not explained (in human words) what you're trying to get it to do, I can't verify that the conditions as presented will do that.

As given, the sensor will trip when house mode is Home, and Garage Door is open, and Guest Mode is on for 600 or more seconds, in any order.

If, on the other hand, what you are trying to accomplish is "if the house is in Home mode and guest mode is on and the garage door has been open for more than 10 minutes", then you need to move the "for (duration)" option to the garage door condition.

If none of the above is correct, tell me in human-speak what you want to get done, and we'll discuss how to do it.

And thanks for your encouragement! Greatly appreciated!
Author of Rachio, Deus Ex Machina II, Intesis WMP Gateway, SiteSensor, DelayLight, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3 sandbox.

Offline dJOS

  • Jr. Member
  • **
  • Posts: 62
  • Karma: +0/-0
Re: New Plugin: Reactor
« Reply #32 on: July 05, 2018, 09:24:51 pm »
Conditions are not sequential unless you explicitly make them sequential. If you are running 1.1 (update if not), there is an additional option with the "for (duration)" condition option to sequence the operations. But, I don't think you need that in this case. Or maybe you do...

It seems odd to me to have a duration restriction on the Guest Mode vswitch--if I'm looking at just that condition in isolation, why would it matter if Guest Mode has been on for 10 minutes? What's magical about that? There may be a good reason, but since you've only copied your logic, and not explained (in human words) what you're trying to get it to do, I can't verify that the conditions as presented will do that.

As given, the sensor will trip when house mode is Home, and Garage Door is open, and Guest Mode is on for 600 or more seconds, in any order.

If, on the other hand, what you are trying to accomplish is "if the house is in Home mode and guest mode is on and the garage door has been open for more than 10 minutes", then you need to move the "for (duration)" option to the garage door condition.

If none of the above is correct, tell me in human-speak what you want to get done, and we'll discuss how to do it.

And thanks for your encouragement! Greatly appreciated!

Howdy, it's a bit of a hack .... essentially I have a Virtual Switch called "Guest mode" and the "Sensor" is used as a scene trigger to automatically disable Guest mode when we come home. Guest mode has to have been active for at least 15 minutes (I changed it from 10) before it will work.

Essentially because guest mode forces the nest and vera to stay in "Home mode", I need some way to know we have come home and turn it off. So I'm using the Garage door opening to do this as long as the house is in "Home mode" and the guest mode virtual switch has been active for at least 15 minutes.
HAC: Vera Plus | Voice Control: Amazon echo's | Z-Wave Devices: Aeotec Smart Switches & Garage Door Opener | Thermostats: nest's

Offline rigpapa

  • Sr. Member
  • ****
  • Posts: 467
  • Karma: +66/-0
Re: New Plugin: Reactor
« Reply #33 on: July 05, 2018, 10:09:25 pm »
Essentially because guest mode forces the nest and vera to stay in "Home mode", I need some way to know we have come home and turn it off. So I'm using the Garage door opening to do this as long as the house is in "Home mode" and the guest mode virtual switch has been active for at least 15 minutes.

Got it (I think :) ). Guest mode for 600 seconds + House Mode = Home + Garage Door Open should do the trick, with no additional logic/sequences. Give it a go!
Author of Rachio, Deus Ex Machina II, Intesis WMP Gateway, SiteSensor, DelayLight, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3 sandbox.

Offline rigpapa

  • Sr. Member
  • ****
  • Posts: 467
  • Karma: +66/-0
Re: New Plugin: Reactor
« Reply #34 on: July 05, 2018, 10:17:32 pm »
I've posted an updated J_ReactorSensor_UI7.js to the Github stable branch. Download this file and upload it to your Vera (Apps > Develop apps > Luup files) to correct the month handling in date conditions.

If you're really feeling like living on the bleeding edge, the develop branch has my rework of date conditions, but has had limited testing, so beware. You'll need the L_Reactor.lua and J_ReactorSensor_UI7.js files that from branch if you want to try it.
Author of Rachio, Deus Ex Machina II, Intesis WMP Gateway, SiteSensor, DelayLight, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3 sandbox.

Offline dJOS

  • Jr. Member
  • **
  • Posts: 62
  • Karma: +0/-0
Re: New Plugin: Reactor
« Reply #35 on: July 05, 2018, 10:35:13 pm »
Howdy I tested my logic sensor last night and it works perfectly.

I'm super impressed with reactor in using it for all my scene triggers now as it's so fast and reliable. Boolean logic just makes so much sense, I can't understand why this isn't a standard feature?

Btw, have you thought about making the sensors fully self contained? You could then have full if then else scenes?
HAC: Vera Plus | Voice Control: Amazon echo's | Z-Wave Devices: Aeotec Smart Switches & Garage Door Opener | Thermostats: nest's

Offline rigpapa

  • Sr. Member
  • ****
  • Posts: 467
  • Karma: +66/-0
Re: New Plugin: Reactor
« Reply #36 on: July 06, 2018, 08:33:46 am »
Btw, have you thought about making the sensors fully self contained? You could then have full if then else scenes?

Yes, I'm thinking about what can be done better. I don't just want to duplicate the function of scenes just to have it integrated. That would just trade away its current light weight for a little convenience, which I don't see as a good trade. All ideas are welcome.
Author of Rachio, Deus Ex Machina II, Intesis WMP Gateway, SiteSensor, DelayLight, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3 sandbox.

Offline Nameless

  • Full Member
  • ***
  • Posts: 163
  • Karma: +3/-0
Re: New Plugin: Reactor
« Reply #37 on: July 06, 2018, 01:35:17 pm »
OK. I want to make sure you are, because "Enabling" is not the same as "Arming". And there's no UI in the current version for arming them. So, how are you doing that?  :D
Ah ha, I didn't realize that. I'll keep you posted on my findings after making adjustments. Thanks

Sent from my LGUS992 using Tapatalk
I wanted to follow-up and let you know the notifications work just fine now when the sensor trips.

Unfortunately, I'm finding certain devices I've been using in my tests don't seem to update for Reactor. For example, Reactor works great to sense and trip for a temperature change reported by my Honeywell thermostat. It will not, however, pull in any updates for the indoor humidity. It seems to freeze itself to whatever humidity the thermostat reports when I reset the Reactor sensor. The humidity is reported by my thermostat in the Advanced tab of the device, but not the UI, if that matters.

Additionally, my Aeon Labs door sensor is not recognized by the Reactor sensor either for changes.

I'm still testing with my other sensors and devices, just haven't had much time to really dig into it. I'll keep updating to the newest versions before each round of testing and I'll report back if I can find something solid.

Sent from my LGUS992 using Tapatalk


Offline rigpapa

  • Sr. Member
  • ****
  • Posts: 467
  • Karma: +66/-0
Re: New Plugin: Reactor
« Reply #38 on: July 06, 2018, 01:56:11 pm »
Unfortunately, I'm finding certain devices I've been using in my tests don't seem to update for Reactor. For example, Reactor works great to sense and trip for a temperature change reported by my Honeywell thermostat. It will not, however, pull in any updates for the indoor humidity. It seems to freeze itself to whatever humidity the thermostat reports when I reset the Reactor sensor. The humidity is reported by my thermostat in the Advanced tab of the device, but not the UI, if that matters.

Devices choose which state variables send events, so it seems that the author of your thermostat interface (Vera, or plugin? let me know which, and I can verify) may not have configured the humidity to send events. I have anticipated issues like this, and so you get to field test my workaround. Go into "Variables" under the "Advanced" tab for the sensor that uses your Honeywell thermostat in conditions and see if there's a "ContinuousTimer" variable. If there is, set its value to "1" and restart the sensor ("Restart" button on the Control tab). If it's not there, go to "New Service" (also under "Advanced") and enter the following (copy and paste recommended, because it has to be perfect):

New service: urn:toggledbits-com:serviceId:ReactorSensor
New variable: ContinuousTimer
New value: 1

Then, go back to the "Control" tab and restart the ReactorSensor. It should start updating the humidity.

Quote
Additionally, my Aeon Labs door sensor is not recognized by the Reactor sensor either for changes.

What specific service and variable are you testing in the condition? If the door sensor implements the usual SecuritySensor1/Tripped value (and it should), it should trigger as changed.
Author of Rachio, Deus Ex Machina II, Intesis WMP Gateway, SiteSensor, DelayLight, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3 sandbox.

Offline dJOS

  • Jr. Member
  • **
  • Posts: 62
  • Karma: +0/-0
Re: New Plugin: Reactor
« Reply #39 on: July 06, 2018, 11:35:06 pm »
Btw, have you thought about making the sensors fully self contained? You could then have full if then else scenes?

Yes, I'm thinking about what can be done better. I don't just want to duplicate the function of scenes just to have it integrated. That would just trade away its current light weight for a little convenience, which I don't see as a good trade. All ideas are welcome.

Cheers - Reactor does work fantastically well as is - my scenes where so horribly unreliable before (why MCV, why?) and now they work 100% of the time and are orders of magnitude smarter!  I really appreciate you work mate and tipped some coin into your hat yesterday, you've made my Vera Plus so much smarter and more useful!  8)
HAC: Vera Plus | Voice Control: Amazon echo's | Z-Wave Devices: Aeotec Smart Switches & Garage Door Opener | Thermostats: nest's

Offline rigpapa

  • Sr. Member
  • ****
  • Posts: 467
  • Karma: +66/-0
Re: New Plugin: Reactor
« Reply #40 on: July 07, 2018, 09:01:21 am »
...tipped some coin into your hat yesterday

Thank you! It's not always obvious to connect the email address in those notices to a username here. I appreciate your tip and comments! And to anyone else reading this who is among the other donors, thank you as well!
Author of Rachio, Deus Ex Machina II, Intesis WMP Gateway, SiteSensor, DelayLight, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3 sandbox.

Offline akbooer

  • Master Member
  • *******
  • Posts: 5974
  • Karma: +258/-69
  • "Less is more"
Re: New Plugin: Reactor
« Reply #41 on: July 07, 2018, 12:17:30 pm »
@rigpapa

Are you running this on the latest openLuup version?  I haven't tried Reactor yet, but I thought I recall someone having difficulty... ?  Thanks.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline rigpapa

  • Sr. Member
  • ****
  • Posts: 467
  • Karma: +66/-0
Re: New Plugin: Reactor
« Reply #42 on: July 07, 2018, 01:09:06 pm »
Are you running this on the latest openLuup version?

Running?!? Shoot man, I developed it on openLuup. So much faster and easier...  :)

I haven't seen any posts specifically relating to openLuup issues, at least not as of 1.1. I am working on some formatting clean-up under ALTUI, but those are just appearance glitches, nothing that should affect operation. I'm also not sure I have your "latest and greatest", but I will go pull that now and double-check.
Author of Rachio, Deus Ex Machina II, Intesis WMP Gateway, SiteSensor, DelayLight, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3 sandbox.

Offline akbooer

  • Master Member
  • *******
  • Posts: 5974
  • Karma: +258/-69
  • "Less is more"
Re: New Plugin: Reactor
« Reply #43 on: July 07, 2018, 01:34:40 pm »
Running?!? Shoot man, I developed it on openLuup. So much faster and easier...  :)

 ;D

Quote
I haven't seen any posts specifically relating to openLuup issues, at least not as of 1.1. I am working on some formatting clean-up under ALTUI, but those are just appearance glitches, nothing that should affect operation.

I'll look for the post...

Quote
I'm also not sure I have your "latest and greatest", but I will go pull that now and double-check.

development branch, now.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline rigpapa

  • Sr. Member
  • ****
  • Posts: 467
  • Karma: +66/-0
Re: New Plugin: Reactor
« Reply #44 on: July 07, 2018, 02:04:58 pm »
@akbooer, I just pulled your testing branch (before your reply above) and tried it. Small issue. I'll PM you.
Author of Rachio, Deus Ex Machina II, Intesis WMP Gateway, SiteSensor, DelayLight, Auto Virtual Thermostat and VirtualSensor plugins. Vera Plus w/100+ Z-wave devices. Vera3 sandbox.