Alright, sorry it took so long. My setup is pretty much a confusing mess.
This post will probably be no different. Im 100% certain ill miss some stuff, and to be honest this might not be very new user friendly. Sorry about that. You dont have to use this card like mine. If you do you will need some extra cards installed, multiple-entity-row, button-card. cardmod. Or you can just pick and pull the enitites into a reguar entities card.
entities:
- entity: switch.sprinklers_zone
name: Sprinkler Valve
secondary_info: last-changed
- entity: switch.backyard_light
name: Backyard Light
secondary_info: last-changed
- entity: binary_sensor.zone_1_day_active
icon: 'mdi:sprinkler-variant'
- type: divider
- entities:
- input_number.zone_1_run_time
entity: sensor.zone_1_time_remaining
icon: 'mdi:clock'
name: Duration
secondary_info: last-changed
state_color: true
state_header: Remaining
type: 'custom:multiple-entity-row'
- entities:
- entity: input_datetime.zone_1_am_on_time
name: On Time
- entity: automation.irrigation_zone_1_am
name: Active
entity: automation.irrigation_zone_1_am
name: AM
state_color: true
toggle: true
type: 'custom:multiple-entity-row'
- entities:
- entity: input_datetime.zone_1_pm_on_time
name: On Time
- entity: automation.irrigation_zone_1_pm
name: Active
entity: automation.irrigation_zone_1_pm
name: PM
state_color: true
toggle: true
type: 'custom:multiple-entity-row'
- entities:
- color: var(--primary-color)
color_type: icon
entity: input_boolean.zone_1_mon
icon: 'mdi:roman-numeral-1'
name: Mon
tap_action:
action: toggle
type: 'custom:button-card'
- color: var(--primary-color)
color_type: icon
entity: input_boolean.zone_1_tue
icon: 'mdi:roman-numeral-2'
name: Tue
state:
- spin: false
value: 'on'
width: 35px
tap_action:
action: toggle
type: 'custom:button-card'
- color: var(--primary-color)
color_type: icon
entity: input_boolean.zone_1_wed
icon: 'mdi:roman-numeral-3'
name: Wed
tap_action:
action: toggle
type: 'custom:button-card'
- color: var(--primary-color)
color_type: icon
entity: input_boolean.zone_1_thu
icon: 'mdi:roman-numeral-4'
name: Thu
tap_action:
action: toggle
type: 'custom:button-card'
- color: var(--primary-color)
color_type: icon
entity: input_boolean.zone_1_fri
icon: 'mdi:roman-numeral-5'
name: Fri
tap_action:
action: toggle
type: 'custom:button-card'
- color: var(--primary-color)
color_type: icon
entity: input_boolean.zone_1_sat
icon: 'mdi:roman-numeral-6'
name: Sat
tap_action:
action: toggle
type: 'custom:button-card'
- color: var(--primary-color)
color_type: icon
entity: input_boolean.zone_1_sun
icon: 'mdi:roman-numeral-7'
name: Sun
tap_action:
action: toggle
type: 'custom:button-card'
entity: binary_sensor.zone_1_day_active
icon: 'mdi:calendar-week'
name: Days
state_header: Active
type: 'custom:multiple-entity-row'
show_header_toggle: false
style: |
ha-card {
border: solid 2px var(--primary-color);
border-radius: 70px;
box-shadow: none;
}
title: South Lawn
type: entities
Here is what you will need.
make this binary_sensor with these input_boolean helpers.
- platform: template
sensors:
zone_1_day_active:
friendly_name: Irrigation Day Active
value_template: >-
{{ ( is_state('input_boolean.zone_1_mon', 'on') and now().weekday() == 0 )
or ( is_state('input_boolean.zone_1_tue', 'on') and now().weekday() == 1 )
or ( is_state('input_boolean.zone_1_wed', 'on') and now().weekday() == 2 )
or ( is_state('input_boolean.zone_1_thu', 'on') and now().weekday() == 3 )
or ( is_state('input_boolean.zone_1_fri', 'on') and now().weekday() == 4 )
or ( is_state('input_boolean.zone_1_sat', 'on') and now().weekday() == 5 )
or ( is_state('input_boolean.zone_1_sun', 'on') and now().weekday() == 6 ) }}
Input_datetime helpers
zone_1_am_on_time:
name: AM On Time
has_date: false
has_time: true
zone_1_pm_on_time:
name: PM On Time
has_date: false
has_time: true
input_number helpers
zone_1_run_time:
name: Run Time
min: 1
max: 20
step: 1
unit_of_measurement: min
icon: mdi:clock
sensors:
- platform: template
sensors:
zone_1_time_remaining:
friendly_name: "Time Remaining"
value_template: >
{% set x = states('sensor.time') %}
{% if is_state('switch.sprinklers_zone', 'on') %}
{{ [ (states('input_number.zone_1_run_time') | float - (as_timestamp(now()) - as_timestamp(states.switch.sprinklers_zone.last_changed)) / 60) | round(0) ,0 ] | max }}
{% else %}
0
{% endif %}
unit_of_measurement: "min"
automations:
- id: irrigation_zone_1_am
alias: Irrigation Zone 1 AM
trigger:
- platform: template
value_template: '{{ states("sensor.time") == states("input_datetime.zone_1_am_on_time").rsplit(":",1)[0]
}}'
condition:
- condition: state
entity_id: binary_sensor.zone_1_day_active
state: 'on'
action:
- service: switch.turn_on
entity_id: switch.sprinklers_zone
mode: single
- id: irrigation_zone_1_pm
alias: Irrigation Zone 1 PM
trigger:
- platform: template
value_template: '{{ states("sensor.time") == states("input_datetime.zone_1_pm_on_time").rsplit(":",1)[0]
}}'
condition:
- condition: state
entity_id: binary_sensor.zone_1_day_active
state: 'on'
action:
- service: switch.turn_on
entity_id: switch.sprinklers_zone
mode: single
- id: irrigation_zone_1_off
alias: Irrigation Zone 1 Off
trigger:
- platform: numeric_state
entity_id: sensor.zone_1_time_remaining
below: '1'
- platform: state
entity_id: switch.sprinklers_zone
to: 'on'
for: 0:15:00
condition:
- condition: state
entity_id: switch.sprinklers_zone
state: 'on'
action:
- service: switch.turn_off
entity_id: switch.sprinklers_zone
initial_state: true
mode: single
Might have missed soemthing. I have two setups but mainly use this.
Ill gather the second more elaborate setup soon. Sorry this took so long. Life, busy, etc.
also I didnt write these (except for the card layout). I found them on this forum and github. so credit goes to those people.
another thing, I have all the auto stuff and smart stuff turned off in the b-hyve app. it says ‘these zones are never set to water’: 1,2,3’ and ‘you have no programs scheduled’ everything is running off of the homeassistant automations. I did have to set the manual run time in the app, to a few mins higher(20min) than any of my automations will ever run (15min)