What i need is get notified a medicine or eat time of kids to be alerted on home assistant as badge or something like that and also play a sound on Google Home. It should be fine when the alert happend that i should click on OK on the home assistant and then a new alert will be created or the next scheduled alert will be start.
Are there maybe a script or integration about that?
automation:
trigger:
platform: time_pattern
# Matches every hour at 5 minutes past whole
minutes: 5
How can i make switch to enable and disable that trigger?
When trigger happen how can i see that on Lovelace such as green button and i want to click on that button and then the status should be done -> up to the next schedule.
That button should be also register when you have clicked on it and then you can see that also on Lovelace when the medicine was gives.
I thing the idea is simple and can everyone use but my scripting knowledge is not so best to implement this integration…
Target:
-> Get notified medicine every 4 or 8 hours.
-> Should be fine to set that on Lovelace.
-> On Lovelace get the info about the next scheduled time.
-> When it is clicked on the button on Lovelace, the scheduled time should be automatically reset on that set time over 4 / 8 hours and the time begin again.
-> Alternatively an alarm sound on google home to get the medicine at the scheduled time.
You can use an input_select with two options: 4 and 8 (hours). This can be used to specify the desired time period.
You can use an input_boolean to activate or deactivate the countdown.
You can create an automation that uses a State Trigger. It is triggered whenever the state of the input_boolean is turned on and stays on for the number of hours specified by the input_select (use State Trigger’s for option). When triggered it turns off the input_boolean and plays an announcement to the media_player representing your Google Home.
To re-activate the countdown, you turn the input_boolean back on.
It’s not 3 scripts. It’s two entities and an automation.
If you are unfamiliar with the terms I’ve used, I suggest you review the links I provided in my previous posts to familiarize yourself with Home Assistant’s terminology. Otherwise, it will become challenging to explain what I’ve proposed.
In the configuration.yaml file, create an input_select and an input_boolean:
In whatever file you use to store your automations (configurations.yaml or automations.yaml), create this automation:
- alias: 'Reminder'
trigger:
platform: state
entity_id: input_boolean.reminder
to: 'on'
for:
hours: "{{states('input_select.hours') | int}}"
action:
- service: input_boolean.turn_off
entity_id: input_boolean.reminder
- service: persistent_notification.create
data_template:
message: 'This is your {{ trigger.for }} hour reminder to do something.'
title: 'This is a reminder.'
To simplify this example, this automation reports the reminder using persistent_notification as opposed to using a media_player (i.e. your Google Home device). It just makes it easier to create and test the example and can later be replaced with a notification to your Google Home.