Skip to content

Latest commit

 

History

History
287 lines (255 loc) · 13.4 KB

RECIPES.md

File metadata and controls

287 lines (255 loc) · 13.4 KB

TOC

Watering the lawn based on the current soil moisture and time of day. With the aim that the lawn is watered sufficiently but is not too wet.

Why not with the Gardena App:

The problem of Gardena automation for lawn irrigation is that this ...

  1. not flexible enough for soil moisture
  2. not dynamic enough
  3. Lawn gets too wet
  4. Water consumption is too high

Requirements

Automation example:

- id: lawn_irrigation_garden
  alias: lawn irrigation garden
  trigger:
    platform: time_pattern
    minutes: '/15'
    seconds: 0
  condition:
    condition: and
    conditions:
     - condition: state
       entity_id: timer.lawn_irrigation_garden
       state: 'idle'
     - condition: numeric_state
       entity_id: sensor.garden_sensor_light_intensity
       below: 10
     - condition: numeric_state
       entity_id: sensor.plant bed_sensor_light_intensity
       below: 10
     - condition: numeric_state
       entity_id: sensor.garden_sensor_ambient_temperature
       above: 5
     - condition: numeric_state
       entity_id: sensor.garden_sensor_soil_humidity
       below: 10
  action:
    - service: timer.start
      entity_id: timer.timer.lawn_irrigation_garden
    - service: switch.turn_on
      entity_id: switch.garden_water_control
    - delay: 0:12:00 
    - service: switch.turn_off
      entity_id: switch.garden_water_control
    - delay: 0:60:00 
    - service: switch.turn_on
      entity_id: switch.garden_water_control
    - delay: 0:24:00
    - service: switch.turn_off
      entity_id: switch.garden_water_control
    - delay: 0:60:00
    - service: switch.turn_on
      entity_id: switch.garden_water_control
    - delay: 0:24:00
    - service: switch.turn_off 

Why not with the Gardena App:

It is not possible to get Messages from the status of the smart water or the sensor devices.

It is not possible to get this notifications over Amazon Alexa from the App

Requirements

  1. Installed hass-gardena-smart-system integration
  2. Home Assistant Compagnion iOS or Android App
  3. Gardena smart control
  4. Gardena Smart Sensor or other sensors for depending values
  5. Gardena Pipeline System
  6. (optional) Telegram Messenger Integration
  7. (optional) Alexa Media Player Integration you can find and install this Integration over HACS

Configuration:

only needed for Telegram

- alias: "Notify lawn irrigation garden on"
  trigger:
    platform: state
    entity_id: switch.garden_water_control
    to: 'on'
  action:
    - service: notify.notify
      data:
        title: "lawn irrigation"
        message: "Watering in the garden has started"
    - service: notify.alexa_media
      data:
        data:
          type: announce
        target: 
          - media_player.radio_livingroom
        message: "Watering in the garden has started. The humidity is currently {{ states.sensor.garden_sensor_humidity.state }}% the temperature is now {{ states.sensor.garden_sensor_temperature.state }}°C"
    - service: notify.telegram_[you Telegram channel]
      data_template:
        title: '*Watering in the garden has started!*'
        message: "Watering in the garden has started. The humidity is currently {{ states.sensor.garden_sensor_humidity.state }}% the temperature is now {{ states.sensor.garden_sensor_temperature.state }}°C -> https://[public HA URL]/lovelace/terrasse"
        data:
            inline_keyboard:
            - 'Stop watering:/stopwateringgarden'
            - ' Stop for 3 hours:/stopwateringgarden3h, Stop for 24 hours:/stopwateringgarden24h'
          
- id: 'telegram_stop_watering_garden'
  alias: 'Telegram Stop watering garden'
  
  trigger:
    platform: event
    event_type: telegram_callback
    event_data:
      data: '/stopwateringgarden'
  action:
  - service: telegram_bot.answer_callback_query
    data_template:
      callback_query_id: '{{ trigger.event.data.id }}'
      message: 'OK, I'll stop watering the garden'
  - service: switch.turn_off
    entity_id: switch.garden_water_control
  - service: notify.telegram_[you Telegram channel]
    data_template:
      title: '*Watering garden!*'
      message: "Watering stopped in the garden https://[public HA URL]/lovelace/terrasse"

- id: 'telegram_stop_watering_garden_3h'
  alias: 'Telegram watering stop 3h'
  trigger:
    platform: event
    event_type: telegram_callback
    event_data:
      data: '/stopwateringgarden3h'
  action:
  - service: telegram_bot.answer_callback_query
    data_template:
      callback_query_id: '{{ trigger.event.data.id }}'
      message: 'OK, stop watering for 3 hours'
  - service: automation.turn_off
    entity_id: automation.lawn_irrigation_garden
  - service: notify.telegram_[you Telegram channel]
    data_template:
      title: '*Watering Garden!*'
      message: "Irrigation in the garden interrupted for 3 hours https://[public HA URL]/lovelace/terrasse"
  - delay: '03:00:00'
  - service: automation.turn_on
    entity_id: automation.lawn_irrigation_garden
  - service: notify.telegram_[you Telegram channel]
    data_template:
      title: '*Watering Garden!*'
      message: "Automation for irrigation in the garden was restarted after 3 hours https://[public HA URL]/lovelace/terrasse"

