Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Support for CurrentZoneStateResponse with ESP-ME3 #395

Closed
dacarson opened this issue Nov 22, 2022 · 29 comments
Closed

Feature Request: Support for CurrentZoneStateResponse with ESP-ME3 #395

dacarson opened this issue Nov 22, 2022 · 29 comments
Assignees
Labels
enhancement New feature or request pinned

Comments

@dacarson
Copy link

Problem

Currently CurrentZoneStateResponse is not supported for ESP-ME3

Solution

Tracing Responses from during automatic and manual operation, I see response[2] contain the program number, 0..3 and 4 if manual. response[3] contain remaining the zones to run, including the current one.

Alternatives

No response

Additional context

I don't see zoneId nor timeRemaining being populated. Here is an PGM-A automatic irrigation run:

@dacarson dacarson added the enhancement New feature or request label Nov 22, 2022
@dacarson
Copy link
Author

[11/22/2022, 5:07:25 AM] [RainBird] [192.168.1.157] Response: [191,0,1,0,0,0] [CurrentZoneResponse]
[11/22/2022, 5:07:25 AM] [RainBird] [192.168.1.157] Response: [187,0,0,1,2,0,0] [CurrentZoneStateResponse]
[11/22/2022, 5:07:25 AM] [RainBird] Zone 1: Running
[11/22/2022, 5:12:25 AM] [RainBird] [192.168.1.157] Response: [191,0,1,0,0,0] [CurrentZoneResponse]
[11/22/2022, 5:12:25 AM] [RainBird] [192.168.1.157] Response: [187,0,0,1,2,0,0] [CurrentZoneStateResponse]
[11/22/2022, 5:17:25 AM] [RainBird] [192.168.1.157] Response: [191,0,2,0,0,0] [CurrentZoneResponse]
[11/22/2022, 5:17:25 AM] [RainBird] [192.168.1.157] Response: [187,0,0,1,1,0,0] [CurrentZoneStateResponse]
[11/22/2022, 5:17:25 AM] [RainBird] Zone 1: Complete
[11/22/2022, 5:17:25 AM] [RainBird] Zone 2: Running
[11/22/2022, 5:22:25 AM] [RainBird] [192.168.1.157] Response: [191,0,2,0,0,0] [CurrentZoneResponse]
[11/22/2022, 5:22:25 AM] [RainBird] [192.168.1.157] Response: [187,0,0,1,1,0,0] [CurrentZoneStateResponse]
[11/22/2022, 5:27:25 AM] [RainBird] [192.168.1.157] Response: [191,0,2,0,0,0] [CurrentZoneResponse]
[11/22/2022, 5:27:25 AM] [RainBird] [192.168.1.157] Response: [187,0,0,1,1,0,0] [CurrentZoneStateResponse]
[11/22/2022, 5:32:25 AM] [RainBird] [192.168.1.157] Response: [191,0,4,0,0,0] [CurrentZoneResponse]
[11/22/2022, 5:32:25 AM] [RainBird] [192.168.1.157] Response: [187,0,0,1,0,0,0] [CurrentZoneStateResponse]
[11/22/2022, 5:32:25 AM] [RainBird] Zone 2: Complete
[11/22/2022, 5:32:25 AM] [RainBird] Zone 3: Running
[11/22/2022, 5:37:25 AM] [RainBird] [192.168.1.157] Response: [191,0,4,0,0,0] [CurrentZoneResponse]
[11/22/2022, 5:37:25 AM] [RainBird] [192.168.1.157] Response: [187,0,0,1,0,0,0] [CurrentZoneStateResponse]
[11/22/2022, 5:42:25 AM] [RainBird] [192.168.1.157] Response: [191,0,0,0,0,0] [CurrentZoneResponse]
[11/22/2022, 5:42:25 AM] [RainBird] [192.168.1.157] Response: [187,0,0,0,0,0,0] [CurrentZoneStateResponse]
[11/22/2022, 5:42:25 AM] [RainBird] Zone 3: Complete
[11/22/2022, 5:47:25 AM] [RainBird] [192.168.1.157] Response: [191,0,0,0,0,0] [CurrentZoneResponse]
[11/22/2022, 5:47:25 AM] [RainBird] [192.168.1.157] Response: [187,0,0,0,0,0,0] [CurrentZoneStateResponse]

