Integration with Orbit B-Hyve Irrigation System

Yea i also would just like to say thanks to Sebr

I was standing in home depot seen this orbit, googled ‘orbit bhyve homeassistant’

Found the github, made purchase. Been working great for a year.

SteveA you dont need to worry about that script.

There are others that have posted complete watering / garden scripts/automatons
I could also post what I use, but it will take me some time to organize it into a post-able format.

let me know if you need it.

2 Likes

Hi, I would like to see an example of what can be done with automation/scripting.
I have just started tinkering with this and have six b-hyve hose timers imported into HA that water zones of my yard. I also have the bhyve_next_watering script set up and I see output from it in the debug logging.
I am just not sure what is possible to do as a next step. I was hoping to be able to define one or more zone watering sequences that I could trigger either manually/scheduled or both. And hopefully it would be easier/better than having to do everything in the Orbit app.
It seems like there is good info here and I will get something together soon enough.

@fiftys any new information is always welcome. I am 2 weeks in on HASS and so far it has been a great discovery. The community is tops and I am addicted.

1 Like

Im working on it.

1 Like

Hi, I have been messing around with this integration for about a week and have a couple of questions to see if my use case is something I can figure out with the help of H-A.

My setup:

  • Six hose timers and and the WiFi hub. 3 front yard and 3 back yard.
  • H-A is running in a container on an old Mac mini.
  • The sensors and switches are visible and can be operated from within H-A.
  • All zone controllers are now operating on smart program/smart watering (as set from the B-Hyve app).
  • bhyve_next_watering script is running with a automation script triggering for each zone on state change events similar to the example that was posted by Angelo last October:
    https://community.home-assistant.io/t/integration-with-orbit-b-hyve-irrigation-system/39688/215

Once I made each program/zone smart watering only, the next watering script comes up with ‘None’ as a next watering time. So not sure if I should be using a manual program triggers in the bhyve app in order for that to work.

So my two main questions:
1: Has anyone done something based on a manual action in H-A that would have each zone trigger one at a time, in succession, for a set period of time? I would like to be able to trigger an activity that would fire each zone one at a time for 20 min each.

2: Should I be using only Smart Programs/Zones in ther B-hyve settings? I am concerned that the next_watering calculations seem to be several days into the future based on the time stamps that are being produced.

Sorry about the rookie-level questions. I have done a fair amount of scanning of this thread to pick up what I can. Would really like to have a combination of smart watering with the ability to manually trigger a sequential watering of all zones at any time.

This is really cool stuff. Thanks for providing this integration and the community’s support.

Patrick

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.

southlawn

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)

5 Likes

Okay I just noticed that I screwed up the coding for the card. Fixed it in the post.

I had this forum open for nearly a week randomly adding to it… messed it up as i knew i would.

Should be fixed though for a direct copy/paste as long as you have those custom cards installed.

1 Like

Took me a while, but I have just about got this working. Got the card fully displaying for one of my zones. Thanks so much for posting! It is definitely helping me learn my way around H-A.

1 Like

No problem. Glad it could help.

Hello,

I started using this integration but time to time the entities tracking history getting unavailable. Is there a trick I missed?

I have exactly the same problem since months. After a restart the sensor is available for one day in best case. I developed my own water usage counter and ignore the history sensor

I’m interested in setting up something similar, could you give some details on how you did it? I’m not sure if using the integration integration would work or not for example.

Could you provide us with your solution/code?

Ok,

create a variable (hass-variable integration):

last_water_consumption:
  value: 0
  restore: true
  name: "Letzter Wasserverbrauch"
  attributes:
    minutes: 0
    unit_of_measurement: "l"
    per_m2: 0
    total_consumption: 0
````

this is my automation when the irrigation starts:

````
- id: "151b"
  alias: "Store Water Consumption when starting"
  initial_state: true
  trigger:
    - platform: state
      entity_id: switch.zone_1_zone
      to: "on"
  action:
    - service: variable.set_variable
      data:
        variable: last_water_consumption
        value: "0"
        attributes:
          minutes: "0"
          per_m2: "0"
          total_consumption: "0"
    - alias: "Count liters every minute"
      repeat:
        sequence:
          - delay:
              minutes: 1
          - service: variable.set_variable
            data:
              variable: last_water_consumption
              # bHyve calculated 6,3 l per minute. I reduce the value as some water goes left and right
              value: "6.1"
              attributes:
                minutes: "{{ state_attr('variable.last_water_consumption','minutes')|int + 1 }}"
                per_m2: "0.51"
                total_consumption: "{{ state_attr('variable.last_water_consumption','total_consumption')|float + 6.1 }}"
        until:
          - condition: state
            entity_id: switch.zone_1_zone
            state: "off"
````

during the night, I store the values into another one in order to have yesterdays irrigation.
This variable is recorded, so I have a 7 days daily water history
As you can see, I do that with rain totals as well.

````
- id: "20017"
  alias: "Store Raintotal"
  initial_state: true
  trigger:
    - platform: time
      at: "23:59:15"
  action:
    - service: variable.set_variable
      data:
        variable: last_rain_total_at_night
        value_template: "{{ states('variable.last_rs_garten_sum_rain_24') }}"
    - service: variable.set_variable
      data:
        variable: last_irrigation_total_at_night
        value: "{{ states('sensor.daily_total_watering') }}"
    - service: script.turn_on
      entity_id: script.add_log
      data:
        variables:
          name: "Sicherung Bewässerung"
          message: "rain: {{ states('sensor.netatmo_imeerbus121_wohnzimmer_rs_garten_rain_today') }} and water: {{ states('sensor.daily_total_watering') }} successful stored"

````

Important to know: I start the irrigation only once a day. In other cases you have to separate the variables initialization  and do it after you saved the daily total.

i have 2 Bhyve valves i can see the first valve in the entities (switch.frount). The other Valve all the other property show up under the entities but not (swich.garden) my second valve. Can anyone help me or tell me what i might have done wrong?
config
switch:
platform: bhyve

sensor:

  • platform: bhyve

bhyve:
username: ########
password: ************

Make sure it’s connected to the wifi hub - if you are connected with your phone via bluetooth it won’t be usable with the HA integration

Ok i found the Entity it is (switch.zone). Who do i change the name?

Rename it in the bhyve app then restart HA


I have it set as “Garden” in app all of the other entities are Garden except “switch.zone”.
am i looking at the wrong thing?

You renamed the device. You need to rename the Zone :slight_smile: . Welcome to the most confusing app ever :slight_smile:

1 Like