2020-06-12 20:02:42 +00:00
###############################################################################
# @author : Jeffrey Stone
# @date : 06/12/2020
# @package : Appliances
# @description : Package for handling Smart Applicances and or automation to make dumb appliances seem smart.
###############################################################################
2020-08-22 03:44:13 +00:00
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"
2020-08-22 03:44:13 +00:00
2021-08-04 19:57:44 +00:00
utility_meter :
washer_daily_kwh :
source : sensor.washer_switch_electric_consumed_kwh
cycle : daily
washer_weekly_kwh :
source : sensor.washer_switch_electric_consumed_kwh
cycle : weekly
2020-06-12 20:02:42 +00:00
automation :
- id : washer_running
alias : Washer Running
trigger :
- above : 5
2021-06-17 01:12:39 +00:00
entity_id : sensor.washer_power_consumed_w
2020-06-12 20:02:42 +00:00
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 :
2021-11-26 04:00:26 +00:00
- service : mqtt.publish
data :
topic : house/washer/status
payload : running
retain : true
2020-06-12 20:02:42 +00:00
initial_state : true
- id : washer_complete
alias : Washer Complete
trigger :
- below : 3
2021-06-17 01:12:39 +00:00
entity_id : sensor.washer_power_consumed_w
2020-06-12 20:02:42 +00:00
platform : numeric_state
condition :
- condition : state
entity_id : sensor.washer_status
state : running
action :
2021-11-26 04:00:26 +00:00
- service : mqtt.publish
data :
topic : house/washer/status
payload : complete
retain : true
- service : mqtt.publish
data :
topic : house/washer/time_complete
payload : '{{ now().timestamp() }}'
retain : true
initial_state : true
- id : washer_notification
2020-06-12 20:02:42 +00:00
initial_state : true
2021-11-26 04:00:26 +00:00
alias : Washer Notification
trigger :
- platform : state
entity_id : sensor.washer_status
from : running
to : complete
action :
2021-12-08 20:53:53 +00:00
# - service: script.status_annc
# data:
# who: '{{ states.sensor.room_presence.state }}'
# call_interuption: 1
# speech_message: It appears the washing machine has completed its cycle.
- service : script.speech_engine
data :
who : '{{ states(' 'sensor.room_audio' ') }}'
message : 'Just a quick heads up, It appears the washing machine has completed its cycle'
2021-11-26 04:00:26 +00:00
- service : script.turn_on
entity_id : script.washer_finished_notification_audible
2020-06-12 20:02:42 +00:00
- id : washer_emptied
initial_state : true
alias : Washer Emptied
trigger :
- platform : state
2020-08-22 03:44:13 +00:00
entity_id : binary_sensor.washer_door
2020-06-12 20:02:42 +00:00
from : 'off'
to : 'on'
action :
2021-11-26 04:00:26 +00:00
- service : mqtt.publish
data :
topic : house/washer/status
payload : idle
retain : true
2020-06-12 20:02:42 +00:00
- 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
2020-06-12 20:02:42 +00:00
2021-11-26 04:00:26 +00:00
- id : e1cb26fe-0423-11eb-adc1-0242ac120002
2020-06-12 20:02:42 +00:00
initial_state : true
2021-11-26 04:00:26 +00:00
alias : Dryer Notification
2020-06-12 20:02:42 +00:00
trigger :
- platform : state
2021-11-26 04:00:26 +00:00
entity_id : binary_sensor.dryer_dry_completed
from : 'off'
to : 'on'
2020-06-12 20:02:42 +00:00
action :
2021-11-26 04:00:26 +00:00
- service : script.status_annc
data :
who : '{{ states.sensor.room_presence.state }}'
call_interuption : 1
speech_message : It appears the dryer has finished.
- delay :
minutes : 15
# - service: script.turn_on
# entity_id: script.dryer_finished_notification_audible
2020-08-22 03:44:13 +00:00
- 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
2021-08-04 19:57:44 +00:00
# When dishwasher connects to network assume it is running cycle.
2020-08-22 03:44:13 +00:00
- id : dishwasher_running
initial_state : true
alias : Dishwasher Running
trigger :
- platform : state
entity_id : device_tracker.dishwasher
to : 'home'
action :
- service : script.dishwasher_running
2020-06-12 20:02:42 +00:00
2021-11-26 04:00:26 +00:00
- id : e1cb2640-0423-11eb-adc1-0242ac120002
alias : 3D Printing Notifications
trigger :
- platform : state
entity_id : binary_sensor.octoprint_printing
to : "on"
id : printing_started
- platform : state
entity_id : binary_sensor.octoprint_printing
to : "off"
id : printing_ended
action :
- choose :
- conditions :
- condition : trigger
id : printing_started
- condition : state
entity_id : sensor.octoprint_current_state
state : 'Printing'
sequence :
- service : script.status_annc
data :
who : '{{ states.sensor.room_presence.state }}'
call_interuption : 1
speech_message : The three d printer is printing.
- conditions :
- condition : trigger
id : printing_started
- condition : state
entity_id : sensor.octoprint_current_state
state : 'Sending file to SD'
sequence :
- service : script.status_annc
data :
who : '{{ states.sensor.room_presence.state }}'
call_interuption : 1
speech_message : Uploading file to three d file has started.
- conditions :
- condition : trigger
id : printing_ended
sequence :
- service : script.status_annc
data :
who : '{{ states.sensor.room_presence.state }}'
call_interuption : 1
speech_message : The three d printer has completed its job.
2020-06-12 20:02:42 +00:00
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
2020-06-12 20:02:42 +00:00
washer_finished_notification_audible :
sequence :
2021-11-26 04:00:26 +00:00
- repeat :
while :
- condition : state
entity_id : sensor.washer_status
state : 'complete'
sequence :
- delay :
minutes : 45
2021-12-08 20:53:53 +00:00
#- service: script.washer_audible
- service : script.simplified_washer_audible
2021-11-26 04:00:26 +00:00
# dryer_finished_notification_audible:
# sequence:
# - repeat:
# while:
# - condition: state
# entity_id: sensor.washer_status
# state: 'complete'
# sequence:
# - service: script.dryer_audible
# - delay:
# minutes: 45
2020-06-12 20:02:42 +00:00
washer_audible :
sequence :
- condition : state
2021-12-08 20:53:53 +00:00
entity_id : group.family
state : 'home'
2020-06-12 20:02:42 +00:00
- condition : state
entity_id : sensor.washer_status
state : complete
2021-05-24 15:51:28 +00:00
- service : script.status_annc
2020-12-03 03:55:11 +00:00
data_template :
2021-12-08 20:53:53 +00:00
who : '{{ states(' 'sensor.room_audio' ') }}'
2021-05-24 15:51:28 +00:00
call_interuption : 1
call_washer_needs_emptying : 1
2021-12-08 20:53:53 +00:00
simplified_washer_audible :
sequence :
- condition : state
entity_id : group.family
state : 'home'
- condition : state
entity_id : sensor.washer_status
state : complete
- service : script.speech_engine
data :
who : '{{ states(' 'sensor.room_audio' ') }}'
message : >
{{ [
'Pardon me, ' ,
'Excuse me, ' ,
'I do not mean to interrupt, but,' ,
'I hate to interrupt, but,' ,
'I beg your pardon, ' ,
'I do not mean to intrude, but, ' ,
'I am sorry to interrupt, but. ' ,
'Just a quick heads up, '
] | random }}
<p>
The washing machine completed its cycle
{% set seconds = now().timestamp() - as_timestamp(states.sensor.washer_status.last_changed) %}
{% if (seconds / ( 60 * 60 )) | int == 1 %}
over an hour ago.
{{ [
'Do not forget to rotate the clothes.' ,
'Was someone going to rotate the laundry?' ,
'Once you rotate the laundry I will stop reminding you to do it. So if you want me to stop. Its up to you.'
] | random }}
{% elif (seconds / ( 60 * 60 )) | int > 1 and (seconds / ( 60 * 60 )) | int < 6 %}
over {{ (seconds // ( 60 * 60 )) | int }} hours ago.
{{ [
'Much longer and you are going to need to wash them again.' ,
'Someone needs to rotate the laundry.' ,
'Do not forget about the clothes in the washing machine.' ,
'Surely you did not mean to forget about the clothes. Mistakes happen. But you can still fix it.' ,
'Do you like your clothes smelling like mildew? Becasue that is what is happening right now.'
] | random }}
{% elif (seconds / ( 60 * 60 )) | int > 6 %}
over {{ (seconds // ( 60 * 60 )) | int }} hours ago.
{{ [
'That is a crazy amount of time.' ,
'Did you decide you want those clothes to suffer?' ,
'You might as well just rewash those clothes.' ,
'I can smell the mildew. Virtually that is.' ,
'Surely you did not mean to forget about the clothes.'
] | random }}
{% else %}
{{ (seconds // 60) | int }} minutes ago.
{{ [
'Do not forget to rotate the clothes.' ,
'Someone forgot to move the clothes to the dryer. I am not going to name names, but there is a camera in there. Do I need to publically shame someone?' ,
'You might want to move them to the dryer.'
] | random }}
{% endif %}
</p>
2020-06-12 20:02:42 +00:00
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
2020-08-22 03:44:13 +00:00
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