alias: Dogfood timestamp recorder description: Record when the dogfood container was last opened in a persistent fashion trigger: - platform: state entity_id: binary_sensor.dog_food to: "on" condition: [] action: - service: input_datetime.set_datetime data_template: entity_id: input_datetime.dog_food_last_opened datetime: "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}" - service: notify.notify data: data: tag: dog_food message: clear_notification mode: single alias: Dogfood Reminder description: >- Send mobile notification if the dog hasn't been fed in 3.5h from the trigger time trigger: - platform: time at: "09:30:00" - platform: time at: "19:30:00" - platform: time at: "09:32:00" - platform: time at: "19:32:00" condition: - condition: template value_template: > {{ as_timestamp(now()) - as_timestamp(states('input_datetime.dog_food_last_opened')) > 12600}} - condition: not conditions: - condition: state entity_id: input_select.vacation_mode state: Vacation action: - service: notify.notify data: message: >- Last recorded time was {{ states.sensor.dog_food_last_opened_timestamp.state }} title: Has the dog been fed? data: icon_url: https://img.icons8.com/ios/50/000000/empty-dog-bowl.png ttl: 0 priority: high notification_icon: mdi:dog tag: dog_food mode: single alias: Dogfood Duplicate Alarm description: Have the kitchen display warn someone the dog is being fed twice trigger: - platform: state entity_id: - binary_sensor.dog_food to: "on" from: "off" condition: - condition: template value_template: > {{ as_timestamp(now()) - as_timestamp(states('input_datetime.dog_food_last_opened')) < 12600}} - condition: or conditions: - condition: time before: "10:00:00" after: "06:00:00" - condition: time before: "20:00:00" after: "17:00:00" action: - service: tts.google_say data: entity_id: media_player.kitchen_display message: Warning, the dog was already fed mode: single