mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-09 18:40:14 -04:00
initial push
This commit is contained in:
@@ -0,0 +1,170 @@
|
||||
template:
|
||||
- binary_sensor:
|
||||
- name: Dishwasher
|
||||
unique_id: templatebinarysensor.dishwasher
|
||||
icon: mdi:dishwasher
|
||||
delay_on: "{{states('input_number.dishwasher_delay_on') | float(default=0) }}"
|
||||
delay_off: "{{states('input_number.dishwasher_delay_off') | float(default=0) }}"
|
||||
availability: "{{ states('sensor.pm_dishwasher_w') not in ['unkown', 'unavailable'] }}"
|
||||
attributes:
|
||||
model_number: 'MDB6769PAS1'
|
||||
serial_number: 'F24407234'
|
||||
power: "{{ states('sensor.pm_dishwasher_w') | float(default=0)}}"
|
||||
target: "{{ states('input_number.dishwasher_on') | float(default=0)}}"
|
||||
state: "{{ states('sensor.pm_dishwasher_w')|float(default=0) >= states('input_number.dishwasher_on')|float(default=0) }}"
|
||||
|
||||
- sensor:
|
||||
- name: Dishwasher
|
||||
unique_id: templatesensor_dishwasher
|
||||
state: >
|
||||
{% if is_state('binary_sensor.dishwasher','on')%}
|
||||
running
|
||||
{% elif is_state('binary_sensor.dishwasher','off') and is_state('input_boolean.empty_dishwasher','on') %}
|
||||
pending
|
||||
{% else %}
|
||||
idle
|
||||
{% endif %}
|
||||
icon: >
|
||||
{% if is_state('sensor.dishwasher','idle') %}
|
||||
mdi:dishwasher-off
|
||||
{% elif is_state('sensor.dishwasher','pending') %}
|
||||
mdi:dishwasher-alert
|
||||
{% else %}
|
||||
mdi:dishwasher
|
||||
{% endif %}
|
||||
attributes:
|
||||
model_number: 'MDB6769PAS1'
|
||||
serial_number: 'F24407234'
|
||||
power: "{{ states('sensor.pm_dishwasher_w') | float(default=0)}}"
|
||||
target: "{{ states('input_number.dishwasher_on') | float(default=0)}}"
|
||||
|
||||
input_boolean:
|
||||
empty_dishwasher:
|
||||
name: Empty Dishwasher
|
||||
icon: mdi:cupboard
|
||||
|
||||
input_number:
|
||||
dishwasher_on:
|
||||
# was 4
|
||||
name: 'Dishwasher On'
|
||||
icon: mdi:dishwasher
|
||||
min: 0
|
||||
max: 1000
|
||||
step: 0.1
|
||||
mode: box
|
||||
unit_of_measurement: W
|
||||
|
||||
dishwasher_off:
|
||||
name: 'Dishwasher Off'
|
||||
icon: mdi:dishwasher-off
|
||||
min: 0
|
||||
max: 1000
|
||||
step: 0.1
|
||||
mode: box
|
||||
unit_of_measurement: W
|
||||
|
||||
dishwasher_delay_on:
|
||||
name: 'Dishwasher Delay On'
|
||||
icon: mdi:clock
|
||||
min: 0
|
||||
max: 900
|
||||
step: 10
|
||||
mode: box
|
||||
|
||||
dishwasher_delay_off:
|
||||
# was 600
|
||||
name: 'Dishwasher Delay Off'
|
||||
icon: mdi:clock-alert
|
||||
min: 0
|
||||
max: 900
|
||||
step: 10
|
||||
mode: box
|
||||
|
||||
automation:
|
||||
- id: automation_empty_dishwasher_state
|
||||
alias: Empty Dishwasher
|
||||
trigger:
|
||||
- id: dishwasher_off
|
||||
platform: state
|
||||
entity_id: binary_sensor.dishwasher
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
|
||||
- id: dishwasher_on
|
||||
platform: state
|
||||
entity_id: binary_sensor.dishwasher
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
|
||||
- id: door_open
|
||||
platform: state
|
||||
entity_id: binary_sensor.dishwasher_door_contact
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
for:
|
||||
seconds: 5
|
||||
|
||||
condition: []
|
||||
action:
|
||||
- choose:
|
||||
- alias: "Dishwasher is running. No need to empty it yet"
|
||||
conditions:
|
||||
- condition: trigger
|
||||
id: dishwasher_on
|
||||
|
||||
- condition: state
|
||||
entity_id: input_boolean.empty_dishwasher
|
||||
state: 'on'
|
||||
|
||||
sequence:
|
||||
- service: logbook.log
|
||||
data_template:
|
||||
name: Empty Dishwasher - Load Started
|
||||
entity_id: automation.empty_dishwasher
|
||||
message: Dishwasher just turned on. Turning off input_boolean in case it got left on
|
||||
|
||||
- service: homeassistant.turn_off
|
||||
target:
|
||||
entity_id: input_boolean.empty_dishwasher
|
||||
|
||||
- alias: "Dishwasher finished while door was shut"
|
||||
conditions:
|
||||
- condition: trigger
|
||||
id: dishwasher_off
|
||||
|
||||
- condition: state
|
||||
entity_id: binary_sensor.dishwasher_door_contact
|
||||
state: 'off'
|
||||
|
||||
sequence:
|
||||
- service: logbook.log
|
||||
data_template:
|
||||
name: Empty Dishwasher - Load finished
|
||||
entity_id: automation.empty_dishwasher
|
||||
message: Dishwasher just turned off while the door was shut. Assuming dishes need to be put away
|
||||
|
||||
- service: homeassistant.turn_on
|
||||
target:
|
||||
entity_id: input_boolean.empty_dishwasher
|
||||
|
||||
- alias: "Door was opened for 30 seconds while dishwasher was off"
|
||||
conditions:
|
||||
- condition: trigger
|
||||
id: door_open
|
||||
|
||||
- condition: state
|
||||
entity_id: binary_sensor.dishwasher
|
||||
state: 'off'
|
||||
|
||||
sequence:
|
||||
- service: logbook.log
|
||||
data_template:
|
||||
name: Empty Dishwasher - Dishes put away
|
||||
entity_id: automation.empty_dishwasher
|
||||
message: Dishwasher door was opened while the dishwasher was off. Assuming dishes don't need to be put away.
|
||||
|
||||
- service: homeassistant.turn_off
|
||||
target:
|
||||
entity_id: input_boolean.empty_dishwasher
|
||||
|
||||
mode: single
|
||||
@@ -0,0 +1,215 @@
|
||||
template:
|
||||
- trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- sensor.pm_dryer_w
|
||||
- input_number.tumble_dryer_delay_on
|
||||
- input_number.tumble_dryer_delay_off
|
||||
not_to:
|
||||
- "unknown"
|
||||
- "unavailable"
|
||||
|
||||
- platform: event
|
||||
event_type: event_template_reloaded
|
||||
id: "reload"
|
||||
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
|
||||
binary_sensor:
|
||||
- name: Tumble Dryer
|
||||
unique_id: binary-sensor-tumble-dryer
|
||||
delay_on: "{{states('input_number.tumble_dryer_delay_on') | float(default=0)}}"
|
||||
delay_off: "{{states('input_number.tumble_dryer_delay_off') | float(default=0)}}"
|
||||
icon: mdi:tumble-dryer
|
||||
availability: "{{ states('sensor.pm_dryer_w') not in ['unkown', 'unavailable'] }}"
|
||||
attributes:
|
||||
model_number: 'DVE45R6100W/A3'
|
||||
serial_number: '0AY95BBM605793X'
|
||||
power: "{{ states('sensor.pm_dryer_w') | float(default=0)}}"
|
||||
target: "{{ states('input_number.tumble_dryer_on') | float(default=0)}}"
|
||||
state: "{{ states('sensor.pm_dryer_w')|float(default=0) >= states('input_number.tumble_dryer_on')|float(default=0) }}"
|
||||
|
||||
- trigger:
|
||||
- platform: state
|
||||
entity_id: sensor.pm_dryer_w
|
||||
not_to:
|
||||
- "unknown"
|
||||
- "unavailable"
|
||||
- platform: state
|
||||
entity_id: input_number.tumble_dryer_delay_on
|
||||
not_to:
|
||||
- "unknown"
|
||||
- "unavailable"
|
||||
- platform: state
|
||||
entity_id: input_number.tumble_dryer_delay_off
|
||||
not_to:
|
||||
- "unknown"
|
||||
- "unavailable"
|
||||
|
||||
- platform: event
|
||||
event_type: event_template_reloaded
|
||||
id: "reload"
|
||||
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
|
||||
sensor:
|
||||
- name: Tumble Dryer
|
||||
unique_id: templatesensor_tumble_dryer
|
||||
state: >
|
||||
{% if is_state('binary_sensor.tumble_dryer','on') %}
|
||||
running
|
||||
{% elif is_state('binary_sensor.tumble_dryer','off') and is_state('input_boolean.fold_clothes','on') %}
|
||||
pending
|
||||
{% else %}
|
||||
idle
|
||||
{% endif %}
|
||||
icon: >
|
||||
{% if is_state('sensor.tumble_dryer','idle') %}
|
||||
mdi:tumble-dryer-off
|
||||
{% elif is_state('sensor.tumble_dryer','pending') %}
|
||||
mdi:tumble-dryer-alert
|
||||
{% else %}
|
||||
mdi:tumble-dryer
|
||||
{% endif %}
|
||||
attributes:
|
||||
model_number: 'DVE45R6100W/A3'
|
||||
serial_number: '0AY95BBM605793X'
|
||||
power: "{{ states('sensor.pm_dryer_w') | float(default=0)}}"
|
||||
target: "{{ states('input_number.tumble_dryer_on') | float(default=0)}}"
|
||||
|
||||
input_boolean:
|
||||
fold_clothes:
|
||||
name: Fold Clothes
|
||||
icon: mdi:hanger
|
||||
|
||||
input_number:
|
||||
tumble_dryer_on:
|
||||
# was 10
|
||||
name: 'Tumble Dryer On'
|
||||
icon: mdi:tumble-dryer
|
||||
min: 0
|
||||
max: 1000
|
||||
step: 0.1
|
||||
mode: box
|
||||
unit_of_measurement: W
|
||||
|
||||
tumble_dryer_off:
|
||||
name: 'Tumble Dryer Off'
|
||||
icon: mdi:tumble-dryer-off
|
||||
min: 0
|
||||
max: 1000
|
||||
step: 0.1
|
||||
mode: box
|
||||
unit_of_measurement: W
|
||||
|
||||
tumble_dryer_delay_on:
|
||||
name: 'Tumble Dryer Delay On'
|
||||
icon: mdi:clock
|
||||
min: 0
|
||||
max: 900
|
||||
step: 10
|
||||
mode: box
|
||||
|
||||
tumble_dryer_delay_off:
|
||||
# was 10
|
||||
name: 'Tumble Dryer Delay Off'
|
||||
icon: mdi:clock-alert
|
||||
min: 0
|
||||
max: 900
|
||||
step: 10
|
||||
mode: box
|
||||
|
||||
automation:
|
||||
- id: automation_fold_clothes_state
|
||||
alias: Fold Clothes
|
||||
trigger:
|
||||
- id: tumble_dryer_off
|
||||
platform: state
|
||||
entity_id: binary_sensor.tumble_dryer
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
|
||||
- id: tumble_dryer_on
|
||||
platform: state
|
||||
entity_id: binary_sensor.tumble_dryer
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
|
||||
- id: door_open
|
||||
platform: state
|
||||
entity_id: binary_sensor.tumble_dryer_door_contact
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
for:
|
||||
seconds: 5
|
||||
|
||||
condition: []
|
||||
action:
|
||||
- choose:
|
||||
- alias: "Dryer is running. No need to fold clothes yet"
|
||||
conditions:
|
||||
- condition: trigger
|
||||
id: tumble_dryer_on
|
||||
|
||||
- condition: state
|
||||
entity_id: input_boolean.fold_clothes
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: logbook.log
|
||||
data_template:
|
||||
name: Fold Clothes - Load started
|
||||
entity_id: automation.fold_clothes
|
||||
message: Dryer turned on. No need to fold clothes yet. Turning off input_boolean in case it got left on
|
||||
|
||||
|
||||
- service: homeassistant.turn_off
|
||||
target:
|
||||
entity_id: input_boolean.fold_clothes
|
||||
|
||||
- alias: "Dryer finished while door was shut"
|
||||
conditions:
|
||||
- condition: trigger
|
||||
id: tumble_dryer_off
|
||||
|
||||
- condition: state
|
||||
entity_id: binary_sensor.tumble_dryer_door_contact
|
||||
state: 'off'
|
||||
|
||||
sequence:
|
||||
- service: logbook.log
|
||||
data_template:
|
||||
name: Fold Clothes - Load finished
|
||||
entity_id: automation.fold_clothes
|
||||
message: Dryer just turned off. Assuming clothes need to be folded
|
||||
|
||||
- service: homeassistant.turn_on
|
||||
target:
|
||||
entity_id: input_boolean.fold_clothes
|
||||
|
||||
- alias: "Door was opened while dryer was off"
|
||||
conditions:
|
||||
- condition: trigger
|
||||
id: door_open
|
||||
|
||||
- condition: state
|
||||
entity_id: binary_sensor.tumble_dryer
|
||||
state: 'off'
|
||||
|
||||
- condition: state
|
||||
entity_id: input_boolean.fold_clothes
|
||||
state: 'on'
|
||||
|
||||
sequence:
|
||||
- service: logbook.log
|
||||
data_template:
|
||||
name: Fold Clothes - Clothes folded
|
||||
entity_id: automation.fold_clothes
|
||||
message: Door was opened while dryer was off. Assuming clothes are now folded
|
||||
|
||||
- service: homeassistant.turn_off
|
||||
target:
|
||||
entity_id: input_boolean.fold_clothes
|
||||
|
||||
mode: single
|
||||
@@ -0,0 +1,172 @@
|
||||
template:
|
||||
- binary_sensor:
|
||||
- name: Washing Machine
|
||||
unique_id: templatebinarysensor.washing_machine
|
||||
delay_on: "{{states('input_number.washing_machine_delay_on') | float(default=0)}}"
|
||||
delay_off: "{{states('input_number.washing_machine_delay_off') | float(default=0)}}"
|
||||
icon: mdi:washing-machine
|
||||
availability: "{{ states('sensor.pm_laundry_plug_w') not in ['unkown', 'unavailable'] }}"
|
||||
attributes:
|
||||
model_number: 'WF45R6100AW/US'
|
||||
serial_number: '01FY57AM802740X'
|
||||
power: "{{ states('sensor.pm_laundry_plug_w') | float(default=0)}}"
|
||||
target: "{{ states('input_number.washing_machine_on') | float(default=0)}}"
|
||||
state: "{{ states('sensor.pm_laundry_plug_w')|float(default=0) >= states('input_number.washing_machine_on')|float(default=0) }}"
|
||||
|
||||
- sensor:
|
||||
- name: Washing Machine
|
||||
unique_id: templatesensor_washing_machine
|
||||
state: >
|
||||
{% if is_state('binary_sensor.washing_machine','on') %}
|
||||
running
|
||||
{% elif is_state('binary_sensor.washing_machine','off') and is_state('input_boolean.swap_laundry','on') %}
|
||||
pending
|
||||
{% else %}
|
||||
idle
|
||||
{% endif %}
|
||||
icon: >
|
||||
{% if is_state('sensor.washing_machine','idle') %}
|
||||
mdi:washing-machine-off
|
||||
{% elif is_state('sensor.washing_machine','pending') %}
|
||||
mdi:washing-machine-alert
|
||||
{% else %}
|
||||
mdi:washing-machine
|
||||
{% endif %}
|
||||
attributes:
|
||||
model_number: 'WF45R6100AW/US'
|
||||
serial_number: '01FY57AM802740X'
|
||||
power: "{{ states('sensor.pm_laundry_plug_w') | float(default=0)}}"
|
||||
target: "{{ states('input_number.washing_machine_on') | float(default=0)}}"
|
||||
|
||||
input_boolean:
|
||||
swap_laundry:
|
||||
name: Swap Laundry
|
||||
icon: mdi:tshirt-crew
|
||||
|
||||
input_number:
|
||||
washing_machine_on:
|
||||
# was 5
|
||||
name: 'Washing Machine On'
|
||||
icon: mdi:washing-machine
|
||||
min: 0
|
||||
max: 20
|
||||
step: 0.1
|
||||
mode: box
|
||||
unit_of_measurement: W
|
||||
|
||||
washing_machine_off:
|
||||
name: 'Washing Machine Off'
|
||||
icon: mdi:washing-machine-off
|
||||
min: 0
|
||||
max: 20
|
||||
step: 0.1
|
||||
mode: box
|
||||
unit_of_measurement: W
|
||||
|
||||
washing_machine_delay_on:
|
||||
name: 'Washing Machine Delay On'
|
||||
icon: mdi:clock
|
||||
min: 0
|
||||
max: 900
|
||||
step: 10
|
||||
mode: box
|
||||
|
||||
washing_machine_delay_off:
|
||||
# was 10
|
||||
name: 'Washing Machine Delay Off'
|
||||
icon: mdi:clock-alert
|
||||
min: 0
|
||||
max: 900
|
||||
step: 10
|
||||
mode: box
|
||||
|
||||
automation:
|
||||
- id: automation_swap_laundry_state
|
||||
alias: Swap Laundry
|
||||
trigger:
|
||||
- id: washing_machine_off
|
||||
platform: state
|
||||
entity_id: binary_sensor.washing_machine
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
|
||||
- id: washing_machine_on
|
||||
platform: state
|
||||
entity_id: binary_sensor.washing_machine
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
|
||||
- id: door_open
|
||||
platform: state
|
||||
entity_id: binary_sensor.washing_machine_door_contact
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
for:
|
||||
seconds: 5
|
||||
|
||||
condition: []
|
||||
action:
|
||||
- choose:
|
||||
- alias: "Washing machine is running. No need to swap laundry yet"
|
||||
conditions:
|
||||
- condition: trigger
|
||||
id: washing_machine_on
|
||||
|
||||
- condition: state
|
||||
entity_id: input_boolean.swap_laundry
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: logbook.log
|
||||
data_template:
|
||||
name: Swap Laundry - Load started
|
||||
entity_id: automation.swap_laundry
|
||||
message: Washing machine is running. No need to swap laundry yet. Turning off input_boolean.swap_laundry, in case it was left on
|
||||
|
||||
- service: homeassistant.turn_off
|
||||
target:
|
||||
entity_id: input_boolean.swap_laundry
|
||||
|
||||
- alias: "Washing machine finished while door was shut"
|
||||
conditions:
|
||||
- condition: trigger
|
||||
id: washing_machine_off
|
||||
|
||||
- condition: state
|
||||
entity_id: binary_sensor.washing_machine_door_contact
|
||||
state: 'off'
|
||||
|
||||
sequence:
|
||||
- service: logbook.log
|
||||
data_template:
|
||||
name: Swap Laundry - Load needs to be swapped
|
||||
entity_id: automation.swap_laundry
|
||||
message: Washing machine turned off while the door was shut. Assuming that a load needs to be swapped
|
||||
- service: homeassistant.turn_on
|
||||
target:
|
||||
entity_id: input_boolean.swap_laundry
|
||||
|
||||
- alias: "Door was opened while washing machine was off"
|
||||
conditions:
|
||||
- condition: trigger
|
||||
id: door_open
|
||||
|
||||
- condition: state
|
||||
entity_id: binary_sensor.washing_machine
|
||||
state: 'off'
|
||||
|
||||
- condition: state
|
||||
entity_id: input_boolean.swap_laundry
|
||||
state: 'on'
|
||||
|
||||
sequence:
|
||||
- service: logbook.log
|
||||
data_template:
|
||||
name: Swap Laundry - Load swapped
|
||||
entity_id: automation.swap_laundry
|
||||
message: Door was opened while washing machine was off. Assuming a load just got swapped
|
||||
|
||||
- service: homeassistant.turn_off
|
||||
target:
|
||||
entity_id: input_boolean.swap_laundry
|
||||
|
||||
mode: single
|
||||
Reference in New Issue
Block a user