sebr / bhyve-home-assistant

Orbit BHyve custom component for Home Assistant
MIT License
251 stars 42 forks source link

Switch intermittently shows 'On" state on reboot/reload #224

Open dxmnkd316 opened 10 months ago

dxmnkd316 commented 10 months ago

Describe the bug When HA restarts and other seemingly random times, the switch shows an "On" state until, best I can tell, a connection is made back to Orbit servers. It doesn't seem to be consistent either. One of my HT-25 does this on restart, the other does not.
It does not seem to be actually turning on the physical switch.

Expected behaviour Upon restart (whether it's the integration or Home Assistant), consider showing states as "Unavailable" or "Unknown" until the server connection is made.

BHyve devices Two HT-25

Device Diagnostics Note: The Drip Irrigation (also labeled as back_yard) switch was the one that showed a false "On" from 13:03:XX to 13:06:XX.
The Front Yard switch correctly showed "Off" the entire time.

2023-10-13 13:02:48.924 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration bhyve which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-10-13 13:03:08.839 DEBUG (MainThread) [custom_components.bhyve.pybhyve.client] Logged in
2023-10-13 13:03:12.238 INFO (MainThread) [custom_components.bhyve.pybhyve.websocket] Authenticating websocket
2023-10-13 13:03:12.241 INFO (MainThread) [custom_components.bhyve.pybhyve.websocket] Websocket connected
2023-10-13 13:03:13.073 INFO (MainThread) [custom_components.bhyve.sensor] Creating state sensor: Drip Irrigation state
2023-10-13 13:03:13.073 DEBUG (MainThread) [custom_components.bhyve.sensor] State sensor Drip Irrigation state setup: State: manual | Available: True
2023-10-13 13:03:13.073 INFO (MainThread) [custom_components.bhyve.sensor] Creating history sensor: Drip Irrigation Zone zone history
2023-10-13 13:03:13.074 INFO (MainThread) [custom_components.bhyve.sensor] Creating battery sensor: Drip Irrigation battery level
2023-10-13 13:03:13.074 INFO (MainThread) [custom_components.bhyve.sensor] Creating state sensor: Front Yard state
2023-10-13 13:03:13.074 DEBUG (MainThread) [custom_components.bhyve.sensor] State sensor Front Yard state setup: State: auto | Available: True
2023-10-13 13:03:13.074 INFO (MainThread) [custom_components.bhyve.sensor] Creating history sensor: Zone 1 zone history
2023-10-13 13:03:13.074 INFO (MainThread) [custom_components.bhyve.sensor] Creating battery sensor: Front Yard battery level
2023-10-13 13:03:13.077 INFO (MainThread) [custom_components.bhyve.switch] Creating switch: Drip Irrigation rain delay
2023-10-13 13:03:13.078 INFO (MainThread) [custom_components.bhyve.switch] Creating switch: Drip Irrigation Zone zone
2023-10-13 13:03:13.078 INFO (MainThread) [custom_components.bhyve.switch] Drip Irrigation Zone zone watering_status: {'program': 'manual', 'current_station': 1, 'started_watering_station_at': '2023-09-23T19:06:38.582Z', 'stations': [{'run_time': 15, 'station': 1}], 'rain_sensor_hold': False, 'time_remaining_sec': 899, 'pump_status': None, 'total_run_time_sec': 900}
2023-10-13 13:03:13.078 INFO (MainThread) [custom_components.bhyve.switch] Drip Irrigation Zone Zone: Watering program Manual Drip Run (a) is not enabled, skipping
2023-10-13 13:03:13.078 INFO (MainThread) [custom_components.bhyve.switch] Drip Irrigation Zone Zone: Watering program Smart Watering (e) is not enabled, skipping
2023-10-13 13:03:13.078 INFO (MainThread) [custom_components.bhyve.switch] Creating switch: Front Yard rain delay
2023-10-13 13:03:13.078 INFO (MainThread) [custom_components.bhyve.switch] Creating switch: Zone 1 zone
2023-10-13 13:03:13.079 INFO (MainThread) [custom_components.bhyve.switch] Zone 1 zone watering_status: {'clear_on_idle': True}
2023-10-13 13:03:13.079 INFO (MainThread) [custom_components.bhyve.switch] Zone 1 Zone: Watering program Forced Water (a) is not enabled, skipping
2023-10-13 13:03:13.079 INFO (MainThread) [custom_components.bhyve.switch] Zone 1 Zone: Watering program Smart Watering (e) is not enabled, skipping
2023-10-13 13:03:13.079 INFO (MainThread) [custom_components.bhyve.switch] Zone 1 Zone: Watering program Forced Evening Water (b) is not enabled, skipping
2023-10-13 13:03:13.079 INFO (MainThread) [custom_components.bhyve.switch] Creating switch: Program Manual Drip Run
2023-10-13 13:03:13.079 INFO (MainThread) [custom_components.bhyve.switch] Creating switch: Program Smart Watering
2023-10-13 13:03:13.079 INFO (MainThread) [custom_components.bhyve.switch] Creating switch: Program Forced Water
2023-10-13 13:03:13.079 INFO (MainThread) [custom_components.bhyve.switch] Creating switch: Program Smart Watering
2023-10-13 13:03:13.079 INFO (MainThread) [custom_components.bhyve.switch] Creating switch: Program Forced Evening Water
2023-10-13 13:03:54.173 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.back_yard_zone_history is taking over 10 seconds
2023-10-13 13:03:54.173 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.front_yard_zone_history is taking over 10 seconds
2023-10-13 13:06:05.591 DEBUG (MainThread) [custom_components.bhyve.pybhyve.websocket] msg received WSMessage(type=<WSMsgType.TEXT: 1>, data='{"hw_version":"HT25-0000","fw_version":"0041","num_stations":1,"event":"device_connected","device_id":"redacted_device_id","timestamp":"2023-10-13T18:06:05.547Z"}', extra='')
2023-10-13 13:06:05.593 INFO (MainThread) [custom_components.bhyve] Device Drip Irrigation state reconnected and is now available
2023-10-13 13:06:05.593 INFO (MainThread) [custom_components.bhyve] Device Drip Irrigation Zone zone history reconnected and is now available
2023-10-13 13:06:05.593 INFO (MainThread) [custom_components.bhyve] Device Drip Irrigation battery level reconnected and is now available
2023-10-13 13:06:05.594 INFO (MainThread) [custom_components.bhyve] Device Drip Irrigation rain delay reconnected and is now available
2023-10-13 13:06:05.594 INFO (MainThread) [custom_components.bhyve] Device Drip Irrigation Zone zone reconnected and is now available
2023-10-13 13:06:23.149 DEBUG (MainThread) [custom_components.bhyve.pybhyve.websocket] msg received WSMessage(type=<WSMsgType.TEXT: 1>, data='{"event":"change_mode","mode":"auto","device_id":"redacted","timestamp":"2023-10-13T18:06:22.000Z"}', extra='')
2023-10-13 13:06:23.150 INFO (MainThread) [custom_components.bhyve] Message received: Drip Irrigation state - redacted_device_id - {'event': 'change_mode', 'mode': 'auto', 'device_id': 'redacted_device_id', 'timestamp': '2023-10-13T18:06:22.000Z'}
2023-10-13 13:06:23.150 INFO (MainThread) [custom_components.bhyve] Message received: Drip Irrigation battery level - redacted_device_id - {'event': 'change_mode', 'mode': 'auto', 'device_id': 'redacted_device_id', 'timestamp': '2023-10-13T18:06:22.000Z'}
2023-10-13 13:06:23.151 INFO (MainThread) [custom_components.bhyve] Message received: Drip Irrigation Zone zone - redacted_device_id - {'event': 'change_mode', 'mode': 'auto', 'device_id': 'redacted_device_id', 'timestamp': '2023-10-13T18:06:22.000Z'}
2023-10-13 13:06:23.171 DEBUG (MainThread) [custom_components.bhyve.pybhyve.websocket] msg received WSMessage(type=<WSMsgType.TEXT: 1>, data='{"event":"device_idle","timestamp":"2023-10-13T18:06:22.000Z","stream-id":"redacted_stream_id","client-topics":null,"device_id":"redacted_device_id"}', extra='')
2023-10-13 13:06:23.172 INFO (MainThread) [custom_components.bhyve] Message received: Drip Irrigation Zone zone history - redacted_device_id - {'event': 'device_idle', 'timestamp': '2023-10-13T18:06:22.000Z', 'stream-id': 'redacted_stream_id', 'client-topics': None, 'device_id': 'redacted_device_id'}
2023-10-13 13:06:23.172 INFO (MainThread) [custom_components.bhyve] Message received: Drip Irrigation Zone zone - redacted_device_id - {'event': 'device_idle', 'timestamp': '2023-10-13T18:06:22.000Z', 'stream-id': 'redacted_stream_id', 'client-topics': None, 'device_id': 'redacted_device_id'}
2023-10-13 13:06:23.173 INFO (MainThread) [custom_components.bhyve.pybhyve.client] Forcing refresh of device history redacted_device_id
2023-10-13 13:06:23.199 DEBUG (MainThread) [custom_components.bhyve.pybhyve.websocket] msg received WSMessage(type=<WSMsgType.TEXT: 1>, data='{"event":"rain_delay","delay":0,"rain_delay_weather_type":"rain","rain_delay_cause":"auto","device_id":"redacted_device_id","timestamp":"2023-10-13T18:06:22.000Z"}', extra='')
2023-10-13 13:06:23.201 INFO (MainThread) [custom_components.bhyve] Message received: Drip Irrigation rain delay - redacted_device_id - {'event': 'rain_delay', 'delay': 0, 'rain_delay_weather_type': 'rain', 'rain_delay_cause': 'auto', 'device_id': 'redacted_device_id', 'timestamp': '2023-10-13T18:06:22.000Z'}
2023-10-13 13:06:24.203 INFO (MainThread) [custom_components.bhyve.pybhyve.client] Forcing device refresh