SmartThings Community

[Release] SHM Delay Version 2.0

smartapp_security

(Todd Raymond) #739

Question regarding Buzzer Switch.

My Konnected buzzer does beep when the exit delay starts…It does a standard 3 beep tone. However it only does this once during the exit delay. So if the delay is 45 seconds…you only get the beep notification for about the first 2 seconds of it.

How do I make the buzzer beep constantly during the exit and entry delay?

Thanks in advance!


(Arn B) #740

I don’t have Konnected devices. The app issues simple on / off commands, so any control would be on the Konnected side.

I beleive the last time I looked at the Konnected DTH for this device there was no option for duration. Feel free to correct me if this is wrong or has changed.


(Todd Raymond) #741

It looks like it has two different modes…one is device.switch…the other is device.alarm. It looks like you are triggering the switch mode (on and off). I can define how long a beep lasts, however, I can’t think of any workable scenario with the switch (Beep) mode. If you could use the alarm mode, then you could trigger the constant alarm and leave it on until the delay had completed at which point you could turn it off.

I’d play with your code, however I’m so new to this, I’m still trying to understand it all. I’ve attached the DTH for konnected’s beeper below.

Suggestions?

Thanks in Advance!!

/**
 *  Konnected Beep/Blink
 *
 *  Copyright 2017 konnected.io
 *
 *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 *  in compliance with the License. You may obtain a copy of the License at:
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
 *  on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the specific language governing permissions and limitations under the License.
 *
 */

metadata {
  definition (name: "Konnected Beep/Blink", namespace: "konnected-io", author: "konnected.io", mnmn: "SmartThings", vid: "generic-switch") {
	capability "Alarm"
    capability "Switch"
    capability "Actuator"
    capability "Momentary"
    capability "Tone"
  }

  preferences {
    input name: "invertTrigger", type: "bool", title: "Low Level Trigger",
          description: "Select if the attached device or relay uses a low-level trigger. Default is high-level trigger"

    // settings for momentary beep
    input name: "beepDuration", type: "number", title: "Beep Pulse (ms)",
      description: "Each beep or blink duration", range: "10..*"
    input name: "beepPause", type: "number", title: "Beep Pause (ms)",
      description: "Pause between beeps/blinks in milliseconds", range: "10..*"
    input name: "beepRepeat", type: "number", title: "Beep Repeat",
      description: "Times to repeat the pulse", range: "1..*"

	// settings for infinately repeating alarm
    input name: "alarmDuration", type: "number", title: "Alarm Pulse (ms)",
      description: "Tone duration in alarm", range: "10..*"
    input name: "alarmPause", type: "number", title: "Alarm Pause (ms)",
      description: "Pause between tones in alarm", range: "10..*"
  }

  tiles(scale: 2) {
    standardTile("beep", "device.switch", width: 6, height: 4, canChangeIcon: true, decoration: "flat") {
      state "off", label: 'Beep', action: "tone.beep", icon: "st.alarm.beep.beep", backgroundColor: "#ffffff", nextState: "pushed"
      state "on", label: 'Beep', action: "tone.beep", icon: "st.alarm.beep.beep", backgroundColor: "#00a0dc"
      state "pushed", label:'pushed', action: "tone.beep", icon: "st.alarm.beep.beep", backgroundColor:"#00a0dc", nextState: "off"
    }
    standardTile("alarm", "device.alarm", width: 2, height: 2, decoration: "flat") {
      state "off", label: "Off", action: "alarm.siren", icon: "st.security.alarm.clear", nextState: "turningOn"
      state "siren", label: "Alarm", action: "alarm.off", icon: "st.security.alarm.alarm", backgroundColor: "#e86d13", nextState: "turningOff"
      state "turningOn", label:'Activating', icon:"st.security.alarm.alarm", action:"alarm.off", backgroundColor:"#e86d13", nextState: "turningOff"
      state "turningOff", label:'Turning off', icon:"st.security.alarm.clear", action:"alarm.siren", backgroundColor:"#ffffff", nextState: "turningOn"
    }
    main "beep"
    details "beep", "alarm"
  }
}

def updated() {
  parent.updateSettingsOnDevice()
}

def updatePinState(Integer state) {
  if (state == -1) { // represents an infinate alarm activated
    sendEvent(name: "alarm", value: "siren")
  } else if (state == triggerLevel()) {
    sendEvent(name: "switch", value: "on", isStateChange: true, display: false)
    sendEvent(name: "switch", value: "off", isStateChange: true, display: false)
  } else {
    sendEvent(name: "alarm", value: "off")
  }
}

def off() {
  def val = invertTrigger ? 1 : 0
  parent.deviceUpdateDeviceState(device.deviceNetworkId, val)
}

def on() {
  beep()
}

def push() {
  beep()
}

def beep() {
  parent.deviceUpdateDeviceState(device.deviceNetworkId, triggerLevel(), [
    momentary : beepDuration ?: 250,
    pause     : beepPause ?: 150,
    times     : beepRepeat ?: 3
  ])
}

def siren() {
  parent.deviceUpdateDeviceState(device.deviceNetworkId, triggerLevel(), [
    momentary : alarmDuration ?: 55,
    pause     : alarmPause ?: 45,
    times     : -1
  ])
}

def both() {
  siren()
}

def triggerLevel() {
  return invertTrigger ? 0 : 1
}

