bhyve-home-assistant icon indicating copy to clipboard operation
bhyve-home-assistant copied to clipboard

Switch Entities go on/off/on when toggling, some do not stay on

Open KidA001 opened this issue 2 years ago • 6 comments

Describe the bug When toggling a zone switch, the state goes to on, then off, then back to on. They are extremely delayed at time, up to 1-2min before the switches reflect the actual state. Sometimes they cannot be turned off. HA will display them as off but they are still running. I have tested this on 2.2.3, 3.0.0-beta2 and the new 3.0.0 release

Expected behaviour The switch stays on and turns the actual device on.

BHyve devices 4 Wifi Hubs and 5 Timers

Logs

2022-07-01 18:42:40 DEBUG (MainThread) [custom_components.bhyve.pybhyve.client] Logged in
2022-07-01 18:42:41 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.hacs
2022-07-01 18:42:41 INFO (MainThread) [custom_components.bhyve.sensor] Creating state sensor: Temple Roof state
2022-07-01 18:42:41 DEBUG (MainThread) [custom_components.bhyve.sensor] State sensor Temple Roof state setup: State: auto | Available: True
2022-07-01 18:42:41 INFO (MainThread) [custom_components.bhyve.sensor] Creating history sensor: Zone 1 zone history
2022-07-01 18:42:41 INFO (MainThread) [custom_components.bhyve.sensor] Creating battery sensor: Temple Roof battery level
2022-07-01 18:42:41 INFO (MainThread) [custom_components.bhyve.sensor] Creating state sensor: Main House Roof state
2022-07-01 18:42:41 DEBUG (MainThread) [custom_components.bhyve.sensor] State sensor Main House Roof state setup: State: manual | Available: True
2022-07-01 18:42:41 INFO (MainThread) [custom_components.bhyve.sensor] Creating history sensor: Zone 1 zone history
2022-07-01 18:42:41 INFO (MainThread) [custom_components.bhyve.sensor] Creating battery sensor: Main House Roof battery level
2022-07-01 18:42:41 INFO (MainThread) [custom_components.bhyve.sensor] Creating state sensor: Temple Garden state
2022-07-01 18:42:41 DEBUG (MainThread) [custom_components.bhyve.sensor] State sensor Temple Garden state setup: State: auto | Available: False
2022-07-01 18:42:41 INFO (MainThread) [custom_components.bhyve.sensor] Creating history sensor: Zone 1 zone history
2022-07-01 18:42:41 INFO (MainThread) [custom_components.bhyve.sensor] Creating battery sensor: Temple Garden battery level
2022-07-01 18:42:41 INFO (MainThread) [custom_components.bhyve.sensor] Creating state sensor: Main House Garden state
2022-07-01 18:42:41 DEBUG (MainThread) [custom_components.bhyve.sensor] State sensor Main House Garden state setup: State: auto | Available: False
2022-07-01 18:42:41 INFO (MainThread) [custom_components.bhyve.sensor] Creating history sensor: zone history
2022-07-01 18:42:41 INFO (MainThread) [custom_components.bhyve.sensor] Creating battery sensor: Main House Garden battery level
2022-07-01 18:42:41 INFO (MainThread) [custom_components.bhyve.sensor] Creating state sensor: Mister Deck state
2022-07-01 18:42:41 DEBUG (MainThread) [custom_components.bhyve.sensor] State sensor Mister Deck state setup: State: auto | Available: True
2022-07-01 18:42:41 INFO (MainThread) [custom_components.bhyve.sensor] Creating history sensor: Mister Deck zone history
2022-07-01 18:42:41 INFO (MainThread) [custom_components.bhyve.sensor] Creating battery sensor: Mister Deck battery level
2022-07-01 18:42:41 INFO (MainThread) [custom_components.bhyve.sensor] Creating state sensor: House Garden state
2022-07-01 18:42:41 DEBUG (MainThread) [custom_components.bhyve.sensor] State sensor House Garden state setup: State: auto | Available: True
2022-07-01 18:42:41 INFO (MainThread) [custom_components.bhyve.sensor] Creating history sensor: Main House Garden zone history
2022-07-01 18:42:41 INFO (MainThread) [custom_components.bhyve.sensor] Creating battery sensor: House Garden battery level
2022-07-01 18:42:41 INFO (MainThread) [custom_components.bhyve.sensor] Creating state sensor: Bluebird state
2022-07-01 18:42:41 DEBUG (MainThread) [custom_components.bhyve.sensor] State sensor Bluebird state setup: State: auto | Available: True
2022-07-01 18:42:41 INFO (MainThread) [custom_components.bhyve.sensor] Creating history sensor: Bluebird Zone zone history
2022-07-01 18:42:41 INFO (MainThread) [custom_components.bhyve.sensor] Creating state sensor: Tiny state
2022-07-01 18:42:41 DEBUG (MainThread) [custom_components.bhyve.sensor] State sensor Tiny state setup: State: auto | Available: True
2022-07-01 18:42:41 INFO (MainThread) [custom_components.bhyve.sensor] Creating history sensor: Tiny Zone zone history
2022-07-01 18:42:41 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=bhyve>