@dacarson
Copy link
Author

Correction:
response[2] == programNumber
response[3] == isRunning
response[4] == remainingZones

In the app if I do a Quick manual run of each active zone for 3 mins, this is what I see:
[11/22/2022, 8:58:22 AM] [RainBird] [192.168.1.157] Response: [191,0,1,0,0,0] [CurrentZoneResponse]
[11/22/2022, 8:58:22 AM] [RainBird] [192.168.1.157] Response: [187,0,4,1,2,0,0] [CurrentZoneStateResponse]
[11/22/2022, 8:58:22 AM] [RainBird] Zone 1: Running
[11/22/2022, 9:00:22 AM] [RainBird] [192.168.1.157] Response: [191,0,2,0,0,0] [CurrentZoneResponse]
[11/22/2022, 9:00:22 AM] [RainBird] [192.168.1.157] Response: [187,0,4,1,1,0,0] [CurrentZoneStateResponse]
[11/22/2022, 9:00:22 AM] [RainBird] Zone 1: Complete
[11/22/2022, 9:00:22 AM] [RainBird] Zone 2: Running
[11/22/2022, 9:02:22 AM] [RainBird] [192.168.1.157] Response: [191,0,2,0,0,0] [CurrentZoneResponse]
[11/22/2022, 9:02:22 AM] [RainBird] [192.168.1.157] Response: [187,0,4,1,1,0,0] [CurrentZoneStateResponse]
[11/22/2022, 9:04:22 AM] [RainBird] [192.168.1.157] Response: [191,0,4,0,0,0] [CurrentZoneResponse]
[11/22/2022, 9:04:22 AM] [RainBird] [192.168.1.157] Response: [187,0,4,1,0,0,0] [CurrentZoneStateResponse]
[11/22/2022, 9:04:22 AM] [RainBird] Zone 2: Complete
[11/22/2022, 9:04:22 AM] [RainBird] Zone 3: Running

@mantorok1
Copy link
Collaborator

Hi @dacarson, with that info you provided it should be possible to now show the state (on or off) of a program switch. Is this the enhancement you were thinking of?

@dacarson
Copy link
Author

Yes, that is what I was thinking. Showing that a program is running.
If I am able to work out how to get the remaining time, I'll add that information separately.

@mantorok1
Copy link
Collaborator

Hi @dacarson,
There's a new beta version (v1.8.2-beta.3) which will hopefully add the new features you requested. Please try it out and let me know how it goes.

@dacarson
Copy link
Author

dacarson commented Dec 2, 2022

I haven't tried it yet, but I just took a look at the changes. I am worried about the change in CurrentZoneStateResponse.ts, specifically this line:

  • case 6: // ESP-ME3 - page 1
    I am not sure that that will work. The switch is on 'response.length' and the length of page 1 is actually 50 not 6. Here is a response listed in Add support for time remaining for a zone on ESP-ME3 #396 :
    {"jsonrpc": "2.0", "result":{"length":50, "data":"BB0100016B000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"}, "id": 2}

@dacarson
Copy link
Author

dacarson commented Dec 2, 2022

I am also concerned about this change:

  case 7: // ESP-ME3 - page 0
     this._timeRemaining = response.readUInt16BE(8);

as timeRemaining is not returned in page 0.
On ME3, page 0 seems to only contains the Program Number, IsRunning and a count of the number of remaining zones in the queue.

@mantorok1
Copy link
Collaborator

Sorry I missed that the length of page 1 was 50. This is now fixed.
The time remaining wouldn't cause a problem as the page 1 figure is used first unless its undefined:

