valiquette / homebridge-orbit-irrigation

Provides Homebridge support for Orbit B-Hyve devices
MIT License
9 stars 1 forks source link

Battery state issue #63

Closed Smaug-Beutelsend closed 1 year ago

Smaug-Beutelsend commented 1 year ago

Orbit recently changed their Hose Faucet Timer firmware. On HT25-0000 devices, starting with firmware version 0041, a bug was fixed that messed up the battery status display. Unfortunately it seems that this change was incompatible: The most recent iOS app version shows reasonable values (older ones didn‘t display any values anymore), but the log of the homebridge plugin now shows a 0% warning for all devices regardless of the actual battery state. This is not critical but annoying. And a bit odd: For a device with battery level 0% I wouldn’t expect a warning but a Connection Lost entry in the log. Can these 0% warnings be suppressed? Additional info: In Apple Home App, this battery warning doesn’t show up (Eve app does show a low battery icon though).

valiquette commented 1 year ago

I was aware of this with the HT3x, I thought this was already addressed in the current release 1.2.18. I will however take a closer look. The 0% was showing up on the newer timers, The API is no longer returning a % it is returning a millevolt value which need to be converted to a %. I should be looking for either. If the battery was really 0% and not just bug, You would get the disconnected warning.

valiquette commented 1 year ago

I just checked this out and on firmware 41 and plugin 1.2.18. This is is resolved. If you are still seeing this. I may need to send some log information. I do see the low battery warning in IOS too. I did update to the new home network. I have no way to go back.

Smaug-Beutelsend commented 1 year ago

Sure, understood. I attached two screenshots, one with the plug-in version, one screenshot of the log. All listed devices are HT25-0000s with the most recent firmware v41. IMG_0029 IMG_0030

valiquette commented 1 year ago

I have 2 HT-25 s and a HT-32 I check them both. When the plugin boots up it “gets” this info. These have all been upgraded, note they both are HT25 on firmware 41 get one still shows the older scheme no matter how many time it updates and it seems to know that is is not current but won’t update. After a connection reset, this one is now correct.

Updates come in 2 ways, once when first loaded and the other through web socket events. You can see these on your end if you enable homebridge debug logging and enable the first 2 debug logging options I the plugin. With these responses I am no longer seeing the issue you describe. I did see the same thing on the HT32 when it stopped sending the "percent". It may be possible that the HT25 has something different in the event you are seeing. If so that might explain this and it would be quick fix if you can provide me with your response.

"hardware_version": "HT25-0000”,

"firmware_version": "0041", "name": "Box Garden", "flume_device_id": "", "type": "sprinkler_timer", "manual_preset_runtime_sec": 600, "battery": { "percent": 90, "charging": false },

"hardware_version": "HT25-0000”,

"firmware_version": "0041",
"name": "Back Deck",
"flume_device_id": "",
"type": "sprinkler_timer",
"manual_preset_runtime_sec": 480,
"battery": {
    "percent": 86,
    "charging": false,
    "mv": 2876
},

"hardware_version": "HT32-0001”,

"firmware_version": "49",
"name": "Front Porch",
"flume_device_id": "",
"type": "sprinkler_timer",
"manual_preset_runtime_sec": 600,
"battery": {
    "mv": 3200
},

Incoming messages for battery status events.

[6/16/2023, 6:56:50 AM] [B-Hyve-Dev] incoming message { timestamp: '2023-06-16T12:49:51.000Z', event: 'battery_status', percent: 87, charging: false, 'stream-id': '8eb2f974-e34a-4b60-849d-242139960fbb', 'client-topics': [ 'device-clients-2', 'device-clients-3' ], 'gateway-topic': 'devices-3', device_id: '61354f6a4f0c6f063b7f2a92' } [6/16/2023, 6:56:50 AM] [B-Hyve-Dev] update battery status Box Garden to 87%, charging=false

[6/16/2023, 7:33:47 AM] [B-Hyve-Dev] incoming message { timestamp: '2023-06-16T13:18:12.000Z', event: 'battery_status', percent: 84, charging: false, 'stream-id': '8eb2f974-e34a-4b60-849d-242139960fbb', 'client-topics': [ 'device-clients-2', 'device-clients-3' ], 'gateway-topic': 'devices-3', device_id: '614fbb9e4f0cf51668ea838a' } [6/16/2023, 7:33:47 AM] [B-Hyve-Dev] update battery status Back Deck to 84%, charging=false

[6/16/2023, 6:33:14 AM] [B-Hyve-Dev] incoming message { timestamp: '2023-06-16T12:30:04.000Z', event: 'battery_status', mv: 3204, charging: false, 'stream-id': '8fa46e9a-eb0f-47df-8cdd-1d6f392ac570', 'client-topics': [ 'device-clients-2' ], 'gateway-topic': 'devices-8', device_id: '62030b544f0c6f063b8a0b4f' } [6/16/2023, 6:33:14 AM] [B-Hyve-Dev] update battery status Front Porch to 100%, charging=false

valiquette commented 1 year ago

Because there are 2 parts, initial and on going. Do you see a correct % right after boot and it goes to 0% after a while? If there is no "percent" or "mv" it will default to 0% Which I can address, but would prefer to fix the issue.

Thanks

valiquette commented 1 year ago

This would not be the first time I have seen differences in the API/websocket response based on geography.

Smaug-Beutelsend commented 1 year ago

Switched on debug info, restarted homebridge. Currently no battery status information, waiting for the WS messages coming in. I’ll keep you posted.Von meinem iPad gesendetAm 16.06.2023 um 16:15 schrieb valiquette @.***>: This would not be the first time I have seen differences in the API/websocket response based on geography.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

valiquette commented 1 year ago

I found the issue, and it is fixed in v1.2.19. I was not seeing it because I was working off a build with some changes that had removed some old code that broke with the firmware change. When I went back to the published build I saw what you posted. Please let me know

Smaug-Beutelsend commented 1 year ago

Before upgrade I did get some wrong battery status messages but failed to collect the information you requested: Despite setting the first two debug flags, which made the log a bit more chatty, I didn’t get the details you requested in the log. Do I look in the wrong place? Anyhow, I installed the newest version and restarted. It took some hours until the wrong messages started piling up, so I will check for a while and let you know asap.

Smaug-Beutelsend commented 1 year ago

Success! Wrong messages are gone now, so your fix did it: Thank you very much!