KidA001 avatar Jul 02 '22 01:07 KidA001

im having the same issue. latest version of the integration. its unusable in the current state unfortunately. the switch entity triggers the valve, but does not report state (goes on then immediately off but water keeps flowing) Following with interest.

ralphmackinder avatar Jul 08 '22 07:07 ralphmackinder

Also having this issue with latest version. Often there is no way to turn off the sprinklers once they have been triggered except by restarting HomeAssistant. Once HA has been rebooted, the correct state is loaded.

beehivemind avatar Jul 08 '22 21:07 beehivemind

@sebr any availability to look at this issue? Any more detail we can provide?

KidA001 avatar Jul 12 '22 15:07 KidA001

Hi folks, thanks for your patience here. Can you please attach the device diagnostics for one of the devices which exhibits this behaviour?

Screen Shot 2022-07-20 at 10 17 16 am

@KidA001 the debug logs don't show any event data which is needed for me to ascertain more information. Can you please reproduce the behaviour you are seeing and attach the logs again? You should see log lines which look like this:

2022-07-20 20:00:26 INFO (MainThread) [custom_components.bhyve] Message received: Lawn zone - 5ae3c7884f0c72d7d626ba06 - {'event': 'watering_in_progress_notification', 'program': 'manual', 'current_station': 1, 'run_time': 9.98, 'started_watering_station_at': '2022-07-20T10:00:24.000Z', 'rain_sensor_hold': False, 'device_id': '5ae3c7884f0c72d7d626ba06', 'timestamp': '2022-07-20T10:00:25.000Z'}

sebr avatar Jul 20 '22 10:07 sebr

