This repository has been archived by the owner on Oct 2, 2022. It is now read-only.
Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
smart-house/packages/dog_food.yaml
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
88 lines (81 sloc)
2.22 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| automation: | |
| # "arm" the alarm well before feeding time | |
| - alias: "Dog Food Activate" | |
| trigger: | |
| - platform: time | |
| at: '01:00:00' | |
| - platform: time | |
| at: '16:00:00' | |
| action: | |
| - service: input_boolean.turn_on | |
| data: | |
| entity_id: input_boolean.dog_needs_food | |
| # blow up our pohones if we forget to feed her | |
| - alias: "Dog Food Alert" | |
| trigger: | |
| - platform: time | |
| at: '07:30:00' | |
| - platform: time | |
| at: '18:00:00' | |
| condition: | |
| - condition: state | |
| entity_id: input_boolean.dog_needs_food | |
| state: "on" | |
| - condition: state | |
| entity_id: input_boolean.dog_away_mode | |
| state: "off" | |
| action: | |
| - service: notify.phones | |
| data: | |
| message: "Don't forget to feed Paisley!" | |
| # dog has been fed | |
| - alias: "Dog Food Reset" | |
| trigger: | |
| - platform: state | |
| entity_id: binary_sensor.dog_food_bin_sensor | |
| to: "on" | |
| action: | |
| - service: input_boolean.turn_off | |
| data: | |
| entity_id: input_boolean.dog_needs_food | |
| # track state | |
| input_boolean: | |
| dog_needs_food: | |
| name: Paisley Needs Food | |
| dog_away_mode: | |
| name: Paisley Is Away | |
| icon: mdi:beach | |
| # use a template sensor to diplay in the UI | |
| sensor: | |
| - platform: template | |
| sensors: | |
| paisley_food: | |
| value_template: '{% if is_state("input_boolean.dog_needs_food", "on") %}yes{% else %}no{% endif %}' | |
| friendly_name: 'Paisley Needs Food?' | |
| # customize | |
| homeassistant: | |
| customize: | |
| binary_sensor.dog_food_bin_sensor: | |
| icon: mdi:bone | |
| sensor.paisley_food: | |
| icon: mdi:silverware | |
| # Alexa intent | |
| intent_script: | |
| DogFood: | |
| speech: | |
| text: > | |
| {%- if is_state('input_boolean.dog_needs_food', 'on') -%} | |
| {% set responses = [ | |
| "She's probably hungry", | |
| "She could use some food", | |
| "She would appreciate some food" | |
| ] %} | |
| {%- else -%} | |
| {% set responses = [ | |
| "She's already been fed", | |
| "Don't let her fool you, she already ate", | |
| "As much as she'd love it, she doesn't need any food" | |
| ] %} | |
| {%- endif -%} | |
| {% set rindex = (range(0, (responses | length - 1) )|random) -%} | |
| {{responses[rindex]}} |