Get wake up alarm from a phone?

Hi, the best tip i can give is to use my above example and then replace it with different sensors or switches that you want to control. The JSON you can find out in the HomeAssistant Services Tab (the little remote in the bottom left corner).

Here you can find all the services (Which will also end up in the URL you are calling) and you can try out several different json configurations until you find exactly what works :slight_smile:

Thank you so much for the help

Too easy looks like automate has a seperate box for the request header then I would just put in the request content the Json code to toggle the Boolean switch.

This is going to open up so many possibilities for me now as I will have a simple and autonomous way for HA to know that I’m sleeping and not to switch on the lights and open the shutters if my partner’s alarm goes off haha.

Thanks again

Have you got an example to show me? I am planning to test the following when I get home. The message is the alarm time in plain text HH:MM (but can also be HH:MM:SS)

- alias: Set alarmtime_from_tasker
  trigger:
    platform: mqtt
    topic: "tasker/phone_alarm_time"
  action:
    service: input_date.set_value
    entity_id: input_datetime.wakeup_time
    data:
      time: '{{ trigger.payload}}'

Just use the example that i wrote further up.
I use this as JSON to Push the correct time:
{“state”: dateFormat(Wake, “HH:mm, yyyy-MM-dd”)}

The Format of course depends on the way you implement your alarm.

Can you share this flow for automate? Thanks.

still can’t get this to work i get a 401 error even though i’ve included the token. could it be because of 2 step authentication?

no matter works with automate just not http shortcuts app

Hi!
I tried out automate today and when I try to post {“Authorization”: “Bearer XXXXXXXXXX” } into the request header area I get: illegal character.:
Is it changed again?

Still works for me. Cannot reproduce your error. Maybe check formatting again.

I found the error… in the example stated earlier in the thread you posted

Request Header: {“Authorization”: “Bearer YOURLONGACCESSTOKEN” }

So I just copy-pasted that one and in that post its ” instead of " :stuck_out_tongue:

But now its working. :slight_smile:

1 Like

Just stumbled upon this android app that creates a sensor with your next alarm if anyone’s interested

2 Likes

Thanks a lot, this is exactly what I was looking for. I don’t think, it will get easier than that! :smiley:

I tested the app, it works like a charme. No permissions are given on the phone, it is very clean and easy to use (hint => create the long live token on your phone, so you can copy that endless string) and it is open source.

I uninstalled Tasker right away, I don’t need it anymore - YES! :slight_smile: :slight_smile: :slight_smile:

Thanks, this is great!

I confirm, this app it’s just that I wanted :wink:

I am one of the people who set 200 alarms each morning just for the love of snooze…
On my case, I only wanted the automation to run on the first alarm of each morning.
So I intend to create a History statistics sensor that counts how many times the automation has ran today. (like the example in the documentation but with count instead of time)
And set it as a condition to be zero for the automation to run.

But be careful, I just noticed, that the sensor is gone after a HA restart.

I’ve implemented it in another way. As soon as the state for the “app sensor” changes, I’ll start an automation to set the value for an input_datetime. And I can check for conditions in this automation.

- id: set_alarm_paddy
  alias: Alarm Pat
  trigger:
  - entity_id: sensor.alarm_paddy
    platform: state
  condition:
  - condition: and
    conditions:
    - condition: template
      value_template: "{% if states('sensor.alarm_paddy') != '' and as_timestamp(states('sensor.alarm_paddy')) > 0 %}true{% else %}false{% endif %}"
    - after: 06:30:00
      before: '13:30:00'
      condition: time
  action:
  - data_template:
      datetime: "{{  as_timestamp(states('sensor.alarm_paddy')) | timestamp_custom('%Y-%m-%d %H:%M:%S') }}"
    entity_id: input_datetime.alarm_clock_paddy
    service: input_datetime.set_datetime

I think his documentation wrote that he updates every max 1h, haven’t tested it yet but in my case, my daily ha restart time is dangerously close to my morning alarms.

Although your workaround should work fine, I suspect that if you declare the sensor in ha’s yaml and the app just sets the time, its value will persist through restarts. But that’s just a suspicion :slight_smile: need to test

Hello!
I just added support for publishing directly to an input_datetime input from the Hassalarm app. It will be available from version 1.5 that I just pushed to Play Store.

//Johan

5 Likes

Thanks a lot, that makes it even easier for me! Great addition! :slight_smile:

Have anyone managed to get the alarm time from iOS in to HA?

Hello Johan,
any thoughts on widening Hassalarm’s scope to sending calendar alarms/entris as well? I am using Hassalarm on my BB Keynote One for a few days now, and I have to say its working like a charm - gets the alarm time to HA within seconds, beautiful.
With the calendar items in HA I could have the thermostat function start heating up some time before the end of an appointment, right in time for me to retuen to a balmy warm appartment, without having to mess with GPS tracking of my moves around town…just dreaming.
Any thoughts?
Frankie

Hey!
You mean like syncing the calendar to hass? Do you use Google Calendar for your events? Then you can use this: https://www.home-assistant.io/integrations/calendar.google/