Irrigation Custom Component with Custom Card

Peter

This is the template with the above disabled

Template: {{ states('sensor.time') + ':00' == states('input_datetime.irrigation_morning_start_time') and is_state('input_boolean.irrigation_on', 'on') and states('input_select.irrigation_freq')|int == ((as_timestamp(now()) - as_timestamp(states.switch.morning.attributes.last_ran) | int) /86400) | int(0) }}

Does the template only build on a restart of HA. What will cause the template to reevaluate

also in the dev tools when the template is validated there is a entity

  • Entity : sensor.time

I do not have this entity in my installation

Added this entity in, and now the template will validate to true, but the program does not start

HI Terrence, I installed the component on a new HA install and found the problem. I have also added some additional validation to pickup when the time pre-req is not there and updated the github documentation to add the senor.time requirement. If you copy the irrigationprogram.switch.py and set up the sensor.time and restart it should be good to go.

  - platform: time_date
    display_options:
      - 'time'
      - 'date'

Hi Terrence, just realised I copied the file into the wrong location. If you have downloaded the file please try again. Sorry

ok now its working

Thanks for persisting with this, a better product for everyone else now.

1 Like

Just release an updated version removing the dependency on the HA data time sensor integration.

1 Like

Hiā€¦

love this componentā€¦ think I have figured most of it out, but still running into a problem

hassio current version
pi 4b

installed v2 as per directions
copied irrigationprogram and irrigationzone to custom components
copied dummy switches and irrigation yaml to my pkgs directory and modified accordingly.

check config, all is good.
reboot

then setup lovelace cards with the file you have provided

everything shows up as it should.

now, modify for MY switches and sensors
update lovelace to show my rain sensor and my irrigation controller status
update irrigation.yaml to include my switches (using switches created by b-hyve component)
update irrigation.yaml to reflect my rain_sensor

reboot home assistant

everything looks good, looks like itā€™s working, but the switches for this component will NOT turn on my BHyve switches. it seems to flash (i can see my status flip from auto to manual in BHyve, but then the switch instantly turns off)

what am I missing??

I have also removed the dummy_switches.yaml as I am guessing it is no longer needed now that I have defined my own.

I have attached my irrigation.yaml to show my changes (i tried to highlight to show my modifications)

Your help is appreciated!

irrigation_component:
    switch:
      - platform: irrigationzone
        switches:
          pot_plants:
            friendly_name: Pot Plants
            water: input_number.irrigation_pot_plants_run
            wait: input_number.irrigation_pot_plants_wait
            repeat: input_number.irrigation_pot_plants_repeat
            switch_entity: **switch.back_dripline_zone**
            icon_off: 'mdi:flower'
          front_lawn:
            friendly_name: front Lawn
            water: input_number.irrigation_lawn_run
            wait: input_number.irrigation_lawn_wait
            repeat: input_number.irrigation_lawn_repeat
            switch_entity: **switch.front_lawn_zone**
            icon_off: 'mdi:grass'
          vege_patch:
            friendly_name: Vege Patch
            water: input_number.irrigation_vege_run
            wait: input_number.irrigation_vege_wait
            repeat: input_number.irrigation_vege_repeat
            icon_off: 'mdi:carrot'
            switch_entity: **switch.front_street_zone**

      - platform: irrigationprogram
        switches: 
          morning:
            friendly_name: Morning
            irrigation_on: input_boolean.irrigation_on
            start_time: input_datetime.irrigation_morning_start_time
            run_freq: input_select.irrigation_freq
        #    run_days: input_select.irrigation_run_days
            rain_sensor: **binary_sensor.meteobridge_is_raining**
            ignore_rain_sensor: input_boolean.irrigation_ignore_rain_sensor
            icon: mdi:fountain
            zones:
              - zone: **switch.pot_plants**
              - zone: **switch.front_lawn**
              - zone: **switch.vege_patch_**


Hi,

Glad you like it, itā€™s nice to get some feedback. I been using HA for a few years now and feel better giving a bit back for such a good product.

A couple of questions to help get to the heart of the issue:

  • Are there any errors in the log file when you restart HA?, an error is generated if there are objects that are used that canā€™t be found.
  • Are there any errors in the log when the program tries to start?
  • If you start the morning program manually do your switches start? If it runs your config is OK.
  • what frequency have you set, and what is the value of last_ran attribute of the morning switch?