@sebr Here are device diagnostics, working on reproducing and getting relevant the logs. @ralphmackinder do you have any details to share?

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2022.7.0",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.10.5",
    "docker": true,
    "arch": "aarch64",
    "timezone": "America/Los_Angeles",
    "os_name": "Linux",
    "os_version": "5.15.32-v8",
    "supervisor": "2022.07.0",
    "host_os": "Home Assistant OS 8.2",
    "docker_version": "20.10.14",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {
    "hacs": {
      "version": "1.25.5",
      "requirements": [
        "aiogithubapi>=22.2.4"
      ]
    },
    "bhyve": {
      "version": "3.0.0",
      "requirements": []
    }
  },
  "integration_manifest": {
    "domain": "bhyve",
    "version": "3.0.0",
    "name": "Orbit B-hyve",
    "config_flow": true,
    "documentation": "https://github.com/sebr/bhyve-home-assistant/blob/master/README.md",
    "dependencies": [],
    "codeowners": [
      "@sebr"
    ],
    "iot_class": "cloud_push",
    "requirements": [],
    "is_built_in": false
  },
  "data": {
    "devices": [
      {
        "last_connected_at": "2022-07-20T09:11:54.334Z",
        "address": "**REDACTED**",
        "timezone": {
          "dst_offset": 3600,
          "raw_offset": -28800,
          "timezone_id": "America/Los_Angeles",
          "timezone_name": "Pacific Daylight Time"
        },
        "full_location": "**REDACTED**",
        "firmware_version": "0030",
        "name": "Temple Water Hub",
        "type": "bridge",
        "updated_at": "2022-07-20T09:11:54.334Z",
        "reference": "4467552298e4",
        "mac_address": "4467552298e4",
        "mesh_id": "5f6f7d274f0c62a04bd1bc05",
        "status": {
          "watering_status": null,
          "next_start_time": "1970-01-01T00:00:00-07:00",
          "next_start_programs": []
        },
        "wifi_version": 0,
        "id": "5f6f7d274f0c30b3ab133bd3",
        "num_stations": 0,
        "user_id": "5f6f7cd74f0c30b3ab133bc8",
        "device_gateway_topic": "devices-2",
        "hardware_version": "BH1-0001",
        "is_connected": true,
        "location": "**REDACTED**",
        "created_at": "2020-09-26T17:40:55.515Z"
      },
      {
        "last_connected_at": "2022-07-20T09:11:54.336Z",
        "address": "**REDACTED**",
        "water_sense_mode": "off",
        "timezone": {
          "dst_offset": 3600,
          "raw_offset": -28800,
          "timezone_id": "America/Los_Angeles",
          "timezone_name": "Pacific Daylight Time"
        },
        "full_location": "**REDACTED**",
        "weather_forecast_location_id": "**REDACTED**",
        "firmware_version": "0041",
        "name": "Temple Roof",
        "type": "sprinkler_timer",
        "manual_preset_runtime_sec": 600,
        "battery": {
          "percent": 98,
          "charging": false
        },
        "restricted_frequency": null,
        "weather_delay_thresholds": {
          "precip_prob": 30,
          "precip_in": 0.125,
          "wind_speed_mph": 20,
          "freeze_temp_f": 37
        },
        "updated_at": "2022-07-20T12:15:21.299Z",
        "reference": "4467552298e4-19384",
        "mac_address": "44675513d6c3",
        "weather_station_id": "**REDACTED**",
        "mesh_id": "5f6f7d274f0c62a04bd1bc05",
        "status": {
          "run_mode": "auto",
          "next_start_programs": [
            "a"
          ],
          "rain_sensors": [],
          "watering_status": null,
          "rain_delay_suggested_at": "2021-06-09T22:58:22.619Z",
          "rain_delay": 0,
          "flow_sensor": null,
          "next_start_time": "2022-06-30T10:00:00-07:00",
          "rain_delay_started_at": "2022-07-08T20:20:16.000Z"
        },
        "id": "5f6f7f514f0c62a04bd1bc51",
        "num_stations": 1,
        "zones": [
          {
            "station": 1,
            "name": "Temple Roof",
            "num_sprinklers": 0,
            "catch_cup_volumes": [],
            "catch_cup_run_time": 0,
            "smart_watering_enabled": false,
            "flow_data": {
              "cycle_run_time_sec": 17,
              "flow_rate_gpm": 2.6452235294117648,
              "cycle_volume_gal": 0.74948
            }
          }
        ],
        "user_id": "5f6f7cd74f0c30b3ab133bc8",
        "google_home_status": null,
        "device_gateway_topic": "devices-2",
        "hardware_version": "HT25-0000",
        "is_connected": true,
        "location": "**REDACTED**",
        "created_at": "2020-09-26T17:50:09.121Z",
        "suggested_start_time": null,
        "et_id": "5644ff05ad27a7777ff6a068"
      },
      {
        "last_connected_at": "2022-07-20T09:10:47.004Z",
        "address": "**REDACTED**",
        "timezone": {
          "dst_offset": 3600,
          "raw_offset": -28800,
          "timezone_id": "America/Los_Angeles",
          "timezone_name": "Pacific Daylight Time"
        },
        "full_location": "**REDACTED**",
        "firmware_version": "0030",
        "name": "Living Room Hub",
        "type": "bridge",
        "updated_at": "2022-07-20T09:10:47.004Z",
        "reference": "446755231fa3",
        "mac_address": "446755231fa3",
        "mesh_id": "60e103564f0cc23b2fcc557f",
        "status": {
          "next_start_programs": [],
          "next_start_time": "1970-01-01T00:00:00-07:00"
        },
        "wifi_version": 0,
        "id": "60e103554f0cc23b2fcc557c",
        "num_stations": 0,
        "user_id": "5f6f7cd74f0c30b3ab133bc8",
        "device_gateway_topic": "devices-8",
        "hardware_version": "BH1-0001",
        "is_connected": true,
        "location": "**REDACTED**",
        "created_at": "2021-07-04T00:39:49.991Z"
      },
      {
        "last_connected_at": "2022-07-20T09:10:47.007Z",
        "address": "**REDACTED**",
        "water_sense_mode": "auto",
        "timezone": {
          "dst_offset": 3600,
          "raw_offset": -28800,
          "timezone_id": "America/Los_Angeles",
          "timezone_name": "Pacific Daylight Time"
        },
        "full_location": "**REDACTED**",
        "weather_forecast_location_id": "**REDACTED**",
        "firmware_version": "0041",
        "name": "Main House Roof",
        "type": "sprinkler_timer",
        "manual_preset_runtime_sec": 600,
        "battery": {
          "percent": 100,
          "charging": false
        },
        "restricted_frequency": null,
        "weather_delay_thresholds": {
          "precip_prob": 30,
          "precip_in": 0.125,
          "wind_speed_mph": 20,
          "freeze_temp_f": 37
        },
        "updated_at": "2022-07-20T09:10:47.007Z",
        "reference": "446755231fa3-34906",
        "mac_address": "446755146355",
        "weather_station_id": "**REDACTED**",
        "mesh_id": "60e103564f0cc23b2fcc557f",
        "status": {
          "run_mode": "auto",
          "rain_sensors": [],
          "watering_status": null,
          "rain_delay": 0,
          "flow_sensor": null,
          "rain_delay_started_at": "2022-07-18T12:01:27.000Z"
        },
        "id": "60e142de4f0cc23b2fcc5f09",
        "num_stations": 1,
        "zones": [
          {
            "station": 1,
            "name": "Main House Roof",
            "num_sprinklers": 0,
            "catch_cup_volumes": [],
            "catch_cup_run_time": 0,
            "smart_watering_enabled": false
          }
        ],
        "user_id": "5f6f7cd74f0c30b3ab133bc8",
        "google_home_status": null,
        "device_gateway_topic": "devices-8",
        "hardware_version": "HT25-0000",
        "is_connected": true,
        "location": "**REDACTED**",
        "created_at": "2021-07-04T05:10:54.993Z",
        "suggested_start_time": null,
        "et_id": "5644ff05ad27a7777ff6a068"
      },
      {
        "last_connected_at": "2022-07-20T09:11:54.339Z",
        "address": "**REDACTED**",
        "water_sense_mode": "auto",
        "timezone": {
          "dst_offset": 3600,
          "raw_offset": -28800,
          "timezone_id": "America/Los_Angeles",
          "timezone_name": "Pacific Daylight Time"
        },
        "full_location": "**REDACTED**",
        "weather_forecast_location_id": "**REDACTED**",
        "firmware_version": "0041",
        "name": "Temple Garden",
        "type": "sprinkler_timer",
        "manual_preset_runtime_sec": 600,
        "battery": {
          "percent": 100,
          "charging": false
        },
        "restricted_frequency": null,
        "weather_delay_thresholds": {
          "precip_prob": 30,
          "precip_in": 0.125,
          "wind_speed_mph": 20,
          "freeze_temp_f": 37
        },
        "updated_at": "2022-07-20T09:11:54.339Z",
        "reference": "4467552298e4-64842",
        "mac_address": "44675514f4cf",
        "weather_station_id": "**REDACTED**",
        "mesh_id": "5f6f7d274f0c62a04bd1bc05",
        "status": {
          "run_mode": "auto",
          "next_start_programs": [
            "a"
          ],
          "rain_sensors": [],
          "watering_status": null,
          "rain_delay": 0,
          "flow_sensor": null,
          "next_start_time": "2022-07-03T22:00:00-07:00",
          "rain_delay_started_at": "2022-07-19T18:07:51.000Z"
        },
        "id": "60e9f46f4f0cc5e78a3da505",
        "num_stations": 1,
        "zones": [
          {
            "station": 1,
            "name": "Temple Garden",
            "num_sprinklers": 0,
            "catch_cup_volumes": [],
            "catch_cup_run_time": 0,
            "smart_watering_enabled": false,
            "flow_data": {}
          }
        ],
        "user_id": "5f6f7cd74f0c30b3ab133bc8",
        "google_home_status": null,
        "device_gateway_topic": "devices-2",
        "hardware_version": "HT25-0000",
        "is_connected": true,
        "location": "**REDACTED**",
        "created_at": "2021-07-10T19:26:39.146Z",
        "suggested_start_time": null,
        "et_id": "5644ff05ad27a7777ff6a068"
      },
      {
        "last_connected_at": "2022-07-20T09:10:47.011Z",
        "address": "**REDACTED**",
        "water_sense_mode": "auto",
        "timezone": {
          "dst_offset": 3600,
          "raw_offset": -28800,
          "timezone_id": "America/Los_Angeles",
          "timezone_name": "Pacific Daylight Time"
        },
        "full_location": "**REDACTED**",
        "weather_forecast_location_id": "**REDACTED**",
        "firmware_version": "0041",
        "name": "Temple Mister",
        "type": "sprinkler_timer",
        "manual_preset_runtime_sec": 600,
        "battery": {
          "percent": 100,
          "charging": false
        },
        "restricted_frequency": null,
        "weather_delay_thresholds": {
          "precip_prob": 30,
          "precip_in": 0.125,
          "wind_speed_mph": 20,
          "freeze_temp_f": 37
        },
        "updated_at": "2022-07-20T09:10:47.011Z",
        "reference": "446755231fa3-26019",
        "mac_address": "44675515344f",
        "weather_station_id": "**REDACTED**",
        "mesh_id": "60e103564f0cc23b2fcc557f",
        "status": {
          "run_mode": "auto",
          "next_start_programs": [
            "a"
          ],
          "rain_sensors": [],
          "watering_status": null,
          "rain_delay": 0,
          "flow_sensor": null,
          "next_start_time": "2022-07-20T06:00:00-07:00",
          "rain_delay_started_at": "2022-07-19T13:15:23.000Z"
        },
        "id": "60ea0f334f0cc5e78a3dacdb",
        "num_stations": 1,
        "zones": [
          {
            "station": 1,
            "name": "Temple Mister",
            "num_sprinklers": 0,
            "catch_cup_volumes": [],
            "catch_cup_run_time": 0,
            "smart_watering_enabled": false,
            "flow_data": {
              "cycle_run_time_sec": 17,
              "flow_rate_gpm": 5.742070588235295,
              "cycle_volume_gal": 1.6269200000000001
            }
          }
        ],
        "user_id": "5f6f7cd74f0c30b3ab133bc8",
        "google_home_status": null,
        "device_gateway_topic": "devices-8",
        "hardware_version": "HT25-0000",
        "is_connected": true,
        "location": "**REDACTED**",
        "created_at": "2021-07-10T21:20:51.479Z",
        "suggested_start_time": null,
        "et_id": "5644ff05ad27a7777ff6a068"
      },
      {
        "last_connected_at": "2022-07-20T09:10:47.015Z",
        "address": "**REDACTED**",
        "water_sense_mode": "auto",
        "timezone": {
          "dst_offset": 3600,
          "raw_offset": -28800,
          "timezone_id": "America/Los_Angeles",
          "timezone_name": "Pacific Daylight Time"
        },
        "full_location": "**REDACTED**",
        "weather_forecast_location_id": "**REDACTED**",
        "firmware_version": "32",
        "name": "Mister Deck",
        "type": "sprinkler_timer",
        "battery": {
          "percent": 100,
          "charging": false
        },
        "restricted_frequency": null,
        "updated_at": "2022-07-20T09:10:47.015Z",
        "reference": "446755231fa3-17452",
        "mac_address": "44675516705d",
        "weather_station_id": "**REDACTED**",
        "mesh_id": "60e103564f0cc23b2fcc557f",
        "status": {
          "run_mode": "auto",
          "rain_sensors": [],
          "watering_status": null,
          "rain_delay": 0,
          "flow_sensor": null,
          "rain_delay_started_at": "2022-07-19T21:23:58.000Z"
        },
        "id": "62bb90f44f0c6ea54277f107",
        "num_stations": 1,
        "zones": [
          {
            "station": 1,
            "name": "Mister Deck",
            "num_sprinklers": 0,
            "catch_cup_volumes": [],
            "catch_cup_run_time": 0,
            "smart_watering_enabled": false,
            "flow_data": {
              "cycle_run_time_sec": 0,
              "flow_rate_gpm": 0,
              "cycle_volume_gal": 0
            }
          }
        ],
        "user_id": "5f6f7cd74f0c30b3ab133bc8",
        "google_home_status": null,
        "device_gateway_topic": "devices-8",
        "smart_watering_enabled": true,
        "hardware_version": "HT25-0000",
        "is_connected": true,
        "location": "**REDACTED**",
        "created_at": "2022-06-28T23:38:28.659Z",
        "suggested_start_time": null,
        "et_id": "5644ff05ad27a7777ff6a068"
      },
      {
        "last_connected_at": "2022-07-20T09:10:47.018Z",
        "address": "**REDACTED**",
        "water_sense_mode": "auto",
        "timezone": {
          "dst_offset": 3600,
          "raw_offset": -28800,
          "timezone_id": "America/Los_Angeles",
          "timezone_name": "Pacific Daylight Time"
        },
        "full_location": "**REDACTED**",
        "weather_forecast_location_id": "**REDACTED**",
        "firmware_version": "41",
        "name": "House Garden",
        "type": "sprinkler_timer",
        "battery": {
          "percent": 94,
          "charging": false
        },
        "restricted_frequency": null,
        "updated_at": "2022-07-20T10:58:36.632Z",
        "reference": "446755231fa3-44211",
        "mac_address": "446755167e49",
        "weather_station_id": "**REDACTED**",
        "mesh_id": "60e103564f0cc23b2fcc557f",
        "status": {
          "run_mode": "auto",
          "rain_sensors": [],
          "watering_status": null,
          "rain_delay": 0,
          "flow_sensor": null,
          "rain_delay_started_at": "2022-07-20T05:41:11.000Z"
        },
        "id": "62bdceb24f0cf5332a21cef3",
        "num_stations": 1,
        "zones": [
          {
            "station": 1,
            "name": "Main House Garden",
            "num_sprinklers": 0,
            "catch_cup_volumes": [],
            "catch_cup_run_time": 0,
            "smart_watering_enabled": false,
            "flow_data": {
              "cycle_run_time_sec": 0,
              "flow_rate_gpm": 0,
              "cycle_volume_gal": 0
            }
          }
        ],
        "user_id": "5f6f7cd74f0c30b3ab133bc8",
        "google_home_status": null,
        "device_gateway_topic": "devices-8",
        "smart_watering_enabled": true,
        "hardware_version": "HT25-0000",
        "is_connected": true,
        "location": "**REDACTED**",
        "created_at": "2022-06-30T16:26:26.430Z",
        "suggested_start_time": null,
        "et_id": "5644ff05ad27a7777ff6a068"
      },
      {
        "last_connected_at": "2022-07-20T09:10:45.666Z",
        "address": "**REDACTED**",
        "timezone": {
          "dst_offset": 3600,
          "raw_offset": -28800,
          "timezone_id": "America/Los_Angeles",
          "timezone_name": "Pacific Daylight Time"
        },
        "full_location": "**REDACTED**",
        "firmware_version": "0030",
        "name": "Tiny Hub",
        "type": "bridge",
        "updated_at": "2022-07-20T09:10:45.666Z",
        "reference": "44675527b171",
        "mac_address": "44675527b171",
        "mesh_id": "62bf79654f0cf5332a222431",
        "status": {
          "next_start_programs": [],
          "next_start_time": "1970-01-01T00:00:00-07:00"
        },
        "wifi_version": 0,
        "id": "62bf79654f0cf5332a22242d",
        "num_stations": 0,
        "user_id": "5f6f7cd74f0c30b3ab133bc8",
        "device_gateway_topic": "devices-7",
        "hardware_version": "BH1-0001",
        "is_connected": true,
        "location": "**REDACTED**",
        "created_at": "2022-07-01T22:47:01.096Z"
      },
      {
        "last_connected_at": "2022-07-20T09:11:05.621Z",
        "address": "**REDACTED**",
        "timezone": {
          "dst_offset": 3600,
          "raw_offset": -28800,
          "timezone_id": "America/Los_Angeles",
          "timezone_name": "Pacific Daylight Time"
        },
        "full_location": "**REDACTED**",
        "firmware_version": "0030",
        "name": "Bluebird Hub",
        "type": "bridge",
        "updated_at": "2022-07-20T09:11:05.621Z",
        "reference": "446755279ad7",
        "mac_address": "446755279ad7",
        "mesh_id": "62bf7a464f0c527e4dbfb126",
        "status": {
          "next_start_programs": [],
          "next_start_time": "1970-01-01T00:00:00-07:00"
        },
        "wifi_version": 0,
        "id": "62bf79a34f0cf5332a22244e",
        "num_stations": 0,
        "user_id": "5f6f7cd74f0c30b3ab133bc8",
        "device_gateway_topic": "devices-6",
        "hardware_version": "BH1-0001",
        "is_connected": true,
        "location": "**REDACTED**",
        "created_at": "2022-07-01T22:48:03.356Z"
      },
      {
        "last_connected_at": "2022-07-20T09:11:05.623Z",
        "address": "**REDACTED**",
        "water_sense_mode": "auto",
        "timezone": {
          "dst_offset": 3600,
          "raw_offset": -28800,
          "timezone_id": "America/Los_Angeles",
          "timezone_name": "Pacific Daylight Time"
        },
        "full_location": "**REDACTED**",
        "weather_forecast_location_id": "**REDACTED**",
        "firmware_version": "0041",
        "name": "Bluebird",
        "type": "sprinkler_timer",
        "battery": {
          "percent": 100,
          "charging": false
        },
        "restricted_frequency": null,
        "updated_at": "2022-07-20T09:11:05.623Z",
        "reference": "446755279ad7-24141",
        "mac_address": "4467551839ac",
        "weather_station_id": "**REDACTED**",
        "mesh_id": "62bf7a464f0c527e4dbfb126",
        "status": {
          "run_mode": "auto",
          "rain_sensors": [],
          "watering_status": null,
          "rain_delay": 0,
          "flow_sensor": null,
          "rain_delay_started_at": "2022-07-15T20:15:30.000Z"
        },
        "id": "62bf7a964f0cf5332a222499",
        "num_stations": 1,
        "zones": [
          {
            "station": 1,
            "name": "Bluebird Zone",
            "num_sprinklers": 0,
            "catch_cup_volumes": [],
            "catch_cup_run_time": 0,
            "smart_watering_enabled": false
          }
        ],
        "user_id": "5f6f7cd74f0c30b3ab133bc8",
        "google_home_status": null,
        "device_gateway_topic": "devices-6",
        "smart_watering_enabled": true,
        "hardware_version": "HT25-0000",
        "is_connected": true,
        "location": "**REDACTED**",
        "created_at": "2022-07-01T22:52:06.808Z",
        "suggested_start_time": null,
        "et_id": "5644ff05ad27a7777ff6a068"
      },
      {
        "last_connected_at": "2022-07-20T09:10:45.668Z",
        "address": "**REDACTED**",
        "water_sense_mode": "auto",
        "timezone": {
          "dst_offset": 3600,
          "raw_offset": -28800,
          "timezone_id": "America/Los_Angeles",
          "timezone_name": "Pacific Daylight Time"
        },
        "full_location": "**REDACTED**",
        "weather_forecast_location_id": "**REDACTED**",
        "firmware_version": "0041",
        "name": "Tiny",
        "type": "sprinkler_timer",
        "battery": {
          "percent": 100,
          "charging": false
        },
        "restricted_frequency": null,
        "updated_at": "2022-07-20T09:10:45.668Z",
        "reference": "44675527b171-56405",
        "mac_address": "44675518064b",
        "weather_station_id": "**REDACTED**",
        "mesh_id": "62bf79654f0cf5332a222431",
        "status": {
          "run_mode": "auto",
          "rain_sensors": [],
          "watering_status": null,
          "rain_delay": 0,
          "flow_sensor": null,
          "rain_delay_started_at": "2022-07-10T18:13:43.000Z"
        },
        "id": "62bf7ae34f0c527e4dbfb163",
        "num_stations": 1,
        "zones": [
          {
            "station": 1,
            "name": "Tiny Zone",
            "num_sprinklers": 0,
            "catch_cup_volumes": [],
            "catch_cup_run_time": 0,
            "smart_watering_enabled": false
          }
        ],
        "user_id": "5f6f7cd74f0c30b3ab133bc8",
        "google_home_status": null,
        "device_gateway_topic": "devices-7",
        "smart_watering_enabled": true,
        "hardware_version": "HT25-0000",
        "is_connected": true,
        "location": "**REDACTED**",
        "created_at": "2022-07-01T22:53:23.846Z",
        "suggested_start_time": null,
        "et_id": "5644ff05ad27a7777ff6a068"
      },
      {
        "last_connected_at": "2022-07-20T09:11:54.342Z",
        "address": "**REDACTED**",
        "water_sense_mode": "auto",
        "timezone": {
          "dst_offset": 3600,
          "raw_offset": -28800,
          "timezone_id": "America/Los_Angeles",
          "timezone_name": "Pacific Daylight Time"
        },
        "full_location": "**REDACTED**",
        "weather_forecast_location_id": "**REDACTED**",
        "firmware_version": "0041",
        "name": "Shithouse",
        "type": "sprinkler_timer",
        "battery": {
          "percent": 97,
          "charging": false
        },
        "restricted_frequency": null,
        "updated_at": "2022-07-20T09:30:28.402Z",
        "reference": "4467552298e4-26818",
        "mac_address": "446755165171",
        "weather_station_id": "**REDACTED**",
        "mesh_id": "5f6f7d274f0c62a04bd1bc05",
        "status": {
          "run_mode": "auto",
          "rain_sensors": [],
          "watering_status": null,
          "rain_delay": 0,
          "flow_sensor": null,
          "rain_delay_started_at": "2022-07-08T21:08:34.000Z"
        },
        "id": "62c4e6394f0c527e4dc0992d",
        "num_stations": 1,
        "zones": [
          {
            "station": 1,
            "name": "Shithouse Zone",
            "num_sprinklers": 0,
            "catch_cup_volumes": [],
            "catch_cup_run_time": 0,
            "smart_watering_enabled": false,
            "flow_data": {
              "cycle_run_time_sec": 0,
              "flow_rate_gpm": 0,
              "cycle_volume_gal": 0
            }
          }
        ],
        "user_id": "5f6f7cd74f0c30b3ab133bc8",
        "google_home_status": null,
        "device_gateway_topic": "devices-2",
        "smart_watering_enabled": true,
        "hardware_version": "HT25-0000",
        "is_connected": true,
        "location": "**REDACTED**",
        "created_at": "2022-07-06T01:32:41.862Z",
        "suggested_start_time": null,
        "et_id": "5644ff05ad27a7777ff6a068"
      },
      {
        "last_connected_at": "2022-07-20T09:10:56.659Z",
        "address": "**REDACTED**",
        "timezone": {
          "dst_offset": 3600,
          "raw_offset": -28800,
          "timezone_id": "America/Los_Angeles",
          "timezone_name": "Pacific Daylight Time"
        },
        "full_location": "**REDACTED**",
        "firmware_version": "0030",
        "name": "Shop Hub",
        "type": "bridge",
        "updated_at": "2022-07-20T09:10:56.659Z",
        "reference": "446755284c72",
        "mac_address": "446755284c72",
        "mesh_id": "62c868734f0c6ea5427a0fd6",
        "status": {
          "next_start_programs": [],
          "next_start_time": "1970-01-01T00:00:00-07:00"
        },
        "wifi_version": 0,
        "id": "62c868734f0c6ea5427a0fd4",
        "num_stations": 0,
        "user_id": "5f6f7cd74f0c30b3ab133bc8",
        "device_gateway_topic": "devices-3",
        "hardware_version": "BH1-0001",
        "is_connected": true,
        "location": "**REDACTED**",
        "created_at": "2022-07-08T17:25:07.346Z"
      },
      {
        "last_connected_at": "2022-07-20T09:10:56.663Z",
        "address": "**REDACTED**",
        "water_sense_mode": "auto",
        "timezone": {
          "dst_offset": 3600,
          "raw_offset": -28800,
          "timezone_id": "America/Los_Angeles",
          "timezone_name": "Pacific Daylight Time"
        },
        "full_location": "**REDACTED**",
        "weather_forecast_location_id": "**REDACTED**",
        "firmware_version": "0041",
        "name": "Shop Sprinkler",
        "type": "sprinkler_timer",
        "battery": {
          "percent": 85,
          "charging": false,
          "low_battery_at": "2022-07-16T12:15:05.000Z"
        },
        "restricted_frequency": null,
        "updated_at": "2022-07-20T09:10:56.663Z",
        "reference": "446755284c72-5359",
        "mac_address": "44675518ddef",
        "weather_station_id": "**REDACTED**",
        "mesh_id": "62c868734f0c6ea5427a0fd6",
        "status": {
          "run_mode": "auto",
          "rain_sensors": [],
          "rain_delay": 0,
          "flow_sensor": null,
          "rain_delay_started_at": "2022-07-16T12:15:20.000Z"
        },
        "id": "62c868a44f0c527e4dc125be",
        "num_stations": 1,
        "zones": [
          {
            "station": 1,
            "name": "Shop Zone",
            "num_sprinklers": 0,
            "catch_cup_volumes": [],
            "catch_cup_run_time": 0,
            "smart_watering_enabled": false
          }
        ],
        "user_id": "5f6f7cd74f0c30b3ab133bc8",
        "google_home_status": null,
        "device_gateway_topic": "devices-3",
        "smart_watering_enabled": true,
        "hardware_version": "HT25-0000",
        "is_connected": true,
        "location": "**REDACTED**",
        "created_at": "2022-07-08T17:25:56.068Z",
        "suggested_start_time": null,
        "et_id": "5644ff05ad27a7777ff6a068"
      }
    ],
    "programs": [
      {
        "pending_timer_ack": true,
        "update_via": "wifi",
        "name": "Irrigation",
        "frequency": {
          "type": "days",
          "days": [
            0,
            1,
            2,
            3,
            4,
            5,
            6
          ],
          "interval": 1
        },
        "is_basic_program": false,
        "updated_at": "2022-07-04T03:37:17.144Z",
        "updated_via": "wifi",
        "start_times": [
          "22:00"
        ],
        "id": "60f05b084f0cc23b2fce85f1",
        "budget": 100,
        "device_id": "60e9f46f4f0cc5e78a3da505",
        "program": "a",
        "run_times": [
          {
            "run_time": 15,
            "station": 1
          }
        ],
        "enabled": false,
        "created_at": "2021-07-15T15:58:00.965Z"
      },
      {
        "pending_timer_ack": true,
        "update_via": "wifi",
        "name": "Water",
        "frequency": {
          "type": "days",
          "days": [
            0,
            1,
            2,
            3,
            4,
            5,
            6
          ],
          "interval": 1
        },
        "is_basic_program": false,
        "updated_at": "2022-07-08T21:11:36.772Z",
        "updated_via": "wifi",
        "start_times": [
          "06:00"
        ],
        "id": "60fd99f34f0cc23b2fd04221",
        "budget": 100,
        "device_id": "60ea0f334f0cc5e78a3dacdb",
        "program": "a",
        "run_times": [
          {
            "run_time": 15,
            "station": 1
          }
        ],
        "enabled": false,
        "created_at": "2021-07-25T17:05:55.436Z"
      },
      {
        "pending_timer_ack": true,
        "name": "House Garden Twice Daily",
        "frequency": {
          "type": "days",
          "days": [
            0,
            1,
            2,
            3,
            4,
            5,
            6
          ]
        },
        "updated_at": "2022-07-02T03:10:25.629Z",
        "updated_via": "wifi",
        "start_times": [
          "09:35",
          "20:30"
        ],
        "id": "62bdcfae4f0cf5332a21cf2b",
        "budget": 100,
        "device_id": "62bdceb24f0cf5332a21cef3",
        "program": "a",
        "run_times": [
          {
            "run_time": 15,
            "station": 1
          }
        ],
        "enabled": false,
        "created_at": "2022-06-30T16:30:38.420Z"
      }
    ]
  }
}

