Using SmartPower Outlet as siren control?

I’m new to SmartThings and so far have been very happy with the amount of flexibility that the platform provides. I’d like to use the SmartPower Outlet that came with my starter kit to control an alarm bell (an old style mechanical bell powered by 120VAC). I need to convert the device into one that’s recognized by the SmartHome monitor as a siren. Is there an easy and recommended way of doing this other than manually putting together a new device handler starting from the template for the outlet module? I do have some coding experience but I’m also lazy :slightly_smiling:

1 Like

There may be an easier or better method than modifying an existing device handler, but modifying it wouldn’t take much effort.

All you would have to do is create a new Device Handler using the existing device handler as a template.

Add the line below to the capability section:

capability "Alarm"

Add the lines below to the end of the code:

def siren() {
    on()
}
def strobe() {
    on()
}
def both() {
    on()
}

There would be some extra steps if you wanted to fully implement the alarm capability, but the above is all you need in order to make it function.

3 Likes

Thanks! Does that handle cancellations through the SmartHome Monitor app too?

Next question: will this preserve my ability to have the module locally controlled? If not, I assume my only option is to purchase a “real” siren module that’s approved for local control?

Definitely the easiest way, but sometimes not possible if the particular Device Type Handler (DTH) doesn’t have published code or if the DTH has frequent upgrades you want automatically, or if you want the DTH to retain the ability to run locally in your hub with Smart Lighting (or future local SmartApps)…

Thus, the alternative is to create a Virtual Alarm DTH (i.e., add the Capability Alarm and Commands to the generic Virtual/Simulated Switch code.

You then need a simple SmartApp to trigger the real Switch from this Virtual Switch+Alarm.

Eureka!… Since our new Virtual Switch+Alarm offers Switch Capability, it can be used as a Trigger in Rule Machine (or any “Big Switch” / turn-on-with-me SmartApp… ie, no personal SmartApp coding required.

Nope… But see my above post which outlines method so that the outlet will retain local execution when used in fully local SmartApps like Smart Lighting.

So I added the Alarm capability to the template for the outlet module and it works great. Thanks for the code. Only problem is lack of local control, which is kind of important for a siren. Recommendations for a siren that’s locally controllable?

1 Like

I can’t offer a recommendation, though I think Iris and Aeon work…

But I also recommend you / we petition Support@SmartThings.com and @slagle to add basic Switch support as the Alarm Device option to SHM! It’s perfectly reasonable to use a Switch to turn on a light or sound maker as an “Alarm”.

1 Like

[quote=“pswired, post:3, topic:40015”]
Does that handle cancellations through the SmartHome Monitor app too?
[/quote]The cancellation uses the off command and I’m pretty sure the outlet device handler already has the off command implemented.

[quote=“tgauchat, post:5, topic:40015”]
outlet will retain local execution
[/quote]When you create a custom device handler it will not run locally, but virtual devices won’t run locally either so that recommended solution won’t allow it to run locally.

If the outlet is zwave, you could try changing the device type to the Aeon Siren. Since that uses basic on and off commands and supports the Alarm capability it may provide basic functionality for the outlet and still be able to run locally.

The Aeon Siren is local[quote=“tgauchat, post:7, topic:40015”]
to add basic Switch support as the Alarm Device option to SHM! It’s perfectly reasonable to use a Switch to turn on a light or sound maker as an “Alarm”.
[/quote]

Nah, I’m against the “switch” capability becoming even more of a “dumping ground” for devices. The real solution is allowing custom devices to run locally.

1 Like

Assuming the existing Aeon Siren device type I mentioned is able to control the outlet, you can check if it’s running locally by going to:
https://graph.api.smartthings.com/localDevice/list

You can also check which of your applications are running locally by going to:
https://graph.api.smartthings.com/localInstalledSmartApp/list

Yes, BUT: You missed my emphasis, though largely irrelevant in the described scenario admittedly… ie, the unmodified outlet itself will still be eligible for local execution by Smart Lighting. So if the outlet is just a red light that might be also be used by non-Alarm focused local use cases.

I definitely support both options for this scenario (ie, 1. direct modification / Capability adds to the DTH or 2. Synced Virtual Device) because their are pros and cons to both.

But this is an arbitrary distinction! Whose to say that the “Alarm action” triggered by an intrusion or safety event must be restricted to Devices that claim Capability “Alarm”? Turing on a Hue to red – or unlocking the doors when the smoke alarm goes off so neighbors or fire fighters can enter more easily are valid actions, IMHO, and perhaps this reveals a particular weakness to the input device filter based on the Developer’s arbitrary choice to specialized explicit capability.alarm.

Following up here…

I ended up using the Zigbee outlet module from the SmartThings starter kit to control a mechanical bell (think school bell) for use with nonsecurity alerts, such as water leaks and freeze alarms. I set this up using the “alert with lights” feature in the Smart Home Monitor. This should be an all-local solution, which is important for reliability, in my mind.

I’ve picked up a Z-wave outlet module, which I’ll be trying to use for the security siren. New thread for that.

2 Likes

Hope you get an answer cuz I’m trying to do the same thing exactly.

Yes, it worked. I picked up a z-wave in wall outlet (I think it was gocontrol?) and changed the device type to z-wave siren after adding it. System now picks it up as a siren and it works perfectly.

I can’t see where to change the device type. how do I do that?

In the IDE at https://graph.api.smartthings.com/ click on My Devices, then the device name, then edit, then use the “type” dropdown.