def currentBinaryValue() {
  invertTrigger ? 1 : 0
}

(Arn B) #742

Try changing the “on” commands to “both”
That should trigger the unlimited siren then shut it with the off command.


(Todd Raymond) #743

Worked perfectly!!! Exactly what I was looking for. Thanks!!


(Arn B) #744

[Update] SHM Delay BuzzerSwitch Version 1.1.0, Jan 01, 2019 10:45 EDT

Enhancements and Changes

  • Issue: When using a Konnected Buzzer the tone does not last for the exit or entry time
  • New Option: Issue long beep for devices with "both’ command, usually Konnected Buzzers or alarms.
    Other devices without the both command : switches, bulbs, etc, should not be impacted.

How to Install
There is one (1) module associated with this update. When updating from Github, in the IDE change for each module shown below, insure you are using the arnbme SHMDelay Version2 repo for all modules

  1. SHM Delay BuzzerSwitch (v1.1.0). Module must be Saved, then Published
  • Install via the repository (preferred), from the following repo.
    Owner: arnbme (in upper case that is ARNBME)
    Name: SHMDelay
    Branch: Version2

(Todd M) #745

I only have this available in the SHMDelay (beta) repo.


(Arn B) #746

V1.1.0 of BuzzerSwitch is in the Version2 and beta repos.


(Todd M) #747

Do I need the SHMDelay (beta) repo anymore? Can I just use the SHMDelay Version2 repo?


(Arn B) #748

SHM Delay modules should be sourced from the Version2 repo. beta is used for testing updates prior to the module being released and moved into the Version2 repo. You may keep both repos in your settings.


#749

I’m having an issue setting up a test before implementing this into my Konnected alarm system with real sirens, etc. I have added a Simulated contact sensor, and have set correct monitoring for it in SHM, however, it is never triggered after the delayed time period specified. Real contact sensor is indicated as Real Garage CS and the simulated is indicated by SimGarageCS.


(Arn B) #750

I understand you are encountering an issue and will do my best to help resolve it.

Please post exactly what is not triggered, and is this an exit or entry delay?


#751

The simulated contact sensor is never triggered open upon failure to disarm within the time delay after the real contact sensor(a door) is opened. After opening the door, the buzzer begins to beep for its specified time, but the simulated and delayed contact sensor never opens/triggers an intrusion in SHM.


(Arn B) #752
  1. Please go into your phoneapp and clear any outstanding prior intrusion alerts, then retry,
  2. If no existing uncleared intrusion alerts, arm the SHM (any mode), then in the phone app tap the SimGarageCs to open it, should create an instant alarm. Essentially, Follow general system debugging rules in section 15 or the documentation

#753

This seemed to have done the trick! Many thanks!!


(Juan Flores) #754

@arnb Wanted to thank you for the detailed instructions and making it easy to setup my Centralite Keypad. I would have struggled and probably sent it back to Amazon :grin:

I was able to connect it to my ST and get it working with all the bells and whistles you offered in your app. I did have a question that I couldn’t find an answer to (read each post on both pages to make sure) On the keypad, there’s the extra two buttons On Series-3, the buttons on each side of the Zero with the police badge image. Are they set up as Panic buttons already? (haven’t tried pressing them yet, don’t want to wake her up.)Can I set those up to be a different SHM\Routine? I know i can setup a pin for a specific Routine but I’m trying to make it easy for my Wife.

I also noticed that when I go into Global Settings and tap on the “Add 3 digit emergency call number…” my iphone screen goes black and ClassicApp crashes back to the Home Screen. Is this a first for this issue or aware of it?


(Arn B) #755

I’m not familiar with that keypad setup, please post a photo. My Centalite has an A and B on either side of the 0 key, both do nothing and send nothing.

Edit. Found an image on the centralite site and the datasheet says nothing about the keys.
try pressing one or both of them when you can.

Sorry you are encountering this issue, but this is an Enum field, select a number from a dropdown, no typing allowed. I have no idea what is wrong. Just worked Ok on my Android phone app. Perhaps a call to support?

I can suggest one thing: one of the selections is, “”, (double quote) allowing the field to be cleared. Take a look around line 233 or SHM Delay, try removing the ,"" it from the code or perhaps change it to " ". (add a space between the quotes.) Save then pubhish for me after any changes. The field is used only on the intrusion message so it can’t hurt any logic.


(Arn B) #756

Regarding the Centralite V3 it states

" Wireless ZigBee Home Automation 1.2 Features built-in ZigBee repeater. " This seems odd for a battery powered device.

Tagging @RBoy


(www.rboyapps.com - Make your home your butler!) #757

No it doesn’t have a repeater. We’re working with Centralite on this one. Keep you eyes peeled for an update. It got some interesting stuff.

EDIT: working on a something special for the community :slight_smile:


(Juan Flores) #758

So it turns out pressing and holding both keys activates the Panic Mode, keypad lights turned red and received an alert on the SHM stating that “SimContact (front door) intrusion detected” and a text message stating “Panic issued by Thing by (SHM Delay App) at Home” Not sure why it called it “Thing” when I have it labelled Keypad. Pressing either button on their own doesnt do anything.

Thank you! Removing the double quote on line 233 allowed me to select my option; the space between them didnt work.

Keep up the great work you have been doing with SHM Delay! Thank you!!