# \[DEPRECATED\] Trigger Happy!

**URL:** <https://community.smartthings.com/t/deprecated-trigger-happy/29960>\
**Category:** Community Created SmartApps\
**Created:** [November 24, 2015, 4:45pm UTC](https://community.smartthings.com/t/deprecated-trigger-happy/29960 "2015-11-24T16:45:55Z")\
**Posts on this page:** 20\
**Page:** 4

<div class="post-metadata">

**Author:** ![Mbhforum](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/mbhforum/32/93879_2.png) [@Mbhforum](https://community.smartthings.com/u/Mbhforum)\
**Post date:** [November 26, 2015, 12:19am UTC](https://community.smartthings.com/t/deprecated-trigger-happy/29960/61 "2015-11-26T00:19:02Z")

</div>

Can someone explain how to setup GitHub replication for other repo’s besides the Smartthings master one (i.e: to @bravenel)

---

<div class="post-metadata">

**Author:** ![bravenel](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/bravenel/32/13223_2.png) [@bravenel](https://community.smartthings.com/u/bravenel)\
**Post date:** [November 26, 2015, 12:21am UTC](https://community.smartthings.com/t/deprecated-trigger-happy/29960/62 "2015-11-26T00:21:06Z")

</div>

Form another thread:

> [@Rule machine - as per the app developer, this app is no longer available for new installs, distribution, or support](https://community.smartthings.com/t/rule-machine-as-per-the-app-developer-this-app-is-no-longer-available-for-new-installs-distribution-or-support/28730/679):
>
> I believe that one thing you could do is in the STs IDE with Github integration already setup, click “Settings”, then “Add new repository” and type “bravenel” as owner “SmartThingsPublic” as Name and “master” as Branch.

---

<div class="post-metadata">

**Author:** ![Mbhforum](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/mbhforum/32/93879_2.png) [@Mbhforum](https://community.smartthings.com/u/Mbhforum)\
**Post date:** [November 26, 2015, 12:32am UTC](https://community.smartthings.com/t/deprecated-trigger-happy/29960/63 "2015-11-26T00:32:33Z")

</div>

Thanks. The problem is YOUR smartapps are under a subfolder in the smartapps subdirectory. Therefore when I map to that repo, it doesn’t show your smartapps, only the ones in the root. My guess is you linked the public ST repo to your public repo, and then added yours? Also - I see your Rule and Rule Machine smartapps, but not your Trigger and Trigger Happy smartapps.

---

<div class="post-metadata">

**Author:** ![themajesticking](https://avatars.discourse-cdn.com/v4/letter/t/90db22/32.png) [@themajesticking](https://community.smartthings.com/u/themajesticking)\
**Post date:** [November 26, 2015, 7:24am UTC](https://community.smartthings.com/t/deprecated-trigger-happy/29960/64 "2015-11-26T07:24:00Z")

</div>

Got it. Thanks again!

---

<div class="post-metadata">

**Author:** ![bravenel](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/bravenel/32/13223_2.png) [@bravenel](https://community.smartthings.com/u/bravenel)\
**Post date:** [November 26, 2015, 9:05pm UTC](https://community.smartthings.com/t/deprecated-trigger-happy/29960/65 "2015-11-26T21:05:19Z")

</div>

New version released: Version 1.1.0. This introduces an enhanced feature, thanks to @adgwill!

Release notes:

- It is now possible to compare values of one device to another device of the same type. This feature is available for temperature, humidity, illuminance, power, energy, battery, and dimmer level. Now those can be compared to a numeric value, or the current value of another device.

- Added dimmer level as a condition that can be tested, relative to a number or the level of another device

- Cleaned up mode input

To update: copy code for Trigger from Github [https://github.com/bravenel/SmartThingsPublic/blob/master/smartapps/bravenel/trigger.src/trigger.groovy](https://github.com/bravenel/SmartThingsPublic/blob/master/smartapps/bravenel/trigger.src/trigger.groovy)  
Paste it into Trigger in IDE, overwriting previous version, and Save. Do not publish!

---

<div class="post-metadata">

**Author:** ![an39511](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@an39511](https://community.smartthings.com/u/an39511)\
**Post date:** [November 26, 2015, 11:28pm UTC](https://community.smartthings.com/t/deprecated-trigger-happy/29960/66 "2015-11-26T23:28:50Z")

</div>

I have have setup a trigger to trip when I physically turn on a switch. I choose “physical switch” but the trigger won’t trip. It works fine if I use “switch” but obviously is not a solution to only trip when a switch is manually turned on.

If I choose physical switch nothing trips. Not a physical turn on or from an app.

Is there something I am not understanding on how to use this feature?

---

<div class="post-metadata">

**Author:** ![adgwill](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/adgwill/32/19785_2.png) [@adgwill](https://community.smartthings.com/u/adgwill)\
**Post date:** [November 27, 2015, 10:12pm UTC](https://community.smartthings.com/t/deprecated-trigger-happy/29960/67 "2015-11-27T22:12:57Z")

</div>

Not yet had the chance to try this but based on the success of previous releases… I cannot wait!! Should give my nest a very ‘smart’ upgrade!! Thanks Bruce @bravenel

---

<div class="post-metadata">

**Author:** ![bamarayne](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/bamarayne/32/18206_2.png) [@bamarayne](https://community.smartthings.com/u/bamarayne)\
**Post date:** [November 28, 2015, 5:43pm UTC](https://community.smartthings.com/t/deprecated-trigger-happy/29960/68 "2015-11-28T17:43:50Z")

</div>

So this morning I had a very simple trigger fail to fire. I reset the trigger to a later time and tested it, it worked fine then.

I’m not sure how to get a log on something that doesn’t fire.

This is the trigger:

 ![](https://global.discourse-cdn.com/smartthings/original/3X/b/a/babe5965e85baa5ae733ef9b1d7c84cff4cc50a0.png)

---

<div class="post-metadata">

**Author:** ![bravenel](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/bravenel/32/13223_2.png) [@bravenel](https://community.smartthings.com/u/bravenel)\
**Post date:** [November 28, 2015, 5:52pm UTC](https://community.smartthings.com/t/deprecated-trigger-happy/29960/69 "2015-11-28T17:52:45Z")

</div>

> [@bamarayne](#):
>
> So this morning I had a very simple trigger fail to fire.

Bear in mind, that Trigger Happy is as susceptible to ST problems as any other app. I’ve had one fail also. At this point I delete the one that failed, and put it in again.

I had 3 instances of a different smartapp that were failing on every mode change from Night to Day, but worked for all other mode changes. Go figure! Again, the fix was to delete the apps, and put them in again. Now they are working again properly. It seems that sometimes ST’s database gets bad links or something.

---

<div class="post-metadata">

**Author:** ![bamarayne](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/bamarayne/32/18206_2.png) [@bamarayne](https://community.smartthings.com/u/bamarayne)\
**Post date:** [November 28, 2015, 6:09pm UTC](https://community.smartthings.com/t/deprecated-trigger-happy/29960/70 "2015-11-28T18:09:36Z")

</div>

It’s just very odd, since I do not use mode changes at all.

Also, the only things I have had fail were only in trigger. I moved the others back to rule machine and they work just fine.

---

<div class="post-metadata">

**Author:** ![bravenel](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/bravenel/32/13223_2.png) [@bravenel](https://community.smartthings.com/u/bravenel)\
**Post date:** [November 28, 2015, 6:24pm UTC](https://community.smartthings.com/t/deprecated-trigger-happy/29960/71 "2015-11-28T18:24:32Z")

</div>

> [@bamarayne](#):
>
> It’s just very odd, since I do not use mode changes at all.
> 
> Also, the only things I have had fail were only in trigger. I moved the others back to rule machine and they work just fine.

I only mentioned mode changes as an example of how the cloud can have little corruptions in its data and links. Removing and reinstalling the app is the fix. It has nothing to do with Trigger Happy vs Rule Machine.

---

<div class="post-metadata">

**Author:** ![jjcole23](https://avatars.discourse-cdn.com/v4/letter/j/3e96dc/32.png) [@jjcole23](https://community.smartthings.com/u/jjcole23)\
**Post date:** [November 30, 2015, 2:43am UTC](https://community.smartthings.com/t/deprecated-trigger-happy/29960/72 "2015-11-30T02:43:05Z")

</div>

I have a Legrand Event Controller (RFLC) on my LAN that controls zones and scenes for the Legrand Adorne whole-house lighting. Can Trigger Happy be used to go to a specific url on my LAN that will trigger a lighting scene e.g. [http://192.168.1.15/rflc\_ctrl.cgi?\_=1448798872198&cmd=sexec&sid=1](http://192.168.1.15/rflc_ctrl.cgi?_=1448798872198&cmd=sexec&sid=1).

---

<div class="post-metadata">

**Author:** ![bravenel](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/bravenel/32/13223_2.png) [@bravenel](https://community.smartthings.com/u/bravenel)\
**Post date:** [November 30, 2015, 3:02am UTC](https://community.smartthings.com/t/deprecated-trigger-happy/29960/73 "2015-11-30T03:02:49Z")

</div>

You would have to have an intermediary app, that could access the url, when triggered by a virtual switch that is flipped by Trigger Happy.

---

<div class="post-metadata">

**Author:** ![btk](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/btk/32/17453_2.png) [@btk](https://community.smartthings.com/u/btk)\
**Post date:** [November 30, 2015, 5:31am UTC](https://community.smartthings.com/t/deprecated-trigger-happy/29960/74 "2015-11-30T05:31:31Z")

</div>

Bruce,

Not sure if I’m going about this the right way or not. I wanted a trigger to fire if a button is either pushed or held.

Our toddler is afraid of going upstairs to the bathroom when the room and hallway are dark, so I grabbed an Iris Smart Button and created the following trigger so he could turn the lights on/off with a button push. He tends to keep his finger on buttons longer than necessary, so I also added the “held” trigger:

 ![](https://global.discourse-cdn.com/smartthings/original/3X/3/c/3c7ce6d85337b6024c7ca664e4392840bd5e9b2b.PNG)

The event only fired if I held the button, never when pushed, because the for() loop enclosing the if(evt.name == button) makes result equal to the last condition checked. In this case, the push condition.

I was able to resolve this by adding a break statement in testEvt() like so (5th line from the bottom of this snippet, line 711 in the full file):

```
def testEvt(evt) {
    def result = false
	if(evt.name == "mode") return modeXOk
	if(evt.name == "routineExecuted") {
		for(int i = 1; i < state.howMany; i++) {
			def myCapab = (settings.find {it.key == "rCapab$i"}).value
			def state = settings.find {it.key == "state$i"}
			if(myCapab == "Routine") result = result || evt.displayName == state.value
		}
		return result
	}
	for(int i = 1; i < state.howMany; i++) {
		def myDev = (settings.find {it.key == "rDev$i"}).value
		myDev.each {if(evt.displayName == it.displayName) {
			if(evt.name == "button") result = getButton(myDev, evt, i)
			else result = getOperand(i)}
		}
		if (result) break
	}
//	log.debug "testEvt result: $result"
	return result
}

```

I’m obviously not as familiar with the code as you are so I’m not positive that this won’t break something. That said, I like to offer at least a half-baked solution to problems I find. =)

---

<div class="post-metadata">

**Author:** ![JDRoberts](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/jdroberts/32/56577_2.png) [@JDRoberts](https://community.smartthings.com/u/JDRoberts)\
**Post date:** [November 30, 2015, 11:11am UTC](https://community.smartthings.com/t/deprecated-trigger-happy/29960/75 "2015-11-30T11:11:25Z")

</div>

Wh not just make two nearly identical rules, one with the single trigger pushed And one with the single trigger held?

---

<div class="post-metadata">

**Author:** ![btk](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/btk/32/17453_2.png) [@btk](https://community.smartthings.com/u/btk)\
**Post date:** [November 30, 2015, 1:08pm UTC](https://community.smartthings.com/t/deprecated-trigger-happy/29960/76 "2015-11-30T13:08:38Z")

</div>

Because that would be the easy way and not keep me up until the wee hours of the morning figuring out why it didn’t work my way? 😜

---

<div class="post-metadata">

**Author:** ![bravenel](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/bravenel/32/13223_2.png) [@bravenel](https://community.smartthings.com/u/bravenel)\
**Post date:** [November 30, 2015, 2:55pm UTC](https://community.smartthings.com/t/deprecated-trigger-happy/29960/77 "2015-11-30T14:55:30Z")

</div>

> [@btk](#):
>
> I’m obviously not as familiar with the code as you are so I’m not positive that this won’t break something. That said, I like to offer at least a half-baked solution to problems I find. =)

Hey, anytime you want to find a flaw in the code, have at it!! Nice catch!

Github updated: [https://github.com/bravenel/Rule-Trigger/blob/master/smartapps/bravenel/trigger.src/trigger.groovy](https://github.com/bravenel/Rule-Trigger/blob/master/smartapps/bravenel/trigger.src/trigger.groovy)

---

<div class="post-metadata">

**Author:** ![bravenel](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/bravenel/32/13223_2.png) [@bravenel](https://community.smartthings.com/u/bravenel)\
**Post date:** [November 30, 2015, 2:56pm UTC](https://community.smartthings.com/t/deprecated-trigger-happy/29960/78 "2015-11-30T14:56:27Z")

</div>

> [@JDRoberts](#):
>
> Wh not just make two nearly identical rules, one with the single trigger pushed And one with the single trigger held?

He could, but he’s right, and there was a bug. Great deal, to have my bugs found and fixed by the community!!

---

<div class="post-metadata">

**Author:** ![daven](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/daven/32/112729_2.png) [@daven](https://community.smartthings.com/u/daven)\
**Post date:** [December 1, 2015, 12:26am UTC](https://community.smartthings.com/t/deprecated-trigger-happy/29960/79 "2015-12-01T00:26:42Z")

</div>

Anyone chime in on what simple thing I’m missing? I tried to move some True only rules over to Trigger Happy per @bravenel’s suggestion but I don’t seem to get any events. I can see the events in the logs but nothing happens. I tried a real simple motion active - turn on a light and zero.  
I get lots of this:  
7bd28b97-c304-4929-85e2-f8b0795ec62c 4:25:45 PM: error java.lang.NullPointerException: Cannot get property ‘value’ on null object @ line 726  
7bd28b97-c304-4929-85e2-f8b0795ec62c 4:24:54 PM: error java.lang.NullPointerException: Cannot get property ‘value’ on null object @ line 726  
7bd28b97-c304-4929-85e2-f8b0795ec62c 4:24:43 PM: error java.lang.NullPointerException: Cannot get property ‘value’ on null object @ line 726  
From my understanding these are basic statements without pre-state checking so the fact that the house is in home mode already isn’t stopping it from running the gauntlet - or is it?  
Also, where is the output of the “Enable Event Logging” switch within the trigger?  
TIA

 ![](https://global.discourse-cdn.com/smartthings/original/3X/6/9/699d009be2f1a634df1367f212be7711db6e30b5.png)

---

<div class="post-metadata">

**Author:** ![bravenel](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/bravenel/32/13223_2.png) [@bravenel](https://community.smartthings.com/u/bravenel)\
**Post date:** [December 1, 2015, 12:48am UTC](https://community.smartthings.com/t/deprecated-trigger-happy/29960/80 "2015-12-01T00:48:22Z")

</div>

Looks like a bug to me. Stay tuned, I may already have it fixed…

[Previous page](https://community.smartthings.com/t/deprecated-trigger-happy/29960.md?page=3)

[Next page](https://community.smartthings.com/t/deprecated-trigger-happy/29960.md?page=5)
