Get wake up alarm from a phone?

I just love this community. Each time I struggle with something, someone comes with the perfect solution. Thank you so much! :slight_smile:

I just use a Google Calendar - fire the automation when every event [matching a search string] starts.

Could you please write a novice-friendly post about how to get this to work? This would be my next step in making my house more autonomous.

Thanks

Thanks for the idea with automate by llamalabs. I’m not great with coding and sort of just copy paste and fumble my way through.

With your example above would it be possible to use it to toggle an input Boolean switch? And what would the Jason code look like.

Basically I have an automation set up and I want it to flag to HA that I’m sleeping and to inhibit some of my other automations. I work shift work so am often sleeping during the day.

Also I notice at the end it’s has the API password but that is now being replaced with the new loving method is that correct? So this part will have be changed too?

Yes indeed.
I ran into this issue recently and found a fix for automate. You can find it here:

Yes you can control anything with this method. Input_Numbers, Booleans, etc.
Just change this:

[http://YOURIPORDUCKDNS:8123/api/states/sensor.alarmtime]

to the correct sensor, or boolean or whatever you want to control.

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