How to turn off/on phone alarms?

I have a Samsung S20+ with the companion app installed, 4 or 5 alarms for waking up in the morning M-F for work, and in google calendar I have an all day event named WFH (Work from Home).

I use the WFH event to control things in the mornings when I am working, but on holiday’s/vacation I delete the event so that those things don’t happen.

I would also like to use the sensor I created to tell my phone to turn off the work alarms, but so far haven’t found a way to do this, any help would be greatly appreciated.

I haven’t found a way yet to turn off an alarm but I can set an alarm.

Here is the script I use:

mobile_app_notification_command_set_alarm:
    alias: My Mobile App Android Notification Command Set Alarm
    mode: restart
    sequence:
      - service: notify.mobile_app_my_mobile_app
        data:
          message: "command_activity"
          data:
            intent_action: android.intent.action.SET_ALARM
            intent_extras: >-
              {% set timelist = states('input_datetime.ma_my_alarm_set_time').split(':') %}
              {% set timehour = timelist[0] %}
              {% set timemin = timelist[1] %}
                android.intent.extra.alarm.HOUR:{{ timehour }},android.intent.extra.alarm.MINUTES:{{ timemin }},android.intent.extra.alarm.SKIP_UI:true

then you can call the script with whatever trigger you need.

Supposedly there was some way that someone posted to remove an alarm but I don’t think it works. I haven’t gotten it to work yet.

Sleep as Android should let you completely control the alarm using intents.

Hi!

Has anybody implemented the disable alarm feature from Sleep as Andoid and can share an example?

Disable Alarm (when not currently ringing)

com.urbandroid.sleep.alarmclock.ALARM_STATE_CHANGE

  • Extras:

    • alarm_label: String representing a label of alarm to be changed. If there are more such alarms, only one of them is going to be changed (no guarantees which).
    • alarm_enabled: Boolean saying whether alarm should be enabled or disabled.

Anyone know how to turn off an alarm in https://play.google.com/store/apps/details?id=hdesign.theclock&hl=da&gl=US

(i can set an alarm)