timeRemaining: currentZoneStatePage1?.timeRemaining ?? currentZoneState.timeRemaining,

I've fixed this also though.
There was another potential issue when the zones are manually run and the program number is set to 4. In this case I now force it to be 0.
I've pushed these changes so there should be another beta available for you

@dacarson
Copy link
Author

dacarson commented Dec 2, 2022

With this change:

There was another potential issue when the zones are manually run and the program number is set to 4. In this case I now force it to be 0.

Doesn't that make a manual run appear as PGM A? When I was testing out my own changes, it seemed fine if I left it as 4. It appeared as PGM E. I don't know about other RainBird devices, but on the ME3 you can only have 4 programs, PGM A, B, C & D. So it was safe to assume that PGM E is Manual.

(BTW, that is another feature I would like to propose. Presently it always shows my irrigation as Manual in the Eve app. I believe this is because the Program Mode ie, 'this.platform.Characteristic.ProgramMode' (set in src/devices/IrrigationSystem.ts) is never changed from NO_PROGRAM_SCHEDULED)

@mantorok1
Copy link
Collaborator

mantorok1 commented Dec 2, 2022

I didn't realise the ME3 has 4 programs, my TM2 only has 3. The plugin config only supports creating switches for Programs A to C so I can add program D for you if you like.

For my TM2 the program number values are:
0 = Program A
1 = Program B
2 = Program C
255 = No program.

So just to confirm for the ME3:
0 - 3 = Programs A - D
4 = No program (i.e. when system is not running or zone is manually started)

For the ProgramMode, how did you want that to work? The available values are here

@dacarson
Copy link
Author

dacarson commented Dec 5, 2022

For ProgramMode, I'll start a new feature request for that. I need to set Off/Program states on the physical unit and see what values it sends to get that correctly reported.

@dacarson
Copy link
Author

dacarson commented Dec 5, 2022

For Program Number, 0 - 3 are PGM A - D, and then if it returns a program number of 4, it means that the current zone was started manually.
IMG_1649

@mantorok1
Copy link
Collaborator

So what is the program number when the RainBird is idle, so no programs or zones running? Is it still 4?

@dacarson
Copy link
Author

dacarson commented Dec 7, 2022

When it is idle, CurrentZoneStateResponse returns BB 00 00 00 00
or
[187,0,0,0,0,0,0] [CurrentZoneStateResponse]
Ie,
Page 0
PGM A
Not Running
No queued zones

@mantorok1
Copy link
Collaborator

@dacarson, there's a new beta (v1.9.1-beta.0) that will hopefully fix the program running issue. It also adds support for a "Program D" switch. Check it out and let me know if you encounter any issues

@mantorok1
Copy link
Collaborator

Hi @dacarson, have you had a chance to test the beta yet?

@dacarson
Copy link
Author

I was away for xmas and new years. I am back now.
I installed the beta you mentioned above and I don't get any remaining time for each zone.
In the rainbird app, I did a 'Quick Run' that does a manual 2 minute run of each zone in order. I see each zone come on, but the remaining time is always zero. I will add some logging to the beta code to see if I can see what is going on.

@dacarson
Copy link
Author

User error - I had not restarted HomeBridge after updating the plugin.
Now that I restarted I can see remaining time. Though it doesn't seem to be reporting the right information. I see homebridge reporting errors in the logs:

