valiquette / homebridge-orbit-irrigation

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

Sprinkler status in multizone setup #77

Open GromkiWir opened 9 months ago

GromkiWir commented 9 months ago

I have integrated this plugin with my Orbit B-Hyve internal WIFI controller. It works great in both ways - starting waterring, stopping it from Iphone Home or native B-Have app is fast and acurate but I have noticed 2 of problems how a sprinkler status is presented in Home app.

  1. Plugin doesn’t block possibility to start more then one zone at a time. You can klick Zone A, then Zone B and it looks like both are working but it’s not true because controller stopping Zone A and starting Zine B (only one Zone can work at a time). You can stop Zone B manually but Zone A - no, it will try to stop endless because from a controller perspective it was already stopped. You need to start Zone A again and stop it or restart plugin.

  2. Worse problem is when you start a program witch is a sequence of Zones starting one by one for a given time. It works but you never know what Zone is actually working. Form a GUI perspective the first one starts for a second and stops and other are waiting but in fact it works as it should. After that, when according to a program, the second starts, it looks like it just has stopped Only the last couple is presented properly.

End the status for a program itself is not updated after finishing the last Zone in a program.

valiquette commented 9 months ago

See if the new version corrects any of this. I had been working on this one for a while, It may correct some or all of this. Let me know

GromkiWir commented 9 months ago

Thanks for update.

First issue seems to work. Sometimes, randomly, when I change a program, both are finishing - maybe it's a race of messages which in some cases it comes to a controller in wrong order. But mostly it works as expected. Some warnings are thrown in logs

Error: at SetDuration.Characteristic.characteristicWarning (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:3011:105) at SetDuration.Characteristic.validateUserInput (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2862:14) at SetDuration.Characteristic.updateValue (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2328:20) at OrbitPlatform.updateService (/var/lib/homebridge/node_modules/homebridge-orbit-irrigation/orbitupdate.js:255:70) at /var/lib/homebridge/node_modules/homebridge-orbit-irrigation/orbitapi.js:363:6 at ReconnectingWebSocket._callEventListener (/var/lib/homebridge/node_modules/homebridge-orbit-irrigation/node_modules/reconnecting-websocket/dist/reconnecting-websocket-cjs.js:557:13) at /var/lib/homebridge/node_modules/homebridge-orbit-irrigation/node_modules/reconnecting-websocket/dist/reconnecting-websocket-cjs.js:176:81 at Array.forEach () at WebSocket.ReconnectingWebSocket._handleMessage (/var/lib/homebridge/node_modules/homebridge-orbit-irrigation/node_modules/reconnecting-websocket/dist/reconnecting-websocket-cjs.js:176:38) at callListener (/var/lib/homebridge/node_modules/homebridge-orbit-irrigation/node_modules/ws/lib/event-target.js:290:14)

GromkiWir commented 9 months ago

As of a program status - nothing has changed. It still marks a zone as stopped when it starts. From GUI perspective of course, in background a program works properly.

valiquette commented 9 months ago

For issue 1, what Orbit hardware are you using do you have more than one, curious if it is one I have tested against? Also what firmware version is it running? The error seems like it is tied to the websocket message not having a correct value or missing the field "total_run_time_sec". It might be the the firmware on the device is old or even newer then what is expected. Debug logs with all the plugin options on should show something like this.

  "firmware_version": "49",
  "name": "Front Porch",
  "type": "sprinkler_timer",
  "mac_address": "446755900742",
  "mesh_id": null,
  "id": "62030b544f0c6f063b8a0b4f",
  "hardware_version": "HT32-0001",
  "is_connected": true

then you start a zone you should see som incoming messages [9/25/2023, 6:01:47 AM] [B-Hyve-Dev] Back Deck program manual for zone-1 Flowers running [9/25/2023, 6:01:53 AM] [B-Hyve-Dev] incoming message { event: 'change_mode', mode: 'manual', program: null, stations: [ { station: 1, run_time: 3 } ], device_id: '614fbb9e4f0cf51668ea838a', timestamp: '2023-09-25T12:01:52.000Z' } [9/25/2023, 6:01:53 AM] [B-Hyve-Dev] Back Deck mode changed to manual [9/25/2023, 6:01:53 AM] [B-Hyve-Dev] incoming message { current_station: 1, water_event_queue: [], event: 'watering_in_progress_notification', status: 'watering_in_progress', rain_sensor_hold: false, device_id: '614fbb9e4f0cf51668ea838a', timestamp: '2023-09-25T12:01:52.000Z', program: 'manual', started_watering_station_at: '2023-09-25T12:01:51.000Z', run_time: 2.98, total_run_time_sec: 180 } If you do not see something like these please let me know.

