Skip to content

Latest commit

 

History

History
395 lines (277 loc) · 6.97 KB

API.md

File metadata and controls

395 lines (277 loc) · 6.97 KB

spanet - API

A JSON API provided by the spanet server subcommand if you are using vscode and have Rest-Client installed you can use API.http to make requests

GET /spa/status

Returns the current state of the spa

GET /spa/lights/modes

Returns a list of supported modes

POST /spa/lights

Accepts a JSON object to define multiple light properties at the same time

{
 "Mode":        "Fade",
 "Brightness":  2,
 "EffectSpeed": 1,
 "Colour":      4
}

POST /spa/lights/mode

Accepts a JSON object that specifies the lighting mode

{"Mode": "Fade"}

POST /spa/lights/brightness

Accepts a JSON object that specifies the lighting brightness

{"Brightness": 1}

POST /spa/lights/effectspeed

Accepts a JSON object that specifies the speed of the lighting effect

{"EffectSpeed": 1}

POST /spa/lights/colour

Accepts a JSON object that specifies the colour of the lights

{"Colour": 1}

POST /spalights/off

Turns the lights off

POST /spa/lights/toggle

Toggles the current lighting state

GET /spa/pump/states

Returns a list of supported pump states

POST /spa/pump/$pumpNumber

Accepts a JSON object to specify the state of the given $pumpNumber

{"State": "On"}

GET /spa/blower/modes

Returns a list of supported blower modes

POST /spa/blower

Accepts a JSON object to specify the state of the blower

{
 "Mode": "Ramp",
 "Speed": 1
}

Speed is optional.

POST /spa/blower/speed

Accepts a JSON object to specify the speed of the blower

{
 "Speed": 1
}

POST /spa/temperature

Accepts a JSON object to specify the target temperature

{
 "Temperature": 38.9
}

GET /spa/operation/modes

Returns a list of supported operation modes

POST /spa/operation/mode

Accepts a JSON object to specify the speed of the blower

{
 "Mode": "NORM"
}

POST /spa/sanitise

Toggle sanatise function

POST /spa/sanitise/time

Accepts a JSON object to specify the time to auto sanitise

{
 "Time": "12:20"
}

POST /spa/filtration/runtime

Accepts a JSON object to specify the filtration runtime

{
 "Hours": 2
}

POST /spa/filtration/cycle

Accepts a JSON object to specify the filtration cycle

{
 "Hours": 2
}

POST /spa/timeout

Accepts a JSON object to specify the timeout (sleep)

{
 "Minutes": 30
}

GET /spa/heatpump/modes

Returns a list of supported heatpump modes

POST /spa/heatpump/mode

Accepts a JSON object to specify the heatpump mode

{
 "Mode": "Heat"
}

POST /spa/svelementboost

Accepts a JSON object to enable or disable sv element boost

{
 "Boost": false
}

GET /spa/lock/modes

Returns a list of supported lock modes

POST /spa/lock/mode

Accepts a JSON object to specify the lock mode

{
 "Mode": "Off"
}

Get /spa/powersave/modes

Returns a list of supported powersave modes

POST /spa/powersave/mode

Accepts a JSON object to specify the powersave mode

{
 "Mode": "Low"
}

POST /spa/peak/start

Accepts a JSON object to specify when peak power starts

{
 "Time": "11:10"
}

POST /spa/peak/end

Accepts a JSON object to specify when peak power ends

{
 "Time": "11:10"
}

Get /spa/sleeptimer/states

Returns a list of supported sleeptimer states

Post /spa/sleeptimer/$timerNumber/state

Accepts a JSON object to specify the sleep timer state for the given $timerNumber

{
  "State": "Everyday"
}

Post /spa/sleeptimer/$timerNumber/start

Accepts a JSON object to specify the sleep timer start for the given $timerNumber

{
  "Time": "11:10"
}

Post /spa/sleeptimer/$timerNumber/end

Accepts a JSON object to specify the sleep timer end for the given $timerNumber

{
  "Time": "11:10"
}

Post /spa/sleeptimer/$timerNumber

Shortcut to set all 3 parameters for a given sleep $timerNumber

{
  "State": "Everyday",
  "Start": "11:10",
  "End": "11:10"
}

Post /spa/datetime/year

Accepts a json object to specify the year

{
  "Year": 2021
}

Post /spa/datetime/month

Accepts a json object to specify the month

{
  "Month": 10
}

Post /spa/datetime/day

Accepts a json object to specify the day

{
  "Day": 3
}

Post /spa/datetime/hour

Accepts a json object to specify the hour

{
  "Hour": 21
}

Post /spa/datetime/minute

Accepts a json object to specify the minute

{
  "Minute": 12
}

Post /spa/datetime

If you think the previous 5 methods were a bit silly, well that's how the spa api expects them, you can call this method with a date/time and just get on with life

{
  "DateTime": "2006-01-02 15:04"
}