Just create a profile with an event context of Alarm, and have it fire a http post task, and use the home assistant api to call the light.turn_on service.
I just published a new beta version which includes an option to change the client ID (@mconway) and the global MQTT topic. And it’s now also possible to set a topic per broadcast item.
Edit: and I know that you can use Tasker, but this is another approach which can be easier if you already set up a MQTT broker. Also it’s cheaper.
Which intent do you listen for with tasker? com.android.deskclock.ALARM_ALERT doesn’t seem to be working for me. Is there an intent that gets fired when an alarm goes off?
I haven’t tried this or studied this solution in detail, but would it be possible to use the same solution to trigger light f.ex 30 minutes before the alarm? I would love a solution where I had basically an “if alarm with name good morning set, run wakeup-profile”.
Hmm…I’m trying to use that right now and the profile doesn’t seem to be firing when my alarm goes off. I’m using Event > Date/Time > Alarm Clock for my profile.
I’ve tried leaving the alarm label blank and I’ve tried labeling my alarm and adding a label to the profile…not sure why it won’t fire…other profiles work for this same task. I’ll probably try an alarm clock Tasker plugin. Anyway, thanks for the help!
Thanks @corneyl. Any specific reason your app requires QOS2 for connections to the MQTT broker? that’s what’s preventing me from using the app. My broker only supports QOS0 and 1
Good point, and no particular reason, I actually thought that the app was using QOS0 messages. But looking at the code I indeed use QOS2 messages. I’ll release a new beta today where QOS is an option which defaults to 0.
You mean the Broadcast to MQTT app right, not Tasker? For me this is just a hobby project, I do not own any Apple stuff and don’t even know whether they use a broadcast system internally. So no, not from my side at least.
Hi @corneyl,
I would like to thank you for great app!
I was thinking about if it is possible to add functionality to turn wifi on when event is fired? Because at night I have fly mod turned on, so it cannot send data to MQTT. Or is there another workaround?
The Timely app will create a notification 10-15 minutes prior to the alarm, and the notification lists the time of the next alarm. Would there be a way to grab the next alarm time from the notification and send to home assistant?
I don’t see an intent being broadcasted with the notification, but I might be missing a step.
@KavajNaruj I don’t know a workaround other than enabling wifi on forehand. Maybe this functionality is possible with e.g. Tasker?
@ericstewart22 All ‘extra’ fields of the broadcast intent are also send via MQTT. So if you can find the broadcast and it contains an extra field with the next alarm time, then you can grab it from the json message sent via MQTT.
I like youre app.
I like to use it but i got some error’s
i want to set the allarm on my phone en send a mqtt message to turn on lights in my room
This is my config :
trigger:
platform: mqtt
topic: 'android/broadcast/gsmruben
condition: state
value_template: ‘{{ trigger.payload_json.action == “com.samsung.sec.android.clockpackage.alarm.ALARM_ALERT” }}’
action:
service: switch.turn_on
entity_id: switch.lamp
Error in home assistant:
Testing configuration at /config ERROR:homeassistant.util.yaml:while parsing a block mapping in “/config/automations.yaml”, line 12, column 7 expected , but found ‘{’ in “/config/automations.yaml”, line 15, column 22 Failed config General Errors: - while parsing a block mapping in “/config/automations.yaml”, line 12, column 7 expected , but found ‘{’ in “/config/automations.yaml”, line 15, column 22