diff --git a/home-assistant/packages/laundry.yaml b/home-assistant/packages/laundry.yaml new file mode 100644 index 0000000..9ecb944 --- /dev/null +++ b/home-assistant/packages/laundry.yaml @@ -0,0 +1,104 @@ +# +# Provides information and notifications about the washing machine and dryer. +# + +homeassistant: + customize: + automation.washingmachine_started: + hidden: true + friendly_name: Washing machine started + automation.washingmachine_completed: + hidden: true + friendly_name: Washing machine completed + input_select.washingmachine_status: + hidden: true + sensor.washingmachine_power_usage: + icon: mdi:flash + switch.powerplug_washingmachine: + hidden: true + customize_glob: + sensor.powerplug_washingmachine*: + hidden: true + +input_select: + washingmachine_status: + name: washingmachine_status + options: + - Idle + - Running + +sensor: + - platform: template + sensors: + washingmachine_power_usage: + friendly_name: Washing machine power + unit_of_measurement: 'W' + value_template: >- + {{ states.sensor.powerplug_washingmachine_power.state }} + washingmachine_status: + entity_id: + - input_select.washingmachine_status + value_template: "{{ states.input_select.washingmachine_status.state }}" + icon_template: mdi:tshirt-crew + friendly_name: Washing machine status + +automation: + # Set the washing machine in running state when the power usage goes up and it is in idle state + - alias: washingmachine_started + trigger: + - platform: numeric_state + entity_id: sensor.washingmachine_power_usage + above: 5 + for: + minutes: 1 + condition: + - condition: state + entity_id: input_select.washingmachine_status + state: Idle + action: + - service: input_select.select_option + data: + entity_id: input_select.washingmachine_status + option: Running + - service: notify.notify + data: + title: Washing machine started + message: The washing machine has just started + + # Set washing machine to idle state when power drops and it is in running state + - alias: washingmachine_completed + trigger: + - platform: numeric_state + entity_id: sensor.washingmachine_power_usage + below: 1 + for: + minutes: 1 + condition: + - condition: state + entity_id: input_select.washingmachine_status + state: Running + action: + - service: input_select.select_option + data: + entity_id: input_select.washingmachine_status + option: Idle + - service: notify.notify + data: + title: Washing machine finished + message: The washing machine has finished and the laundry can be moved to the dryer + - service: script.sonos_say + data: + media_player: living_room + volume: 0.3 + message: The washing machine has finished and the laundry can be moved to the dryer + delay: 00:00:05 + +group: + laundry: + name: Laundry + control: hidden + entities: + - sensor.washingmachine_status + - automation.washingmachine_started + - automation.washingmachine_completed + - sensor.washingmachine_power_usage diff --git a/home-assistant/packages/washing_machine.yaml.temp b/home-assistant/packages/washing_machine.yaml.temp deleted file mode 100644 index f4e09be..0000000 --- a/home-assistant/packages/washing_machine.yaml.temp +++ /dev/null @@ -1,60 +0,0 @@ -# -# Washing machine -# - -homeassistant: - customize: - automation.washing_machine_started: - icon: mdi:washing-machine - automation.washing_machine_completed: - icon: mdi:washing-machine - sensor.washing_machine: - icon: mdi:washing-machine - -automation: - - # Set the washing machine in busy state - - id: washing_machine_started - alias: 'Washing machine started' - trigger: - - platform: template - value_template: '{{ states.sensor.philio_technology_corporation_pan16_smart_energy_plug_in_switch_power.state|float > 5 }}' - condition: - condition: state - entity_id: input_boolean.washing_machine_busy - state: 'off' - action: - - service: input_boolean.turn_on - entity_id: input_boolean.washing_machine_busy - - # Set the washing machine in ready state and notify about completion - - id: washing_machine_completed - alias: 'Washing machine completed' - trigger: - - platform: template - value_template: '{{ states.sensor.philio_technology_corporation_pan16_smart_energy_plug_in_switch_power.state|float < 2 }}' - condition: - condition: state - entity_id: input_boolean.washing_machine_busy - state: 'on' - action: - - service: input_boolean.turn_off - entity_id: input_boolean.washing_machine_busy - - service: notify.notify - data: - message: 'The washing machine is done!' - -input_boolean: - washing_machine_busy: - name: Washing machine is running - initial: off - icon: mdi:washing-machine - -group: - laundry: - name: Laundry - control: hidden - entities: - - input_boolean.washing_machine_busy - - automation.washing_machine_started - - automation.washing_machine_completed