Super Trigger 1.0

electron

Administrator
Staff member
plugin name: Super Trigger
version: 1.0
author: electron
description: The Super Trigger plugin is a powerful plugin allowing one to kick off homeseer events based on advanced conditions, applied to the device string of a device, all this without having to know any scripting. This plugin adds the following device string triggers to an Event: "is in", "matches", "matches (regex)", "matches (like)", "is equal to", "is greater than" and "is less than". Most of them are pretty obvious about what they do, but the numeric triggers are pretty powerful, since these triggers strip all non numerical data from a device string before continuing, all this without having to know one thing about scripting!

Since I believe in the power of example, I will post some examples below showing what these triggers can be used for:

isin: i.e. you are monitoring a garage door, and when the door is open, you have an animated door opening icon with the words "open" in the device string. Specify "open" as the keyword here, and if the word open is in the device string, the event will trigger.

matches: when a device string matches the exact value you have specified, the event will trigger. Be aware that this include spaces and any possible hidden HTML tags in the device string.

matches (regex): People familiar with regular expressions will really appreciate this. If you are new to regular expressions, check out http://www.regular-expressions.info/ for more information. Very useful when you want the event to trigger on very specific conditions. A good example is if you have all your weather data in virtual devices, you could monitor if there are any breaking weather alerts using i.e. ".*Important message.*".

matches (like): Uses the VB Like operator (http://www.vbexplorer.com/VBExplorer/Focus...tutorial_2.asp), not as powerful as regular expressions, but much easier to use to do some more flexible matches, since you can just use wildcards to do the matching i.e. "*breaking*news*Iraq*"

is equal to, is greater than, is less than: This trigger strips all non numerical data from the device string before matching it. Let's say you have a virtual device, v5, which reflects the current wind speed i.e. "NW 13.3 mph". Now you can have the event trigger when the device string is equal to, greater than or less than the value you have specified without having to write a script to strip the non numerical data, and then do the comparison. Another good example is, let's say you have a device string that monitors your favorite stock, and the device string format looks like "Homeseer stock is currently $50 per share". Simply specify 45 as the value, select is greater than, and use the speech tab to announce "Break out the Champaign!". When the device string changes, and the value is greater than 45, Homeseer will then execute the event and announce this, or do whatever you have specified, all without scripting.

There are also 2 checkboxes you can set, "case sensitive", which only applies to the "isin", "matches (regex)" and "matches (like)" triggers, and the "negate" option, which applies to all triggers.

Some other things you can do with this:
* Control your window AC unit depending on the outside temperature.
* Check if a device which contains all school delays also includes the school your kids to go.
* Monitor current homeland security status, and i.e. make an announcement when the current color code is yellor or red.
* Make an announcement when the Dow exceeds 10000.
* and anything else you can think of!

installation: just copy the hspi_supertrigger.ocx file to your Homeseer directory, and select it as an interface in Homeseer options.
 

Attachments

cool, let me know what you think about it, there are so many uses for this thing, it's impossible to list them all.
 
I'm a scripting IDIOT. I need a seeing eye dog.

INstalled supertrigger.
Created an event using supertrigger as type,
Value : on
is in
c1

on scripts/speech tab I told HS to say it's working.

I guess I expected to hear "it's working" when my computer light went on. hehe
Obviously I'm missing something. I see a lot of potential for this, just as soon as I figure out what it does, how to make it do that, etc.....

TIA
 
UPDATE:
I figured that maybe the event never fired so I clicked execute now, and violla!
So next issue is I can't see where to set firing to reoccuring if I have supertrigger .
 
a super trigger event won't catch up, meaning, if your device is aready on, you create the super trigger event, and click ok to save the event settings, nothing will happen until the devicestring has been updated again and ON is in the device string. So turn the device off, turn it back on, then it should work.
 
what I am wondering is if the word ON is really part of the devicestring, or if Homeseer translates i.e. 0/1 to OFF/ON in the GUI. Can you enter this in the script tab, execute the event and tell me what it says in the log viewer:

&hs.writelog "debug", "C1 devicestring is set to" & hs.devicestring("C1")
 
Yeah that's what I thought, the on/off status isn't a real device string. If you want to test it, you can trigger it manually by creating a new event, and add the following line to the script box (don't have to save the event). Make sure you have your super trigger configured already.

&hs.setdevicestring "C1", "the lights are now on"

Once you execute that event (or "test" the script), the super trigger should trigger.
 
Hate to resurrect a 5 year dead thread, but does this plugin still work in the current version of Homeseer? If not, is there any other plugin that can trigger events on the device string change?
 
I would be surprised if this plugin worked with Homeseer 2.x, but there is only one way to find out ;) I would hope that the current Homeseer software supported doing this without needing a plugin (so easy to code) by now ;)
 
Unfortunately the current Homeseer version doesn't support triggering on a device string change. Besides that, there are a number of plugins that change the device string without changing the status or value, so a plugin like this is the only way to tell this has happened. :)

Guess I'll have to give it a shot.
 
Back
Top