Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Occupation changes automations #297

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
74 changes: 74 additions & 0 deletions packages/occupation_changes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
automation:
- alias: Mark Person as just arrived
trigger:
- platform: state
entity_id: person.kyle
from: 'not_home'
to: 'home'
- platform: state
entity_id: person.charlotte
from: 'not_home'
to: 'home'
action:
- service: input_select.select_option
data_template:
entity_id: >
{% if trigger.entity_id == 'person.kyle' %}
input_select.kyle_status_dropdown
{% elif trigger.entity_id == 'person.charlotte' %}
input_select.charlotte_status_dropdown
{% endif %}
option: Just Arrived

- service: logbook.log
data_template:
name: EVENT
message: >
{{ trigger.to_state.attributes.friendly_name }} has just arrived at the house.
- service: script.tweet_engine
data_template:
tweet: >
{{ [
"Yay! Company!",
"A resident has just arrived!"
] | random + " http://amzn.to/2D3J8jW" }}
- service: notify.twitter_thegordonhome
data:
message: "A resident has just arrived!"


- alias: Mark Person as just left
trigger:
- platform: state
entity_id: person.kyle
from: 'home'
to: 'not_home'
- platform: state
entity_id: person.charlotte
from: 'home'
to: 'not_home'
- platform: state
entity_id: person.kyle
from: 'home'
to: 'Kyle Work'
- platform: state
entity_id: person.charlotte
from: 'home'
to: 'Charlotte Work'
action:
- service: input_select.select_option
data_template:
entity_id: >
{% if trigger.entity_id == 'person.kyle' %}
input_select.kyle_status_dropdown
{% elif trigger.entity_id == 'person.charlotte' %}
input_select.charlotte_status_dropdown
{% endif %}
option: Just Left

- service: logbook.log
data_template:
name: EVENT
message: >
{{ trigger.to_state.attributes.friendly_name }} has just left the house.

Loading