KidA001 avatar Jul 20 '22 15:07 KidA001

Thanks @KidA001. This all looks fine, so I will definitely need the event stream log to further diagnose the issue.

sebr avatar Jul 21 '22 22:07 sebr

@sebr I have the same problem and checked the logs already - I could observe that at some point the component receives a Client connection error

2022-08-25 01:09:44.139 ERROR (MainThread) [custom_components.bhyve.pybhyve.websocket] Client connection error; state: starting

after this connection retries seem to fail multiple times

2022-08-25 01:10:15.027 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.sprinkler_battery_level fails
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1154, in _create_direct_connection
    hosts = await asyncio.shield(host_resolved)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1154, in _create_direct_connection
    hosts = await asyncio.shield(host_resolved)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 867, in _resolve_host
    await event.wait()
  File "/usr/local/lib/python3.10/site-packages/aiohttp/locks.py", line 34, in wait
    raise self._exc
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 880, in _resolve_host
    addrs = await self._resolver.resolve(host, port, family=self._family)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/resolver.py", line 33, in resolve
    infos = await self._loop.getaddrinfo(
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 860, in getaddrinfo
    return await self.run_in_executor(
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.10/socket.py", line 955, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Try again

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 514, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 709, in async_device_update
    raise exc
  File "/config/custom_components/bhyve/sensor.py", line 137, in async_update
    await self._refetch_device()
  File "/config/custom_components/bhyve/__init__.py", line 275, in _refetch_device
    device = await self._bhyve.get_device(self._device_id, force_update)
  File "/config/custom_components/bhyve/pybhyve/client.py", line 204, in get_device
    await self._refresh_devices(force_update=force_update)
  File "/config/custom_components/bhyve/pybhyve/client.py", line 89, in _refresh_devices
    self._devices = await self._request(
  File "/config/custom_components/bhyve/pybhyve/client.py", line 73, in _request
    async with self._session.request(
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 1138, in __aenter__
    self._resp = await self._coro
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 535, in _request
    conn = await self._connector.connect(
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 542, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 907, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1166, in _create_direct_connection
    raise ClientConnectorError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host api.orbitbhyve.com:443 ssl:default [Try again]

at some point the retries stop and every command sent via the component produces

2022-08-25 04:00:00.004 WARNING (MainThread) [custom_components.bhyve.pybhyve.websocket] Tried to send message whilst websocket closed; state: starting

after restarting home assistant everything is fine again

I strongly believe this and #152 are connected.

Lokilicious avatar Aug 25 '22 05:08 Lokilicious

@sebr should be resolved by https://github.com/sebr/bhyve-home-assistant/pull/155

Lokilicious avatar Aug 30 '22 09:08 Lokilicious

@Lokilicious thanks so much! Good catch. Very hard to reproduce or test these connection errors.

sebr avatar Aug 30 '22 09:08 sebr

Thanks so much @Lokilicious - I have released v 3.0.1 which incorporates this fix. I'll close this issue but please reopen if it appears that the issue is still around.

sebr avatar Aug 30 '22 11:08 sebr