Hey guys, I’m using Home Assistant to set alarms on my phone and its working fine. I can set alarm time with a message using this string in my yaml file:

"android.intent.extra.alarm.HOUR:{{8}},android.intent.extra.alarm.MINUTES:{{15}},android.intent.extra.alarm.SKIP_UI:true,android.intent.extra.alarm.MESSAGE:Take Medication"

Now I’d like to add a daily repeat or for example repeat every Wednesday. From the same source I found it should be possible using EXTRA_DAYS. I couldn’t find any example so I was trying every combination that came to my mind like:

android.intent.extra.alarm.DAYS:{{Calendar.SATURDAY, Calendar.WEDNESDAY}}
android.intent.extra.alarm.DAYS:{{ [Calendar.SATURDAY, Calendar.WEDNESDAY] }}
android.intent.extra.alarm.DAYS:[Calendar.SATURDAY, Calendar.WEDNESDAY]
etc.

How to shape that android.intent.extra.alarm.DAYS properly? Documentation says the values should be ArrayList<Integer>:

Documentation is on this link

  • Gray@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    This may be a really basic question, but the regular android clock app can set recurring alarms already right? What is the added value of using home assistant externally?

    • rambos@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      Question is fine, I get added value from HA, but still probably overkill or maybe even bad idea :D time will tell…

      I am using alarms as medication reminders at the moment and it is working fine of course, but I wanted something more advanced due to very complex medication schedule. I tried google calendars and tasks, but it is pain to manage that with not much benefit. I also tried some other android medication reminders and some of them are almost perfect, but I guess I became quite demanding. I don’t have a knowledge to create android app or anything that works standalone and I had homeassistant running some simple automations already on home server.

      So probably not the best approach but I couldn’t think of any better (for now) to get these features (mostly working, but still work in progress):

      1. Pill counter - it counts down pills so I can see how many I should have (also to confirm I took a pill in case I forgot - happens sometimes)
      2. Pill reminder - Android Alarm or Home Assistant android app notifications (notifications work fine, but kinda useless without internet)
      3. Reorder reminder - e-mail notification if it’s time to reorder
      4. Nice overview in dashboard

      Feature 2 seems easy, but creating alarm every 2 days already involves tasks/reminders or some other app. I’m trying out this thing with home assistant and google clock on android and it looks promising. Will look for more alternatives like calendar at one point. Even like this, server can send alarm commands every morning for whole day, but would be nice to make schedule in case I lose connection to my server for more than 1 day or something.

        • rambos@lemmy.worldOP
          link
          fedilink
          English
          arrow-up
          1
          ·
          1 year ago

          Thanks for link, but yes I have. That’s the one I actually found first for HA and it is super nice. It is impossible to set reminder every 2 days for example unfortunately. I figured how to make my own automation with that option, but as I said above, notifications are working most of the time, and not if your phone has no signal (basement or airplane mode). That’s why I’m testing out notification alternatives. I was looking how to make a blueprint, but they don’t support all perks I want in my automation so I had to stick with packages.

      • Gray@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        There’s a LOT of medication apps already available, seems like a lot of work to create one from scratch, no?

        • rambos@lemmy.worldOP
          link
          fedilink
          English
          arrow-up
          1
          ·
          1 year ago

          Hehe yeah, it is lot of work, but most of that is done already. I agree there are many apps available and I spent a lot of time testing them. Still looking for perfect solution and that is where the idea came from. I could use an app or I could just stick with google reminder/task/alarm/calendar, but I also enjoy playing around and learning new things. Its kinda my hobby. If my dream comes true and I finish this it will beat all apps xD