[1/10/2023, 12:03:11 PM] [RainBird] [192.168.1.157] Request:  [62] [RainSensorStateRequest]
[1/10/2023, 12:03:11 PM] [RainBird] [192.168.1.157] Response: [190,0] [RainSensorStateResponse]
[1/10/2023, 12:03:11 PM] [RainBird] [192.168.1.157] Request:  [59,0] [CurrentZoneStateRequest]
[1/10/2023, 12:03:11 PM] [RainBird] [192.168.1.157] Response: [187,0,4,1,2,0,0] [CurrentZoneStateResponse]
[1/10/2023, 12:03:11 PM] [RainBird] [192.168.1.157] Request:  [59,1] [CurrentZoneStateRequest]
[1/10/2023, 12:03:11 PM] [RainBird] [192.168.1.157] Response: [187,1,0,1,106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] [CurrentZoneStateResponse]
[1/10/2023, 12:03:11 PM] [RainBird] Zone 1: Running
[1/10/2023, 12:03:11 PM] [homebridge-rainbird] This plugin generated a warning from the characteristic 'Remaining Duration': characteristic was supplied illegal value: number 27136 exceeded maximum of 3600. See https://homebridge.io/w/JtMGR for more info.
[1/10/2023, 12:03:11 PM] [homebridge-rainbird] This plugin generated a warning from the characteristic 'Remaining Duration': characteristic was supplied illegal value: number 27136 exceeded maximum of 3600. See https://homebridge.io/w/JtMGR for more info.
[1/10/2023, 12:03:13 PM] [homebridge-rainbird] This plugin generated a warning from the characteristic 'Remaining Duration': characteristic was supplied illegal value: number 27134 exceeded maximum of 3600. See https://homebridge.io/w/JtMGR for more info.
[1/10/2023, 12:03:13 PM] [homebridge-rainbird] This plugin generated a warning from the characteristic 'Remaining Duration': characteristic was supplied illegal value: number 27134 exceeded maximum of 3600. See https://homebridge.io/w/JtMGR for more info.
[1/10/2023, 12:03:14 PM] [RainBird] [192.168.1.157] Request:  [62] [RainSensorStateRequest]
[1/10/2023, 12:03:14 PM] [RainBird] [192.168.1.157] Response: [190,0] [RainSensorStateResponse]
[1/10/2023, 12:03:14 PM] [RainBird] [192.168.1.157] Request:  [59,0] [CurrentZoneStateRequest]
[1/10/2023, 12:03:14 PM] [RainBird] [192.168.1.157] Response: [187,0,4,1,2,0,0] [CurrentZoneStateResponse]
[1/10/2023, 12:03:14 PM] [RainBird] [192.168.1.157] Request:  [59,1] [CurrentZoneStateRequest]
[1/10/2023, 12:03:14 PM] [RainBird] [192.168.1.157] Response: [187,1,0,1,102,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] [CurrentZoneStateResponse]
[1/10/2023, 12:03:14 PM] [homebridge-rainbird] This plugin generated a warning from the characteristic 'Remaining Duration': characteristic was supplied illegal value: number 26112 exceeded maximum of 3600. See https://homebridge.io/w/JtMGR for more info.
[1/10/2023, 12:03:14 PM] [homebridge-rainbird] This plugin generated a warning from the characteristic 'Remaining Duration': characteristic was supplied illegal value: number 26112 exceeded maximum of 3600. See https://homebridge.io/w/JtMGR for more info.
[1/10/2023, 12:03:26 PM] [homebridge-rainbird] This plugin generated a warning from the characteristic 'Remaining Duration': characteristic was supplied illegal value: number 26100 exceeded maximum of 3600. See https://homebridge.io/w/JtMGR for more info.
[1/10/2023, 12:03:26 PM] [homebridge-rainbird] This plugin generated a warning from the characteristic 'Remaining Duration': characteristic was supplied illegal value: number 26100 exceeded maximum of 3600. See https://homebridge.io/w/JtMGR for more info.
[1/10/2023, 12:03:27 PM] [RainBird] [192.168.1.157] Request:  [62] [RainSensorStateRequest]
[1/10/2023, 12:03:27 PM] [RainBird] [192.168.1.157] Response: [190,0] [RainSensorStateResponse]
[1/10/2023, 12:03:27 PM] [RainBird] [192.168.1.157] Request:  [59,0] [CurrentZoneStateRequest]
[1/10/2023, 12:03:27 PM] [RainBird] [192.168.1.157] Response: [187,0,4,1,2,0,0] [CurrentZoneStateResponse]
[1/10/2023, 12:03:27 PM] [RainBird] [192.168.1.157] Request:  [59,1] [CurrentZoneStateRequest]
[1/10/2023, 12:03:27 PM] [RainBird] [192.168.1.157] Response: [187,1,0,1,89,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] [CurrentZoneStateResponse]
[1/10/2023, 12:03:27 PM] [homebridge-rainbird] This plugin generated a warning from the characteristic 'Remaining Duration': characteristic was supplied illegal value: number 22784 exceeded maximum of 3600. See https://homebridge.io/w/JtMGR for more info.
[1/10/2023, 12:03:27 PM] [homebridge-rainbird] This plugin generated a warning from the characteristic 'Remaining Duration': characteristic was supplied illegal value: number 22784 exceeded maximum of 3600. See https://homebridge.io/w/JtMGR for more info.
[1/10/2023, 12:03:42 PM] [RainBird] [192.168.1.157] Request:  [62] [RainSensorStateRequest]
[1/10/2023, 12:03:42 PM] [RainBird] [192.168.1.157] Response: [190,0] [RainSensorStateResponse]
[1/10/2023, 12:03:42 PM] [RainBird] [192.168.1.157] Request:  [59,0] [CurrentZoneStateRequest]
[1/10/2023, 12:03:42 PM] [RainBird] [192.168.1.157] Response: [187,0,4,1,2,0,0] [CurrentZoneStateResponse]
[1/10/2023, 12:03:42 PM] [RainBird] [192.168.1.157] Request:  [59,1] [CurrentZoneStateRequest]
[1/10/2023, 12:03:43 PM] [RainBird] [192.168.1.157] Response: [187,1,0,1,74,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] [CurrentZoneStateResponse]
[1/10/2023, 12:03:43 PM] [homebridge-rainbird] This plugin generated a warning from the characteristic 'Remaining Duration': characteristic was supplied illegal value: number 18944 exceeded maximum of 3600. See https://homebridge.io/w/JtMGR for more info.
[1/10/2023, 12:03:43 PM] [homebridge-rainbird] This plugin generated a warning from the characteristic 'Remaining Duration': characteristic was supplied illegal value: number 18944 exceeded maximum of 3600. See https://homebridge.io/w/JtMGR for more info.
[1/10/2023, 12:05:42 PM] [RainBird] [192.168.1.157] Request:  [62] [RainSensorStateRequest]
[1/10/2023, 12:05:42 PM] [RainBird] [192.168.1.157] Response: [190,0] [RainSensorStateResponse]
[1/10/2023, 12:05:42 PM] [RainBird] [192.168.1.157] Request:  [59,0] [CurrentZoneStateRequest]
[1/10/2023, 12:05:42 PM] [RainBird] [192.168.1.157] Response: [187,0,4,1,1,0,0] [CurrentZoneStateResponse]
[1/10/2023, 12:05:42 PM] [RainBird] [192.168.1.157] Request:  [59,1] [CurrentZoneStateRequest]
[1/10/2023, 12:05:42 PM] [RainBird] [192.168.1.157] Response: [187,1,0,2,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] [CurrentZoneStateResponse]
[1/10/2023, 12:05:42 PM] [RainBird] Zone 1: Complete
[1/10/2023, 12:05:42 PM] [RainBird] Zone 2: Running
[1/10/2023, 12:05:42 PM] [homebridge-rainbird] This plugin generated a warning from the characteristic 'Remaining Duration': characteristic was supplied illegal value: number 19456 exceeded maximum of 3600. See https://homebridge.io/w/JtMGR for more info.
[1/10/2023, 12:05:42 PM] [homebridge-rainbird] This plugin generated a warning from the characteristic 'Remaining Duration': characteristic was supplied illegal value: number 19456 exceeded maximum of 3600. See https://homebridge.io/w/JtMGR for more info.
[1/10/2023, 12:07:42 PM] [RainBird] [192.168.1.157] Request:  [62] [RainSensorStateRequest]
[1/10/2023, 12:07:42 PM] [RainBird] [192.168.1.157] Response: [190,0] [RainSensorStateResponse]
[1/10/2023, 12:07:42 PM] [RainBird] [192.168.1.157] Request:  [59,0] [CurrentZoneStateRequest]
[1/10/2023, 12:07:42 PM] [RainBird] [192.168.1.157] Response: [187,0,4,1,0,0,0] [CurrentZoneStateResponse]
[1/10/2023, 12:07:42 PM] [RainBird] [192.168.1.157] Request:  [59,1] [CurrentZoneStateRequest]
[1/10/2023, 12:07:42 PM] [RainBird] [192.168.1.157] Response: [187,1,0,3,78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] [CurrentZoneStateResponse]
[1/10/2023, 12:07:42 PM] [RainBird] Zone 2: Complete
[1/10/2023, 12:07:42 PM] [RainBird] Zone 3: Running
[1/10/2023, 12:07:43 PM] [homebridge-rainbird] This plugin generated a warning from the characteristic 'Remaining Duration': characteristic was supplied illegal value: number 19968 exceeded maximum of 3600. See https://homebridge.io/w/JtMGR for more info.
[1/10/2023, 12:07:43 PM] [homebridge-rainbird] This plugin generated a warning from the characteristic 'Remaining Duration': characteristic was supplied illegal value: number 19968 exceeded maximum of 3600. See https://homebridge.io/w/JtMGR for more info.
[1/10/2023, 12:08:41 PM] [homebridge-rainbird] This plugin generated a warning from the characteristic 'Remaining Duration': characteristic was supplied illegal value: number 19909 exceeded maximum of 3600. See https://homebridge.io/w/JtMGR for more info.
[1/10/2023, 12:08:41 PM] [homebridge-rainbird] This plugin generated a warning from the characteristic 'Remaining Duration': characteristic was supplied illegal value: number 19909 exceeded maximum of 3600. See https://homebridge.io/w/JtMGR for more info.
[1/10/2023, 12:08:42 PM] [RainBird] [192.168.1.157] Request:  [62] [RainSensorStateRequest]
[1/10/2023, 12:08:42 PM] [RainBird] [192.168.1.157] Response: [190,0] [RainSensorStateResponse]
[1/10/2023, 12:08:42 PM] [RainBird] [192.168.1.157] Request:  [59,0] [CurrentZoneStateRequest]
[1/10/2023, 12:08:42 PM] [RainBird] [192.168.1.157] Response: [187,0,4,1,0,0,0] [CurrentZoneStateResponse]
[1/10/2023, 12:08:42 PM] [RainBird] [192.168.1.157] Request:  [59,1] [CurrentZoneStateRequest]
[1/10/2023, 12:08:42 PM] [RainBird] [192.168.1.157] Response: [187,1,0,3,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] [CurrentZoneStateResponse]
[1/10/2023, 12:08:42 PM] [homebridge-rainbird] This plugin generated a warning from the characteristic 'Remaining Duration': characteristic was supplied illegal value: number 4608 exceeded maximum of 3600. See https://homebridge.io/w/JtMGR for more info.
[1/10/2023, 12:08:42 PM] [homebridge-rainbird] This plugin generated a warning from the characteristic 'Remaining Duration': characteristic was supplied illegal value: number 4608 exceeded maximum of 3600. See https://homebridge.io/w/JtMGR for more info.
[1/10/2023, 12:09:42 PM] [RainBird] [192.168.1.157] Request:  [62] [RainSensorStateRequest]
[1/10/2023, 12:09:42 PM] [RainBird] [192.168.1.157] Response: [190,0] [RainSensorStateResponse]
[1/10/2023, 12:09:42 PM] [RainBird] [192.168.1.157] Request:  [59,0] [CurrentZoneStateRequest]
[1/10/2023, 12:09:42 PM] [RainBird] [192.168.1.157] Response: [187,0,0,0,0,0,0] [CurrentZoneStateResponse]
[1/10/2023, 12:09:42 PM] [RainBird] [192.168.1.157] Request:  [59,1] [CurrentZoneStateRequest]
[1/10/2023, 12:09:42 PM] [RainBird] [192.168.1.157] Response: [187,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] [CurrentZoneStateResponse]
[1/10/2023, 12:09:42 PM] [RainBird] Zone 3: Complete`

@mantorok1
Copy link
Collaborator

Looks like the time remaining calc is wrong:

this._timeRemaining = response.readUInt16BE(4);

It's using the "big endian" format so for the zone 1 response [187,1,0,1,106,0,...] the time remaining is calculated as 106 x 256 + 0 (= 27136). I think this should be using "little endian" format which would calculate time remaining as 0 x 256 + 106 (= 106).
Does that sound correct to you? i.e. zone 1's time remaining would be 1 min 46 sec.

@dacarson
Copy link
Author

That seems right.
When I asked the controller to do a 15mins run, when the plugin read the values what I see logged is below (3*256+61 = 829 13mins 49secs):

[1/10/2023, 2:55:42 PM] [RainBird] [192.168.1.157] Request:  [59,1] [CurrentZoneStateRequest]
[1/10/2023, 2:55:42 PM] [RainBird] [192.168.1.157] Response: [187,1,0,1,61,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] [CurrentZoneStateResponse] 

@dacarson
Copy link
Author

It looks like what I quoted here: #396 (comment) is not correct.

@mantorok1
Copy link
Collaborator

I've changed the format to "little endian". Give beta.2 a go and see if it fixes the time remaining.

@dacarson
Copy link
Author

Installed beta.2 just now and that fixes it. Thank you.

@donavanbecker
Copy link
Contributor

Awesome! Thanks @mantorok1!

I will push out a new release soon then.

@allenporter
Copy link

Hello -- i've been looking at supporting more commands in pyrainbird and wanted to share something I found and share notes. I noticed there is a single CombinedControllerState call that can get a bunch of properties about the device including the currently active station and remaining runtime -- however, I only have a single device to test with, but curious if you'd also find this useful here and if its supported on multiple devices.

@mantorok1
Copy link
Collaborator

Hi @allenporter, yes we did use that request/response in early versions of the plugin but found that it wasn't supported in some RainBird models. It worked fine with my ESP-TM2 though. See issue #39 for more details

@dacarson
Copy link
Author

The ControllerStateRequest request/response unfortunately does not work with my RainBird, ESP-ME3. I get the NotAcknowledgedResponse response.

@allenporter
Copy link

Thanks, super helpful. (I have a ESP-TM2 as well, so that makes sense)

@dacarson
Copy link
Author

I believe this is fixed now

donavanbecker added a commit that referenced this issue Apr 8, 2023
## [Version 1.10.0](https://github.com/donavanbecker/homebridge-rainbird/releases/tag/v1.10.0) (2023-04-07)

### What's Changed
- Added Program state & Zone Time Remaining for ESP-ME3. [#395](#395) [#396](#396) [Thanks [dacarson](https://github.com/dacarson) for your help]
- Added option to sync the Rainbird controllers date & time with the Homebridge host.
- Housekeeping and updated dependencies.
  - This release will end support for Node v14.

**Full Changelog**: v1.9.0...v1.10.0
This was referenced Apr 8, 2023
donavanbecker added a commit that referenced this issue Apr 8, 2023
## [Version 1.10.0](https://github.com/donavanbecker/homebridge-rainbird/releases/tag/v1.10.0) (2023-04-07)

### What's Changed
- Added Program state & Zone Time Remaining for ESP-ME3. [#395](#395) [#396](#396) [Thanks [dacarson](https://github.com/dacarson) for your help]
- Added option to sync the Rainbird controllers date & time with the Homebridge host.
- Housekeeping and updated dependencies.
  - This release will end support for Node v14.

**Full Changelog**: v1.9.0...v1.10.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pinned
Projects
None yet
Development

No branches or pull requests

4 participants