How to schedule an automation to disarm alarm?

My AlarmSystem automation is armed every time for 10 minutes it do not recognize any smartphone connected both via wifi and bluethoot and anyone is detected from human presence sensors.
So when we are not at home it is always armed in away mode.
I wish to schedule a event to disarm it automatically in a specific day for some hours (e.g. every saturday between 10:00 to 12:00).
How I can do it?
Is possible to do it with a graphical form on the dashboard?

The alarm clock thread does what you want to do I think…

very interesting… but I need to disarm alarm (the service is: alarm_control_panel.alarm_disarm) between a time range (e.g. 10:00 and 12:00 of tuesday)

So , why can’t you use the alarm clock for that as it has sliders for setting the time and checkboxs for weekdays etc, then an automation to automatically call the action that you want??? (which is your service call)

When any people are at home and device_tracker do not recognize anyone after 10 minutes arm alarm system.
I wish to disarm it every tuesday from 10:00 to 12:00

the service call will be:

    action:
      service: alarm_control_panel.alarm_disarm
      data: {"entity_id":"alarm_control_panel.ha_alarm","code":"12345"}

If it’s always a static dis-arm day and time just create an automation based on time tuesday, with a condition of 10-12 and the action as you have stated.

It might be a bit more complicate than that. E.g., @vpomax, do you want to always disarm at a particular time on a particular day, or do you want the day and/or time to be specified by some GUI element so that it can be adjusted? When the alarm is disarmed, do you need to remember its state so that it can be set back the way it was at the end of the time period, or do you always just want to re-arm it at that point? To make any useful suggestion you need to be a bit more specific about what you want.

even without GUI interface I wish always disarm it at a particular time (from hour X to hour Y) on a particular day… even if anyone is detected from device_tracker… and at the end of time it have to re-arm alarm

So add a delay after the first service call to wait for 2hrs and then call the service to re-arm.

1 Like

in this way?

- alias: Disarm alarm on tuesday
    trigger:
      platform: time
      hours: 10
      minutes: 00
      seconds: 00
    condition:
      condition: and
      conditions:
        - condition: time
          weekday:
            - tue
        - condition: state
          entity_id: group.family
          state: 'not_home'
    action:
      - service: alarm_control_panel.alarm_disarm
        data: {"entity_id":"alarm_control_panel.ha_alarm","code":"12345"}
      - delay: 02:00
      - service: alarm_control_panel.alarm_arm_away
        data: {"entity_id":"alarm_control_panel.ha_alarm","code":"12345"}

I would probably do it day then condition time as otherwise HA will check every day at 10am rather than on Tues then 10am - but yep that should work :slight_smile:

For your trigger, it’s a bit simpler to put something like this:

trigger:
  platform: time
  at: '10:00:00'

Also for your delay you may need to use quotes around 02:00, but I’m not sure about that.

Also, I think the data for the service calls may need to be formatted a little differently. But I’m pretty new so maybe not. Here’s what I would start with:

- alias: Disarm alarm on tuesday
  trigger:
    platform: time
    at: '10:00:00'
  condition:
    condition: and
    conditions:
      - condition: time
        weekday:
          - tue
      - condition: state
        entity_id: group.family
        state: 'not_home'
  action:
    - service: alarm_control_panel.alarm_disarm
      data:
        entity_id: alarm_control_panel.ha_alarm
        code: 12345
    - delay: '02:00'
    - service: alarm_control_panel.alarm_arm_away
      data:
        entity_id: alarm_control_panel.ha_alarm
        code: 12345
1 Like

Is this correct? exist a trigger time with weekday?

- alias: Disarm alarm on tuesday
    trigger:
      platform: time
      weekday:
        - tue
    condition:
      condition: and
      conditions:
        - condition: time
          after: '10:00:00'
        - condition: state
          entity_id: group.family
          state: 'not_home'
    action:
      - service: alarm_control_panel.alarm_disarm
        data: {"entity_id":"alarm_control_panel.ha_alarm","code":"12345"}
      - delay: 02:00
      - service: alarm_control_panel.alarm_arm_away
        data: {"entity_id":"alarm_control_panel.ha_alarm","code":"12345"}

Honestly, I can’t see how that would work. First, I’m not even sure if the time trigger has an option for day. But even if it did, it would trigger at the beginning of the day, and of course, the condition wouldn’t be true. I think you have to trigger at the time, and the check the day as a condition.

ok, then I will use the previous automation… many thanks @pnbruckner and @keithh666 your support was very useful for me

Did the action part work with this script?