POST
https://api.spanet.net.au/api/MemberLogin
Request:
{
"login": [Username],
"api_key": "4a483b9a-8f02-4e46-8bfa-0cf5732dbbd5",
"password": [Password]
}
Response:
{
"data": {
"email": null,
"id_member": [MemberId],
"login": [Username],
"name": null,
"password": null,
"notification_enabled": 1,
"id_session": [SessionId]
},
"error": null,
"error_code": null,
"message": null,
"success": true
}
GET
https://api.spanet.net.au/api/membersockets?id_member=[MemberId]&id_session=[SessionId]
Response:
{
"data": {
"email": null,
"id_member": 0,
"login": null,
"name": null,
"password": null,
"notification_enabled": 0,
"id_session": null
},
"sockets": [{
"id": [SocketId],
"active": "1",
"id_member": [MemberId],
"id_sockets": [SocketId],
"mac_addr": [MacAddress],
"moburl": [WebSocketUrl]:9090,
"name": [SpaName],
"spaurl": [WebSocketUrl]:9090,
"signalStrength": -69,
"error": false
}],
"error": null,
"error_code": null,
"message": "",
"success": true
}
Open TCP Socket to [WebUrl]
port 9090
, then send..
Request:
<connect--[SocketId]--[MemberId]>
Response:
Successfully connected
Get the current status of the spa.
Request:
RF\n
Sample Response:
RF:
,R2,18,250,51,70,4,13,50,55,19,6,2020,376,9999,1,0,490,207,34,6000,602,23,20,0,0,0,0,44,35,45,:
,R3,32,1,4,4,4,SW V5 17 05 31,SV3,18480001,20000826,1,0,0,0,0,0,NA,7,0,470,Filtering,4,0,7,7,0,0,:
,R4,NORM,0,0,0,1,0,3547,4,20,4500,7413,567,1686,0,8388608,0,0,5,0,98,0,10084,4,80,100,0,0,4,:
,R5,0,1,0,1,0,0,0,0,0,0,1,0,1,0,376,0,3,4,0,0,0,0,0,1,2,6,:
,R6,1,5,0,2,5,8,1,360,1,0,3584,5120,127,128,5632,5632,2304,1792,0,30,0,0,0,0,2,3,0,:
,R7,2304,0,1,1,1,0,1,0,0,0,253,191,253,240,483,125,77,1,0,0,0,23,200,1,0,1,31,32,35,100,5,:
,R9,F1,255,0,0,0,0,0,0,0,0,0,0,:
,RA,F2,0,0,0,0,0,0,255,0,0,0,0,:
,RB,F3,0,0,0,0,0,0,0,0,0,0,0,:
,RC,0,1,1,0,0,0,0,0,0,2,0,0,1,0,:
,RE,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,-4,13,30,8,5,1,0,0,0,0,0,:*
,RG,1,1,1,1,1,1,1-1-014,1-1-01,1-1-01,0-,0-,0,:*
Set the target temperature for the spa.
Request:
W40:nnn
Response:
nnn
where nnn
denotes temperature in celsius * 10 between 5.0
-41.0
c (ie: for 35.6c, nnn
= 356)
Start (or cancel) a Clean cycle.
Request:
W12
Response:
W12
Control Pump 1.
Request:
S22:n
Response:
S22-OK
where n
denotes
0
- Off1
- On4
- Auto
Control Pump 2.
Request:
S23:n
Response:
S23-OK
where n
denotes
0
- Off1
- On
Control Pump 3.
Request:
S24:n
Response:
S24-OK
where n
denotes
0
- Off1
- On
Control the Blower.
Request:
S28:n
Response:
S28-OK
where n
denotes
0
- Variable1
- Ramp2
- Off
Set the variable speed of the blower.
Request:
S13:n
Response:
n S13
where n
denotes speed 1
-5
TODO
Set the Operation mode.
Request:
W66:n
Response:
n
where n
denotes
0
- Norm1
- Econ2
- Away3
- Week
Set the filtration runtime.
Request:
W60:n
Response:
n
where n
denotes hours between 1
-24
.
Set the time between filtration cycles.
Request:
W90:n
Response:
n
where n
denotes hours as
1
- 1 hr2
- 2 hr3
- 3 hr4
- 4 hr6
- 6 hr8
- 8 hr12
- 12 hr24
- 24 hr
TODO
Set the Power Save option.
Request:
W63:n
Response:
n
where n
denotes
0
- Off1
- Low2
- High
TODO
TODO
TODO
TODO
TODO
Set the Lock Mode.
Request:
S21:n
Response:
n
where n
denotes
0
- Off1
- Partial2
- Full
TODO
@wayne-love
Love your work, thanks for putting in the time to add to this.
I've been using your code sn2ha and it works great, have changed the connection to talk to the Spanet API so I can continue to use the app.
I've ran into an error that keeps coming up after a random amount of time, wondering if you have seen it before?
"
,R2,256,133,45,341,4,20,54,53,26,1,2022,371,9999,1,0,126,416,0,0,118443,2278,2664,0,0,46592,0,12909,74,6685,241,:
,R3,32,1,4,4,4,SW V6 19 11 12,SV3,19503329,20000357,1,0,0,0,0,0,NA,7,0,437,W.CLN,33,0,10,10,0,0,-1,:
,R4,NORM,0,0,0,4,0,946,4,4,34048,403300,834,645,0,0,0,262144,6,5,99,0,0,5,80,50,0,0,5,:
,R5,0,0,0,6,0,0,0,0,0,0,0,1,0,0,366,1,1507,1,1,0,0,0,0,1,2,6,:
,R6,1,5,30,2,5,5,2,380,1,0,3584,5120,127,128,5888,5785,2304,1792,0,30,0,0,1,0,2,3,0,410,:
,R7,2590,0,1,4,1,0,1,24,12,2020,245,126,140,130,485,207,211,1,0,0,0,23,200,1,1,1,31,50,50,100,5,:
,R9,F1,255,2592,3,0,242,9999,190,17,0,255,50044,:
,RA,F2,188,562,3,13,239,9999,61439,19,0,255,300,:
,RB,F3,76782,32,3,65045,140,9999,187,21,0,255,382,:
,RC,0,1,0,1,0,0,0,0,0,2,0,0,0,0,:
,RE,1,10,4,2,1,1,200,200,200,23,18,1,1,0,0,3,1,0,315,0,0,240,0,0,-4,13,30,8,5,-21,:*
,RG,1,1,1,1,1,1,1-1-014,1-1-01,1-1-01,0-,0-,0,0,0,2353,:*
2022-02-25 20:57:36,459 - root - INFO - Successful read
2022-02-25 20:58:41,661 - root - DEBUG - Processsing 0 commands
2022-02-25 20:58:41,662 - root - DEBUG - Requesting status
2022-02-25 20:58:41,662 - connection - DEBUG - Sending RF
2022-02-25 20:58:42,163 - connection - DEBUG - Response - show rssi
set comm idle 300 set wlan linkmon 30
exit
2022-02-25 20:58:42,164 - root - DEBUG - Response - show rssi
set comm idle 300 set wlan linkmon 30
exit
Traceback (most recent call last):
File "sn2ha.py", line 380, in
if spa.sync_status():
File "sn2ha.py", line 146, in sync_status
self.set_temp = int(response[128])/10
IndexError: list index out of range
"
edit
Ok I think I see what's going on, API is injecting these commands, the the bridge doesn't recognise the output and it rejecting it.
Any quick tips how I can add to the code to ignore these input\outputs?