Preventing Alarm from arming with an open window

Hi,
I’m new to this community and I’m fairly new to Home Assistant as well.
I’m working on a project for an alarm system involving Arduino and my old wired system.

I’m having issues in preventing the alarm from arming when one of the window is open

Below is the automation that I use.
When the alarm transitions from pending to armed_away, if the pin 6 is on (window open) the action disarms the alarm

- id: '1589060449306'
  alias: Notifica Finestre Perimetrali Aperte
  description: ''
  trigger:
  - entity_id: alarm_control_panel.home_alarm
    from: pending
    platform: state
    to: armed_away
  - entity_id: alarm_control_panel.home_alarm
    from: pending
    platform: state
    to: armed_home
  condition:
  - condition: state
    entity_id: binary_sensor.arduino_pin_d6_av_triggered
    state: 'on'
  action:
  - delay: 00:00:02
  - data: {}
    entity_id: alarm_control_panel.home_alarm
    service: alarm_control_panel.alarm_disarm

When it triggers and the condition is true the alarm is not set to disarmed as I would expect.
(Please note that any other action works so I assume the issue is with the action).

I also tried replacing the above action with the following variant including the code that I have set up in the configuration, but with no success:

  action:
  - delay: 00:00:02
  - data:
      code: '12345'
      entity_id: alarm_control_panel.home_alarm
    entity_id: alarm_control_panel.home_alarm
    service: alarm_control_panel.alarm_disarm

Some help would be greatly appreciated. Thanks

HI,

so I got it sorted with my indicated action on the bottom.
I think I had another condition that was conflicting with the above indicated condition.
Sorry for the posting something that I then fixed by myself…however I will come shortly with another issue :sweat_smile: