Christmas is here, and that means automations! First up is the Christmas Tree.
This automation and device keep the Christmas tree watered at all times. It consists of a DC pump, water tank, ESPHome, Wemos Mini and some simple circuitry.
From the Wemos I have two wires running into the tree foot, where, with the help of a voltage dividing resistor, measure if the water level is above or below the wires. I have the positive wire connected to a seperate output on the Wemos, so that it only turns on when a measurement is taken. This prevents corrosion.
So the automation first turns on the positive pin, measures the voltage between the wires and, depending on the result, turns the pump on for a couple of seconds. It does this every fifteen minutes, keeping the tree watered all through the holidays.
In addition I have added an external water leak sensor around the tree, in case of malfunction and spillage.
# Turn on the positive pin first
- alias: Turn on ADC Pin
trigger:
platform: time_pattern
minutes: '/15'
action:
- service: switch.turn_on
data:
entity_id: switch.adc_power_on_pin
- delay:
seconds: 3
- service: switch.turn_off
data:
entity_id: switch.adc_power_on_pin
# Run pump if water is low
- alias: Water Xmas Tree
trigger:
platform: state
entity_id: switch.adc_power_on_pin
to: "on"
# Wait for the pin voltage to settle:
for: "00:00:01"
condition:
condition: and
conditions:
# Voltage level read on ADC Pin:
- condition: numeric_state
entity_id: sensor.christmas_tree_water_level
below: 0.08
# Only at night:
- condition: time
after: '09:00:00'
before: '21:00:00'
action:
- service: switch.turn_on
data:
entity_id: switch.christmas_tree_pump
- delay:
seconds: 2
- service: switch.turn_off
data:
entity_id: switch.christmas_tree_pump
# Prevent corrosion:
- service: switch.turn_off
data:
entity_id: switch.adc_power_on_pin