-
Notifications
You must be signed in to change notification settings - Fork 31
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
CurrentRunTimeRequest missing in sipcommands #40
Labels
Comments
Instead of using |
allenporter
added a commit
that referenced
this issue
Jan 22, 2023
Add support for encoding/decoding irrigation queue messages Issue #40 Using test case examples from homebridge-plugins/homebridge-rainbird#396
allenporter
added a commit
that referenced
this issue
Jan 22, 2023
Add queue encoding and decoding for active programs for TM2, tested with examples. Issue #40
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To get the remaining seconds in an active zone the "CurrentRunTimeRequest" function is pretty useful.
Here is how I added it to the code:
(sipcommands) ControllerCommands:
CurrentRunTimeRequest:
command: 3B
parameter: 0
response: BB
length: 2
'BB':
length: 12
type: CurrentRunTimeResponse
activeStation:
position: 7
length: 1
secondsRemaining1:
position: 8
length: 2
secondsRemaining2:
position: 10
length: 2
The response looks like this:
DEBUG:pyrainbird:Response: {"jsonrpc": "2.0", "result":{"length":50, "data":"BB0100012C010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"}, "id": 10377}
DEBUG:pyrainbird:Response: {'secondsRemaining2': '01', 'secondsRemaining1': '2C', 'type': 'CurrentRunTimeResponse', 'activeStation': '1'}
To get the time in seconds the response is a little confusing!!
--> the response is: 2C01
--> you have to take byte 3&4: 01
--> take than byte 1&2: 2C and put it back together in the opposite order: 012C
--> convert from HEX to Decimal: 012C = 300 seconds
May be someone can add this to the code and make a function out of this??
The text was updated successfully, but these errors were encountered: