2018-01-02 00:00:45 +00:00
|
|
|
###################################
|
|
|
|
## LOG Medicine
|
|
|
|
###################################
|
|
|
|
- alias: 'Log Medicine Activity'
|
2020-10-04 19:03:48 +00:00
|
|
|
mode: single
|
2020-07-20 18:33:03 +00:00
|
|
|
id: 5e250206-029e-42fb-993f-fc3f04760de3
|
2020-05-29 21:50:36 +00:00
|
|
|
|
2018-01-02 00:00:45 +00:00
|
|
|
trigger:
|
|
|
|
- platform: event
|
|
|
|
event_type: medicine_dash
|
|
|
|
- platform: state
|
|
|
|
entity_id: input_boolean.medicine
|
|
|
|
to: 'on'
|
|
|
|
from: 'off'
|
|
|
|
|
|
|
|
action:
|
|
|
|
- service: input_boolean.turn_on
|
|
|
|
entity_id: input_boolean.medicine
|
|
|
|
- service: logbook.log
|
|
|
|
data:
|
|
|
|
name: "Medicine Push"
|
|
|
|
message: "Took Medicine today."
|
|
|
|
|
|
|
|
- service: mqtt.publish
|
2020-09-26 14:52:45 +00:00
|
|
|
data:
|
2018-01-02 00:00:45 +00:00
|
|
|
payload: '{{ states("sensor.date") }}'
|
|
|
|
topic: 'dash/medicine/medicine_time'
|
|
|
|
retain: true
|
|
|
|
|
|
|
|
- service: script.notify_engine
|
2020-09-26 14:52:45 +00:00
|
|
|
data:
|
2019-03-18 01:43:55 +00:00
|
|
|
title: 'Medicine Reminder Completed'
|
|
|
|
value1: 'Carlo Took Medicine today.'
|
|
|
|
who: 'parents'
|
2020-05-29 21:50:36 +00:00
|
|
|
apns_id: 'Medicine'
|
2018-01-02 00:00:45 +00:00
|
|
|
- delay:
|
|
|
|
minutes: 1
|