Siren Activation/Manual Alarm Fails to Trigger

Howdy everyone. I’m new to Konnected and HA. I’ve already fouled up one install so I’ve re-imaged the Rasp. Pi and started from scratch. Everything is hooked up and HA sees all the sensors. It also registers ‘open’ and 'closed" states almost instantly. While that all works fine and I can arm and disarm, it does not translate an open sensor (door or window) into a triggered alarm. The Pi along with all 4 Konnected boards have static IPs/ports and I’ve indicated that in the config. I’m on v0.91.3. Host OS is v2.11

Do these automations look right? Any suggestions are appreciated. Thanks.

############################
###Konnected Alarm Activation###
 - alias: 'Trigger alarm while armed away'
    trigger:
    - platform: state
      entity_id: binary_sensor.laundry_door
      to: 'open'
    - platform: state
      entity_id: binary_sensor.kitchen_1
      to: 'open'
    - platform: state
      entity_id: binary_sensor.kitchen_2
      to: 'open'
    - platform: state
      entity_id: binary_sensor.living_2
      to: 'open'
    - platform: state
      entity_id: binary_sensor.living_3
      to: 'open'
  condition:
    - condition: state
      entity_id: alarm_control_panel.home_alarm
      state: armed_home
    action:
      service: alarm_control_panel.alarm_trigger
      entity_id: alarm_control_panel.home_alarm

############################
###Konnected Alarm Siren On###
  - alias: 'Activate siren when alarm triggered'
    trigger:
      - platform: state
        entity_id: alarm_control_panel.home_alarm
        to: 'triggered'
    action:
      - service: switch.turn_on
        entity_id: switch.siren
        
############################
###Konnected Alarm Siren Off###
  - alias: 'Deactivate siren when alarm turned off'
    trigger:
      - platform: state
        entity_id: alarm_control_panel.home_alarm
        to: 'disarmed'
    action:
      - service: switch.turn_off
        entity_id: switch.siren

CONFIG

#Initialize Alarm Panel
alarm_control_panel:
  - platform: manual
    name: Home Alarm
    code: xxxx
    pending_time: 30
    delay_time: 20
    trigger_time: 60
    disarmed:
      trigger_time: 0
    armed_home:
      pending_time: 0
      delay_time: 0

#Konnected Sensors
konnected: 
      access_token: xxxxxxx
      devices:
        - id: xxxxxxxxxx
          host: xxx.xxx.xxx.xx
          port: xxxxx
          discovery: false
          binary_sensors:
            - zone: 1
              type: door
              name: 'Laundry Door'
            - zone: 2
              type: window
              name: 'Kitchen 1'
            - zone: 3
              type: window
              name: 'Kitchen 2'
            - zone: 4
              type: door
              name: 'Living Room 2'
            - zone: 5
              type: window
              name: 'Living Room 3'
          switches:
            - zone: out
              name: siren

Are your automations turned on?

Yep…Untitled

Not sure which sensors you use but my automations use ‘off’ and ‘on’ instead of ‘open’ and ‘closed’

Good question. The entity filter states show “on” or “off” but if you click on one it shows “Closed” or “Open”.

I just tried changing one sensor to off/on and tested…same problem.

Might be a bad question but I have to ask, are you reloading the automations after making the changes?

Yep, I restart everything actually. Do you mean something else by “reloading”?

Just the “Reload Automations” in the Config Panel.

I also just noticed something, may just be the post but your actions section of the automation is not indented properly

Your very first statement has an improper indenting layout.

condition:
    - condition: state
      entity_id: alarm_control_panel.home_alarm
      state: armed_home
    action:
      service: alarm_control_panel.alarm_trigger
      entity_id: alarm_control_panel.home_alarm

The word ACTION and the code below it is indented two extra spaces. This may be preventing the alarm from actually going into the alarmed state. Many times simple syntax can be a real pain to spot and it causes major headaches. Hope this solves your issue.

I think that may have been formatting on here. This is how it actually looks:

Untitled

How about the alarm state, does it turn to triggered and the siren doesn’t come on? or does it not even go into triggered state?

1 Like

Doesn’t even go into triggered state at all.

Hmm, comparing your config to mine I noticed a slight deviation but it may be caused by me using the UI rather than YAML.

Here’s what my action looks like:

action:
- data:
    entity_id: alarm_control.home_alarm
  service: alarm_control_panel.alarm_trigger
1 Like

Yea…I don’t think I need that - data: line in there…not sure.

I don’t think you do either but worth a shot. Also maybe try adding something know to work to the action like create a persistent notification or turn on a light, just to test if the sensors are actually triggering the automation or if it’s the action that’s borked

1 Like

Do I have all the dashes " -" in the right place? Are they needed before condition and service?

I don’t see anything out of place, anything in the logs? Or try to run the Check Config and see if it shows anything out of place

1 Like

Yea…nothing in the logs and check config is valid.

airbur, In looking at the code for my alarm, I noticed something else in your code. ALL my binary_sensor.{device_name} devices only report ON or OFF, and not OPEN or CLOSED. You may want to check that you are looking for the correct transition value in your initial trigger statements. Other that this, your code looks like it SHOULD work. As a last resort, build a simple test automation and verify one piece of your code at a time. Keep it simple and succinct. Verify that the code does that one thing correctly every time then test the next part. Somewhere along the chain of events, you’ll discover the problem. Good luck.

1 Like

Binary sensors only report 'on' and 'off' to the backend no matter what they display in the frontend (open/closed, full/empty etc…). Make sure you include the quotes and that you use lower case letters only.

1 Like