home-assistant-configuration/config/packages/appliances.yaml

216 lines
5.4 KiB
YAML
Raw Normal View History

###############################################################################
# @author : Jeffrey Stone
# @date : 06/12/2020
# @package : Appliances
# @description : Package for handling Smart Applicances and or automation to make dumb appliances seem smart.
###############################################################################
sensor:
# MQTT Sensor for DishWasher Status.
- platform: mqtt
name: "DishWasher Status"
state_topic: "house/dishwasher/status"
# MQTT Sensor for Washing Machine Status.
- platform: mqtt
name: "Washer Status"
state_topic: "house/washer/status"
2021-05-24 15:51:28 +00:00
- platform: mqtt
name: "Washer Last Complete"
state_topic: "house/washer/time_complete"
- platform: mqtt
name: "Washer Last Emptied"
state_topic: "house/washer/time_emptied"
automation:
- id: washer_running
alias: Washer Running
trigger:
- above: 5
2021-05-24 15:51:28 +00:00
entity_id: sensor.washer_energy_w
platform: numeric_state
condition:
condition: or
conditions:
- condition: state
entity_id: sensor.washer_status
state: idle
- condition: state
entity_id: sensor.washer_status
state: complete
action:
- service: script.washer_running
# Since the washer has run lets consume a detergent tablet
- service: shell_command.grocy_consume_item
data:
server_ip: !secret grocy_ip
grocy_key: !secret grocy_api_key
product_id: 6
amount: 1
initial_state: true
- id: washer_complete
alias: Washer Complete
trigger:
- below: 3
2021-05-24 15:51:28 +00:00
entity_id: sensor.washer_energy_w
platform: numeric_state
condition:
- condition: state
entity_id: sensor.washer_status
state: running
action:
- service: script.washer_complete
initial_state: true
- id: washer_emptied
initial_state: true
alias: Washer Emptied
trigger:
- platform: state
entity_id: binary_sensor.washer_door
from: 'off'
to: 'on'
action:
- service: script.washer_idle
- service: script.turn_off
entity_id: script.washer_finished_notification_audible
2021-05-24 15:51:28 +00:00
- service: mqtt.publish
data:
topic: house/washer/time_emptied
payload: '{{ now().timestamp() }}'
retain: true
# - service: mqtt.publish
# data:
# topic: house/washer/time_ran
# payload: '{{ now().timestamp() - as_timestamp(states.sensor.washer_last_complete) }}'
# retain: true
- id: washer_notification
initial_state: true
alias: Washer Notification
trigger:
- platform: state
entity_id: sensor.washer_status
from: running
to: complete
- platform: event
event_type: event_washer_complete_notification
action:
- service: script.turn_on
entity_id: script.washer_finished_notification_audible
- id: dishwasher_idle
initial_state: true
alias: Dishwasher Idle
trigger:
- platform: state
entity_id: device_tracker.dishwasher
to: 'not_home'
action:
- service: script.dishwasher_idle
# When dishwasher connects to network assume it is running cycle. Auto consume detergent in Grocy
- id: dishwasher_running
initial_state: true
alias: Dishwasher Running
trigger:
- platform: state
entity_id: device_tracker.dishwasher
to: 'home'
action:
- service: script.dishwasher_running
- service: shell_command.grocy_consume_item
data:
server_ip: !secret grocy_ip
grocy_key: !secret grocy_api_key
product_id: 7
amount: 1
script:
2020-11-07 16:20:26 +00:00
appliances_on:
sequence:
- service: switch.turn_on
data:
entity_id: switch.box_fans
appliances_off:
sequence:
- data:
entity_id: switch.incense
service: switch.turn_off
- data:
entity_id: switch.artemis
service: switch.turn_off
washer_finished_notification_audible:
sequence:
- delay:
minutes: 15
- service: script.washer_audible
- delay:
minutes: 30
- event: event_washer_complete_notification
event_data:
name: Washer Complete Notification
message: Washer has completed it's cycle
washer_audible:
sequence:
- condition: state
entity_id: sensor.family_status
state: Home
- condition: state
entity_id: sensor.washer_status
state: complete
2021-05-24 15:51:28 +00:00
- service: script.status_annc
data_template:
2021-05-24 15:51:28 +00:00
who: '{{ states.sensor.room_presence.state }}'
call_interuption: 1
call_washer_needs_emptying: 1
washer_idle:
sequence:
- service: mqtt.publish
data:
topic: house/washer/status
payload: idle
retain: true
washer_running:
sequence:
- service: mqtt.publish
data:
topic: house/washer/status
payload: running
retain: true
washer_complete:
sequence:
- service: mqtt.publish
data:
topic: house/washer/status
payload: complete
retain: true
2021-05-24 15:51:28 +00:00
- service: mqtt.publish
data:
topic: house/washer/time_complete
payload: '{{ now().timestamp() }}'
retain: true
dishwasher_idle:
sequence:
- service: mqtt.publish
data:
topic: house/dishwasher/status
payload: idle
retain: true
dishwasher_running:
sequence:
- service: mqtt.publish
data:
topic: house/dishwasher/status
payload: running
retain: true