allenporter/pyrainbird

get_zone_states on LXIVM controller

funkzy opened this issue · 3 comments

Hi,

I have the LXIVM two wire controller and would like to write my own interface for controlling the device. I noticed that out of the box, some of the pyrainbird exposed API's work and some do not. (For reference, the LXIVM uses the LNK2 wifi module.)

For get_zone_states, stations 1-24 work:

(running zone 9)
$ python3 rainbird_tool.py get_zone_states
states: 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:1, 10:0, 11:0, 12:0, 13:0, 14:0, 15:0, 16:0, 17:0, 18:0, 19:0, 20:0, 21:0, 22:0, 23:0, 24:0

But running zone 27 is not displayed:

$ python3 rainbird_tool.py get_zone_states
states: 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:0, 10:0, 11:0, 12:0, 13:0, 14:0, 15:0, 16:0, 17:0, 18:0, 19:0, 20:0, 21:0, 22:0, 23:0, 24:0

Any suggestions on how to display > 24 stations?

Thanks!

Thanks for the report.

Since i don't have one of these devices, we'll want to capture some of the data here. Maybe running with --log-level=debug will give us enough detail to understand the change needed?

Otherwise you can see https://github.com/allenporter/pyrainbird/blob/main/CONTRIBUTING.md for how to start up a proxy to get request traces from the app. See discussion in #178

Awesome - and thanks for developing this awesome tool!

Debug log for no zones running:

$ python3 rainbird_tool.py --log-level=debug get_zone_states
DEBUG:pyrainbird.async_client:Request (CurrentStationsActiveRequest): 3F00
DEBUG:pyrainbird.async_client:Request: {"id": 1702318161.536479, "jsonrpc": "2.0", "method": "tunnelSip", "params": {"data": "3F00", "length": 2}}
DEBUG:pyrainbird.async_client:Response: {"id":1702318161.536479,"jsonrpc":"2.0","result":{"data":"BF0000000000","length":6}}
DEBUG:pyrainbird.async_client:Response from line: BF0000000000
DEBUG:pyrainbird.async_client:Response: {'type': 'CurrentStationsActiveResponse', 'pageNumber': 0, 'activeStations': 0}
states: 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:0, 10:0, 11:0, 12:0, 13:0, 14:0, 15:0, 16:0, 17:0, 18:0, 19:0, 20:0, 21:0, 22:0, 23:0, 24:0

Debug log w/ zone 9 running:

$ python3 rainbird_tool.py --log-level=debug get_zone_states
DEBUG:pyrainbird.async_client:Request (CurrentStationsActiveRequest): 3F00
DEBUG:pyrainbird.async_client:Request: {"id": 1702318650.676683, "jsonrpc": "2.0", "method": "tunnelSip", "params": {"data": "3F00", "length": 2}}
DEBUG:pyrainbird.async_client:Response: {"id":1702318650.676683,"jsonrpc":"2.0","result":{"data":"BF0000010000","length":6}}
DEBUG:pyrainbird.async_client:Response from line: BF0000010000
DEBUG:pyrainbird.async_client:Response: {'type': 'CurrentStationsActiveResponse', 'pageNumber': 0, 'activeStations': 65536}
states: 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:1, 10:0, 11:0, 12:0, 13:0, 14:0, 15:0, 16:0, 17:0, 18:0, 19:0, 20:0, 21:0, 22:0, 23:0, 24:0

Debug log w/ zone 25 running:

$ python3 rainbird_tool.py --log-level=debug get_zone_states
DEBUG:pyrainbird.async_client:Request (CurrentStationsActiveRequest): 3F00
DEBUG:pyrainbird.async_client:Request: {"id": 1702318480.244543, "jsonrpc": "2.0", "method": "tunnelSip", "params": {"data": "3F00", "length": 2}}
DEBUG:pyrainbird.async_client:Response: {"id":1702318480.244543,"jsonrpc":"2.0","result":{"data":"BF0000000001","length":6}}
DEBUG:pyrainbird.async_client:Response from line: BF0000000001
DEBUG:pyrainbird.async_client:Response: {'type': 'CurrentStationsActiveResponse', 'pageNumber': 0, 'activeStations': 1}
states: 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:0, 10:0, 11:0, 12:0, 13:0, 14:0, 15:0, 16:0, 17:0, 18:0, 19:0, 20:0, 21:0, 22:0, 23:0, 24:0

Debug log w/ zone 26 running:

$ python3 rainbird_tool.py --log-level=debug get_zone_states
DEBUG:pyrainbird.async_client:Request (CurrentStationsActiveRequest): 3F00
DEBUG:pyrainbird.async_client:Request: {"id": 1702318976.519146, "jsonrpc": "2.0", "method": "tunnelSip", "params": {"data": "3F00", "length": 2}}
DEBUG:pyrainbird.async_client:Response: {"id":1702318976.519146,"jsonrpc":"2.0","result":{"data":"BF0000000002","length":6}}
DEBUG:pyrainbird.async_client:Response from line: BF0000000002
DEBUG:pyrainbird.async_client:Response: {'type': 'CurrentStationsActiveResponse', 'pageNumber': 0, 'activeStations': 2}
states: 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:0, 10:0, 11:0, 12:0, 13:0, 14:0, 15:0, 16:0, 17:0, 18:0, 19:0, 20:0, 21:0, 22:0, 23:0, 24:0

Debug log w/ zone 27 running:

$ python3 rainbird_tool.py --log-level=debug get_zone_states
DEBUG:pyrainbird.async_client:Request (CurrentStationsActiveRequest): 3F00
DEBUG:pyrainbird.async_client:Request: {"id": 1702318194.8170502, "jsonrpc": "2.0", "method": "tunnelSip", "params": {"data": "3F00", "length": 2}}
DEBUG:pyrainbird.async_client:Response: {"id":1702318194.8170502,"jsonrpc":"2.0","result":{"data":"BF0000000004","length":6}}
DEBUG:pyrainbird.async_client:Response from line: BF0000000004
DEBUG:pyrainbird.async_client:Response: {'type': 'CurrentStationsActiveResponse', 'pageNumber': 0, 'activeStations': 4}
states: 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:0, 10:0, 11:0, 12:0, 13:0, 14:0, 15:0, 16:0, 17:0, 18:0, 19:0, 20:0, 21:0, 22:0, 23:0, 24:0

Debug log w/ zones 12, 13, 14, and 21 running in parallel:

The controller also allows zones to run in parallel, so here are four zones (12, 13, 14, and 21) running in parallel:

$ python3 rainbird_tool.py --log-level=debug get_zone_states
DEBUG:pyrainbird.async_client:Request (CurrentStationsActiveRequest): 3F00
DEBUG:pyrainbird.async_client:Request: {"id": 1702319091.173444, "jsonrpc": "2.0", "method": "tunnelSip", "params": {"data": "3F00", "length": 2}}
DEBUG:pyrainbird.async_client:Response: {"id":1702319091.173444,"jsonrpc":"2.0","result":{"data":"BF0000381000","length":6}}
DEBUG:pyrainbird.async_client:Response from line: BF0000381000
DEBUG:pyrainbird.async_client:Response: {'type': 'CurrentStationsActiveResponse', 'pageNumber': 0, 'activeStations': 3674112}
states: 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:0, 10:0, 11:0, 12:1, 13:1, 14:1, 15:0, 16:0, 17:0, 18:0, 19:0, 20:0, 21:1, 22:0, 23:0, 24:0