When the program is first set up the last_ran attribute is set to today so if you are using the frequency option it wonā€™t run until the next day. You can use the developer tools to modify the attribute for testing. I should add this to the setup notes and default to yesterday. I will add this to my to do list.

Let me know how you go.

1 Like

Thanx for the replyā€¦

yes, just noticed a couple that I should have included

sensor,time not found add senor platform time

6:18:00 AM ā€“ irrigationprogram (ERROR)

but I do have time_date setup in my config.yaml, and sensor.time does show as a valid entity

  - platform: time_date
    display_options:
      - 'time'
      - 'date'

binary_sensor.meteobridge_is_raining not found

6:18:00 AM ā€“ irrigationprogram (ERROR)

again, this is setup and working in my config

also get this one, which is something iā€™m sure you are already aware of for both irrigationzone and irrigation program

  • No ā€˜versionā€™ key in the manifest file for custom integration ā€˜irrigationzoneā€™. This will not be allowed in a future version of Home Assistant. Please report this to the maintainer of ā€˜irrigationzoneā€™

none that I can see. unless I am not looking in the correct place.

yes, your component appears to work, it just doesnā€™t seem to want to turn MY switches on. Again, I can see the status of my b-hyve component flip from auto to manual, but then it turns right off (my zone switch will not stay on)

frequency is currently set to 1 and the last_ran attribute shows as todays date. Speaking of which, what does the frequency setting in the program do?

Thanx again in advance for the help!!!

follow up to the aboveā€¦

it seems to be something related to MY irrigations switches (created by b-hyve component - switch.back_dripline_zone). Your irrigation component appears to be working.

if I change this switch above to one of my light switches, the irrigation program works and turns my light on and off as expected.

I have tested my irrigation switches in the developer section with the switch.turn_on service and it works as expected.

strange - any ideas??

Hi. Frequency sets up how often the program runs, 1 is daily, 2 is every second day and so on. The last run day keeps the information on the left time it ran so can calculate when to run again.

I have a couple of ideas on what I can change that may help, Iā€™ll make the changes over the next few days and post again when I have a new version.

Appreciate the help.

Thanx!!

I uploaded the new version, fixed the version warning and tweaked one area that could be a problem, not hugely confident I am fixing your underlying problem though.

New switch,py files and manifest,json files for both components.

yes, I saw thatā€¦ Thank you!!!

yup, that seems to have solved the issue.

I can now access my bhyve switches directly as configured or by setting up dummy switches with additional configuration to allow for their limitation of manual run times with the bhyve switches.

ieā€¦

      dummy_4:
        value_template: "{{ is_state('switch.front_door_shrubs_zone', 'on') }}"
        turn_on:
          service: bhyve.start_watering
          data:
            entity_id: switch.front_door_shrubs_zone
            #max minutes to run
            minutes: 60
        turn_off:
          service: bhyve.stop_watering
          data:
            entity_id: switch.front_door_shrubs_zone

I do still see the error about not being able to load my rain sensor, but I am guessing that is a startup issue and my sensor is NOT available at the time the irrigation_component loads.

you are awesome! Thanx for the help!!!

d

Works like a dream!!! Thanx for this Peter!

request for the future.

You currently have the wait and repeat set up by individual zone. Is there an easy way to set the wait and repeat for all zones?

ie
currently with 1 minute wait and 1 minute repeat set

zone 1
wait
zone 1
wait
zone 2
wait
zone 2
wait
etc

request would be (with or without the current setup for wait and repeat)
zone 1
zone 2
zone 3
zone ā€¦
wait
zone 1
zone 2
zone 3
zone ā€¦
etc

I am really looking forward to get to use this once it becomes a bit warmer here in Sweden (still drops below zero at night)!

I am building a greenhouse, should be able to work in there too, right?

What kind of hardware do you guys use?

I retract my previous request regarding repeats. It makes more sense to just take advantage of additional programs with different start times.

Hi, your right, that was my intention, also:

  • the wait cycle is optional, if you have a zone that doesnā€™t need it you donā€™t set it up. The idea is that my lawn likes a soaking so it just gets 20 minutes in one hit and the pots need small lots or the water runs through, but they all operate on the one program.
  • if you want the same wait cycle on several zones you can use the same inputs and change the design of your lovelace cards.