During the holiday period the plants in the house need water. For this I build a small indoor irrigation system based on Zigbee.
Hardware:
Next to a plant there is container or bucket with 10 liter of water. A small 12v aquarium pump is at the bottom of the container. A plastic hose with is transporting the water to the plant. Depending on the plant and it’s water requirements the pump has to run for x seconds.
Electronics:
The pump is connected to the CC2530 module via a suitable Mosfet. A diode is added as extra protection for the mosfet. As you can see 3.3v and 12v is needed. Make sure the power rating of the Mosfet is sufficient for the pump.
Software:
The CC2530 module is flashed with the great PTVO configurable firmware (Zigbee Configurable Firmware v2.5 – Zigbee Hobbyist. Rock Pi 4 SBC 187). Flashing is done with the CC debugger and the free software from TI (FLASH-PROGRAMMER Software programming tool | TI.com 42) not V2.
In this setup you can control two pumps (P11, P13).
Automation:
The amount of water per plant is critical. So we need to accurately switch on and off the pump for x seconds. For this we use the CC2531 timer, by creating a timer switch for 10 seconds:
- platform: mqtt
unique_id: plantenbak_zuid
name: "Plantenbak zuid 0.5l"
icon: mdi:cup-water
state_topic: "zigbee2mqtt/0x00124b000e95c57b"
command_topic: "zigbee2mqtt/0x00124b000e95c57b/l1/set"
availability_topic: "zigbee2mqtt/bridge/state"
payload_off: "OFF"
payload_on: '{"trigger": 10000}'
value_template: "{{ value_json.state_l1 }}"
retain: true
In my case the plant needs 3 liter of water, but not in one go, but in 0,5 liter portions. This is done by a script:
plantenbak_zuid_3l:
# 6x 10 sec 0.5 liter
sequence:
- service: switch.turn_on
entity_id: switch.plantenbak_zuid
- delay:
milliseconds: 180000
- service: switch.turn_on
entity_id: switch.plantenbak_zuid
- delay:
milliseconds: 180000
- service: switch.turn_on
entity_id: switch.plantenbak_zuid
- delay:
milliseconds: 180000
- service: switch.turn_on
entity_id: switch.plantenbak_zuid
- delay:
milliseconds: 180000
- service: switch.turn_on
entity_id: switch.plantenbak_zuid
- delay:
milliseconds: 180000
- service: switch.turn_on
entity_id: switch.plantenbak_zuid
Scheduling:
Depending on the water schedule of the plant, I wanted to choose on what weekday the irrigation was done. For that I used the scheduling tool How to create the alarm clock in HASS? - #16 by Hellis81 from @123 .
- id: 'irrigationschedule'
alias: Schedule 1
trigger:
platform: template
value_template: "{{ states('sensor.time') == states('sensor.irrigation_time') }}"
condition:
condition: template
value_template: >
{% set today = 'input_boolean.irrigationweekday_' ~ now().strftime("%a") | lower ~ '_1' %}
{{ is_state('input_boolean.irrigationstatus', 'on') and is_state(today, 'on') }}
action:
- service: script.turn_on
target:
entity_id:
- script.plantenbak_zuid_3l
Now I can go on holiday