- id: 'telegram_stop_watering_garden_24h'
  alias: 'Telegram watering stop 24h'
  trigger:
    platform: event
    event_type: telegram_callback
    event_data:
      data: '/stopwateringgarden24h'
  action:
  - service: telegram_bot.answer_callback_query
    data_template:
      callback_query_id: '{{ trigger.event.data.id }}'
      message: 'OK, stop watering for 24 hours'
  - service: automation.turn_off
    entity_id: automation.lawn_irrigation_garden
  - service: notify.telegram_[you Telegram channel]
    data_template:
      title: '*Watering Garden!*'
      message: "OK, stop watering for 24 hours https://[public HA URL]/lovelace/terrasse"
  - delay: '24:00:00'
  - service: automation.turn_on
    entity_id: automation.lawn_irrigation_garden
  - service: notify.telegram_[you Telegram channel]
    data_template:
      title: '*Watering Garden!*'
      message: "Automation for irrigation in the garden was restarted after 24 hours https://[public HA URL]/lovelace/terrasse"

- alias: "Notify watering Garden off"
  trigger:
    platform: state
    entity_id: switch.garden_water_control
    to: 'off'
  action:
    - service: notify.notify
      data:
        title: "Watering Garden"
        message: "Watering in the garden has ended"      
   - service: notify.alexa_media
      data:
        data:
          type: announce
        target: 
          - media_player.radio_wohnzimmer
        message: "Watering in the garden has ended. The humidity is now {{ states.sensor.garden_sensor_humidity.state }}%"
    - service: notify.telegram_[you Telegram channel]
      data_template:
        title: '*Watering in the garden has ended!*'
        message: "Watering in the garden has ended. The humidity is now {{ states.sensor.garden_sensor_humidity.state }}% -> https://[public HA URL]/lovelace/terrasse"

Use a NFC tag to start and stop mowing

Normaly my Gardena Irrigation Control works per automations, but in a part of situations i have to start/stop it manualy (i.e. I will fill a pot with water) in this cases i have before use my Smartphone open the App search for the Watercontroll entity and start/stop this.

Now with the NFC tag integration from HomeAssistant thats is more easy than befor, now i’m scan with my Smartphone an tag on my Hose trolley and give the okay that the tag starts the HA App and the water control starts if it's off and stopps if it's on.

Steps for this.

  1. Buy an NFC tag like this one https://www.amazon.de/dp/B06Y1BLLD4?ref=ppx_pop_mob_ap_share

  2. Install the HA Companion App on your Smartphone (if you have't do this before)

  3. Write the NFC tag with the HA App 28CB9BFE-3F41-4D96-91EA-34D6EEA1A0CF

1F0AF2E9-4E1B-4634-BB39-9C9A173125BD 6BA84B75-05BE-4730-8C35-BF274F7E2A82 217C9CD3-4F58-48DD-A7FB-EB1211C11F29 F53B6C62-1910-4871-A54F-FDA875E09B78 0E495C12-8DF9-4B79-8681-D9842C73815C

  1. Go to the NFC tag configuration in HA and give your NFC tag an readable name and create an Automation like this on

1B9A0B40-1FF8-4B37-8D69-1BA737A097EA CEFDA1D6-094A-4C3F-AB9F-06465707CAFF 2C4047E5-7F17-4CF5-8D06-83361184C914 7F8A4DEA-49BA-4557-865D-7582D5E67C26 F2278990-D81C-4A01-86A9-8D85F9C95032 6CF720DC-4F9B-4B20-B1EF-DF169F405CE9 70A2AC60-AFFC-467C-B294-A0A93D253DBE

##########################################################################
# Control Watercontrol with NFC tag
##########################################################################

- id: '1600768999472'
  alias: 'NFC Tag Garden watering on/off is scanned if water is off'
  description: If the irrigation in the garden is off start watering
  trigger:
  - platform: tag
    tag_id: 9dc6d5b1-651d-4880-839c-19cdd798a5f8
  condition:
  - condition: device
    type: is_off
    device_id: eecdf62964f3494d877413f7bd7b2a45
    entity_id: switch.garten_water_control
    domain: switch
  action:
  - type: turn_on
    device_id: eecdf62964f3494d877413f7bd7b2a45
    entity_id: switch.garten_water_control
    domain: switch
  mode: single

- id: '1600769207834'
  alias: 'NFC Tag Garden watering on/off is scanned if water is on'
  description: If the irrigation in the garden is on stop watering
  trigger:
  - platform: tag
    tag_id: 9dc6d5b1-651d-4880-839c-19cdd798a5f8
  condition:
  - condition: device
    type: is_on
    device_id: eecdf62964f3494d877413f7bd7b2a45
    entity_id: switch.garten_water_control
    domain: switch
  action:
  - type: turn_off
    device_id: eecdf62964f3494d877413f7bd7b2a45
    entity_id: switch.garten_water_control
    domain: switch
  mode: single```