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
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.
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)
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?
Thanks a lot, this is exactly what I was looking for. I don’t think, it will get easier than that!
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!
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 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.
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