# Flashing light

**URL:** <https://community.smartthings.com/t/flashing-light/5394>\
**Category:** Writing SmartApps\
**Created:** [September 30, 2014, 12:18pm UTC](https://community.smartthings.com/t/flashing-light/5394 "2014-09-30T12:18:03Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon32107006](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@anon32107006](https://community.smartthings.com/u/anon32107006)\
**Post date:** [September 30, 2014, 12:18pm UTC](https://community.smartthings.com/t/flashing-light/5394/1 "2014-09-30T12:18:03Z")

</div>

Hi,

Was wondering if they is anyway to flash/blink light (without IFTTT) when a intruder is detected (for exemple when my siren is turned ON) and I’m away

---

<div class="post-metadata">

**Author:** ![scottinpollock](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/scottinpollock/32/67273_2.png) [@scottinpollock](https://community.smartthings.com/u/scottinpollock)\
**Post date:** [September 30, 2014, 1:58pm UTC](https://community.smartthings.com/t/flashing-light/5394/2 "2014-09-30T13:58:05Z")

</div>

> [@Kevin\_Nadjarian](#):
>
> Was wondering if they is anyway to flash/blink light

I know of no way to do this directly with SmartThings as the whole action-hub-cloud-hub-device routing make short on-off-on-off scheduling impractical.

I use a shell script to flash my Hue and GE Link lamps using the Hue API.

---

<div class="post-metadata">

**Author:** ![swanny](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@swanny](https://community.smartthings.com/u/swanny)\
**Post date:** [October 1, 2014, 12:00am UTC](https://community.smartthings.com/t/flashing-light/5394/3 "2014-10-01T00:00:00Z")

</div>

I saw code in a sample app similar to the code below. I use it as part of a SmartApp that flashes the lights when my daughter is in the shower too long. She said it’s works. 😄 It sends all of the on/off commands to the server which then dispatches them with a delay between. This reduces half of the latency that @scottinpollock mentions so it should work reasonable well under normal network conditions.

```
def onFor = 4000
def offFor = 4000
def numFlashes = 3    
switches.each { switch ->
    def delay = 0L
    numFlashes.times {
        switch.off(delay: delay)
        delay += offFor
        switch.on(delay: delay)
        delay += onFor
    }
}

```

It shouldn’t be too hard to create a SmartApp to do what you want with this concept. I’m not sure how many commands you can send with a delay, so you would possibly have to resend the commands using a timer.

---

<div class="post-metadata">

**Author:** ![swanny](https://avatars.discourse-cdn.com/v4/letter/s/ecccb3/32.png) [@swanny](https://community.smartthings.com/u/swanny)\
**Post date:** [October 1, 2014, 12:11am UTC](https://community.smartthings.com/t/flashing-light/5394/4 "2014-10-01T00:11:59Z")

</div>

Found it! Check out “The Flasher” under the main section of example SmartApps. You can likely do what you want with it.

---

<div class="post-metadata">

**Author:** ![anon32107006](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@anon32107006](https://community.smartthings.com/u/anon32107006)\
**Post date:** [October 1, 2014, 9:40am UTC](https://community.smartthings.com/t/flashing-light/5394/5 "2014-10-01T09:40:24Z")

</div>

> [@swanny](#):
>
> nder the main section of example SmartApps. You can

Great thank you !  
Will have a try tonight

---

<div class="post-metadata">

**Author:** ![anon32107006](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@anon32107006](https://community.smartthings.com/u/anon32107006)\
**Post date:** [October 4, 2014, 8:16pm UTC](https://community.smartthings.com/t/flashing-light/5394/6 "2014-10-04T20:16:38Z")

</div>

I actually find an officiel pre-insateld smartapps.

click “+” “Motion Sensors” “Aeon Labs Multi-Sensor” “Top Alerts and Actions” “Flash a set of lights in response to motion, an open/close event, or a switch”

Just don’t know why is not on the main menu but its work great.

---

<div class="post-metadata">

**Author:** ![Goldndoodle](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/goldndoodle/32/12593_2.png) [@Goldndoodle](https://community.smartthings.com/u/Goldndoodle)\
**Post date:** [October 6, 2014, 12:01pm UTC](https://community.smartthings.com/t/flashing-light/5394/7 "2014-10-06T12:01:18Z")

</div>

I was looking for something like that to happen with the SMART ALARM smart app. I just linked a bunch of lights on the house, and in the house to flash when one of the Sirens is activated by Smart Alarm.

---

<div class="post-metadata">

**Author:** ![jmdaly](https://avatars.discourse-cdn.com/v4/letter/j/f08c70/32.png) [@jmdaly](https://community.smartthings.com/u/jmdaly)\
**Post date:** [January 3, 2015, 5:04pm UTC](https://community.smartthings.com/t/flashing-light/5394/8 "2015-01-03T17:04:02Z")

</div>

Hi guys,

I’m looking for a way to cycle some lights at a particular time (to remind myself to go to bed). I found the Flash Some Lights smart app that was mentioned above, but there doesn’t seem to be a way to trigger flashing based on time. Does anyone know if there’s a straightforward way to do this?

I’ve never written a smart app, but I have a background in writing software, so if there isn’t already a built-in way, I might try modifying what’s already available.

---

<div class="post-metadata">

**Author:** ![Mike\_Maxwell](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/mike_maxwell/32/18673_2.png) [@Mike\_Maxwell](https://community.smartthings.com/u/Mike_Maxwell)\
**Post date:** [January 3, 2015, 5:22pm UTC](https://community.smartthings.com/t/flashing-light/5394/9 "2015-01-03T17:22:04Z")

</div>

If you’re using AEON micros (dimmers or switches) they have a built in configurable hardware blink function.  
I implemented this in a device and smart app I wrote for them:

> **[MikeMaxwell/smartthings](https://github.com/MikeMaxwell/smartthings)**
>
> all my smartthings stuff

---

<div class="post-metadata">

**Author:** ![Sticks18](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@Sticks18](https://community.smartthings.com/u/Sticks18)\
**Post date:** [January 3, 2015, 7:51pm UTC](https://community.smartthings.com/t/flashing-light/5394/10 "2015-01-03T19:51:11Z")

</div>

If they’re GE Links, you can just send the identify command and they’ll blink like whenn the bulb joins the hub. Send the command again and they’ll stop.

Should be easy to incorporate that into a SmartApp.

---

<div class="post-metadata">

**Author:** ![kg4fku](https://avatars.discourse-cdn.com/v4/letter/k/85e7bf/32.png) [@kg4fku](https://community.smartthings.com/u/kg4fku)\
**Post date:** [January 3, 2015, 8:16pm UTC](https://community.smartthings.com/t/flashing-light/5394/11 "2015-01-03T20:16:53Z")

</div>

How do you send those commands?

---

<div class="post-metadata">

**Author:** ![Sticks18](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@Sticks18](https://community.smartthings.com/u/Sticks18)\
**Post date:** [January 3, 2015, 10:28pm UTC](https://community.smartthings.com/t/flashing-light/5394/12 "2015-01-03T22:28:28Z")

</div>

In the device type, the command would be:

“st cmd 0x${device.deviceNetworkId} 1 3 0 {0001}”

That would start the blinking. To stop the blinking use 0000 in the payload portion (ending brackets). The payload is supposed to be the time in seconds for it to blink and it should decrement that until it gets to zero, but in my testing it didn’t work and I had to manually send the command with 0000 to stop the bulb.

If you’re triggering this command from outside the device, you might have to change how you pull in the deviceNetworkId. That’s the 4 digit Id given to the bulb by the hub and is used to address the command to the right bulb.

---

<div class="post-metadata">

**Author:** ![jmdaly](https://avatars.discourse-cdn.com/v4/letter/j/f08c70/32.png) [@jmdaly](https://community.smartthings.com/u/jmdaly)\
**Post date:** [January 5, 2015, 1:39am UTC](https://community.smartthings.com/t/flashing-light/5394/13 "2015-01-05T01:39:14Z")

</div>

Thanks for the suggestions! I ended up modifying The Flasher to also flash lights at particular times. It was really straightforward, and seems to be working. For anyone who’s interested, the code is here:

> <https://gist.github.com/jmdaly/02367112114ce1dbe972>

---

<div class="post-metadata">

**Author:** ![driza](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@driza](https://community.smartthings.com/u/driza)\
**Post date:** [January 22, 2015, 10:18pm UTC](https://community.smartthings.com/t/flashing-light/5394/14 "2015-01-22T22:18:51Z")

</div>

Im a bit late to the party on this one, and fairly new to smartthings, but was wondering if anyone could advise me on how (if possible) to direct my hue bulbs in my foyer to flash “RED” like an alarm when motion is detected when my system is in Night or Away mode. Has anyone done something like this with Hue?

---

<div class="post-metadata">

**Author:** ![Midskier](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/midskier/32/13501_2.png) [@Midskier](https://community.smartthings.com/u/Midskier)\
**Post date:** [January 24, 2015, 4:34pm UTC](https://community.smartthings.com/t/flashing-light/5394/15 "2015-01-24T16:34:09Z")

</div>

Kevin, this app is “The Flasher” also modded by John (which works great by the way). I use it as a round about way to flash my outdoor lights when smart alarm is triggered. I have it set to flash when one of my smart outlets is turned on. Additionally I increased the time on and time off to 1.5 seconds (1500 ms) and still adjusting the # flashes 60 = 1 minute. If I really do have an alarmed event I just assume they keep flashing until I manually turn them off … still thinking about this. Thanks! Dan T

---

<div class="post-metadata">

**Author:** ![zj4x4](https://avatars.discourse-cdn.com/v4/letter/z/aca169/32.png) [@zj4x4](https://community.smartthings.com/u/zj4x4)\
**Post date:** [January 24, 2015, 7:50pm UTC](https://community.smartthings.com/t/flashing-light/5394/16 "2015-01-24T19:50:51Z")

</div>

@jmdaly Got a bit of a chuckle from this. I love automating things but I’ve never considered automating something to tell me when to go to bed. So far clocks (usually the one on my phone) and/or my brain/body are the most useful way to figure this out. 😉

---

<div class="post-metadata">

**Author:** ![bayhuntr](https://avatars.discourse-cdn.com/v4/letter/b/f14d63/32.png) [@bayhuntr](https://community.smartthings.com/u/bayhuntr)\
**Post date:** [June 10, 2015, 12:02am UTC](https://community.smartthings.com/t/flashing-light/5394/17 "2015-06-10T00:02:28Z")

</div>

Wanting to have lights flash as long as the garage door is open. I’ve got them to flash for a set number of times ehen it opens, but it’s not related to when or if it closes. Any ideas?

---

<div class="post-metadata">

**Author:** ![ADamL](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@ADamL](https://community.smartthings.com/u/ADamL)\
**Post date:** [August 30, 2015, 2:00am UTC](https://community.smartthings.com/t/flashing-light/5394/18 "2015-08-30T02:00:51Z")

</div>

I modified your modifications to add support for moisture sensors.

> <https://gist.github.com/lyonsad/6c73b7314e5123d2aeeb>

---

<div class="post-metadata">

**Author:** ![lmosenko](https://avatars.discourse-cdn.com/v4/letter/l/a698b9/32.png) [@lmosenko](https://community.smartthings.com/u/lmosenko)\
**Post date:** [October 14, 2015, 3:01pm UTC](https://community.smartthings.com/t/flashing-light/5394/19 "2015-10-14T15:01:55Z")

</div>

I know this is a not the Halloween thread, but in preparation for the Big day, is there a way to mod this Flasher app to get triggered by motion sensor and at specific time/Mode change? Can some one mode this? Greatly appreciate.

---

<div class="post-metadata">

**Author:** ![David\_Solis](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/david_solis/32/97090_2.png) [@David\_Solis](https://community.smartthings.com/u/David_Solis)\
**Post date:** [October 21, 2015, 8:34pm UTC](https://community.smartthings.com/t/flashing-light/5394/20 "2015-10-21T20:34:18Z")

</div>

Pretty new to developing for this. I have been able to make a couple tiny changes to some other apps.

For the Flasher, I would like to add a “Days of the Week” option, so that it only runs on certain days.

I cant seem to wrap my head around scheduling for that specific scenario, can anyone offer some clues on how to add such an option?

Thanks!

[Next page](https://community.smartthings.com/t/flashing-light/5394.md?page=2)