valiquette commented 9 months ago

Issue 2 sounds like it maybe working as designed. Homebridge display in not great maybe a homebridge bug, it will show the active zone counting down the others will show as running or complete. In Homekit this displays correctly it will show as stopped, running or waiting depending on where they are in the schedule. If you are using Eve I have not looked at how that app displays.

GromkiWir commented 9 months ago

It may be the reason. I am using this one https://www.easternirrigation.com/products/8-station-orbit-b-hyve-smart-wi-fi-indoor-timer It has few years and maybe Orbit does not support it yet. Firmware version is much lower :(

Logs show this

  },
  "firmware_version": "0022",
  "name": "B-hyve Milanówek",
  "type": "sprinkler_timer",
  "mac_address": "446755421047",
  "mesh_id": "5f01fc214f0c1a1979b925dd",
  "id": "5f01fc1f4f0c226b41a9319d",
  "hardware_version": "WT24I-0001",
  "is_connected": true
}

After starting a zone I receive this

[25.09.2023, 15:14:14] [B-Hyve] incoming message { event: 'change_mode', mode: 'manual', program: null, stations: [ { station: 1, run_time: 30 } ], device_id: '5f01fc1f4f0c226b41a9319d', timestamp: '2023-09-25T13:14:14.000Z' } [25.09.2023, 15:14:14] [B-Hyve] B-hyve Milanówek mode changed to manual [25.09.2023, 15:14:14] [B-Hyve] incoming message { current_station: 1, water_event_queue: [], event: 'watering_in_progress_notification', status: 'watering_in_progress', rain_sensor_hold: false, device_id: '5f01fc1f4f0c226b41a9319d', timestamp: '2023-09-25T13:14:14.000Z', program: 'manual', started_watering_station_at: '2023-09-25T13:14:14.000Z', run_time: 30, total_run_time_sec: null } [25.09.2023, 15:14:14] [homebridge-orbit-irrigation] This plugin generated a warning from the characteristic 'Set Duration': characteristic was supplied illegal value: null! Home App will reject null for Apple defined characteristics. See https://homebridge.io/w/JtMGR for more info. [25.09.2023, 15:14:14] [homebridge-orbit-irrigation] Error: at SetDuration.Characteristic.characteristicWarning (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:3011:105) at SetDuration.Characteristic.validateUserInput (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2862:14) at SetDuration.Characteristic.updateValue (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2328:20) at OrbitPlatform.updateService (/var/lib/homebridge/node_modules/homebridge-orbit-irrigation/orbitupdate.js:255:70) at /var/lib/homebridge/node_modules/homebridge-orbit-irrigation/orbitapi.js:363:6 at ReconnectingWebSocket._callEventListener (/var/lib/homebridge/node_modules/homebridge-orbit-irrigation/node_modules/reconnecting-websocket/dist/reconnecting-websocket-cjs.js:557:13) at /var/lib/homebridge/node_modules/homebridge-orbit-irrigation/node_modules/reconnecting-websocket/dist/reconnecting-websocket-cjs.js:176:81 at Array.forEach () at WebSocket.ReconnectingWebSocket._handleMessage (/var/lib/homebridge/node_modules/homebridge-orbit-irrigation/node_modules/reconnecting-websocket/dist/reconnecting-websocket-cjs.js:176:38) at callListener (/var/lib/homebridge/node_modules/homebridge-orbit-irrigation/node_modules/ws/lib/event-target.js:290:14)

valiquette commented 9 months ago

Can you check and see if there is an update for your device and if that make a difference? if seems like the current version of firmware should be either 33 or 87. https://community.orbitonline.com/b-hyve-current-firmware/

update instruction if you need them https://community.orbitonline.com/how-do-i-update-my-firmware/

All that said I can add address this on my end to support this use case. Getting this corrected may make a difference on you issue 2.

GromkiWir commented 9 months ago

I have to talk with Orbit, because it looks like they have changed the code name of this product. So my gear is identified as WT24I-0001 but they publish updates for WT24-00001 then update process doesn't see any new version for my timer. I don't see any information about new generation so it's possible their support issue.

valiquette commented 9 months ago

V1.2.26 should get rid of those errors. If that field is null I am just using the runtime requested in minutes x 60 so it might be off a few seconds, but better then the error.

GromkiWir commented 9 months ago

Good news! I have asked Orbit support to update my timer remotely, they did it and now I have 0051 version on firmware. Both issues work as expected. If you want me to test it more thoroughly and put some feedback, I am willing to do it, but at a first glance - problems solved!!!

valiquette commented 9 months ago

glad it worked out, and it is patched too if anyone else is behind.