Arctic SPA No Cloud API - SPA Boii

Starting this as a progress holder for my effort to make a local API for Arctic SPA

Spinoff of my thread hijack here: [Jacuzzi - Arctic Spas API - #68 by Patrick-Ohlson](Configure Actic SPA)

Follow this github for code releases: SpaBoii - Github


3 Likes

This is awesome.
Following

Can you add some info on how to add to HA from the GitHub repo??
When i try to add custom repo in HACS it tells me “Repository structure for main is not compliant”

1 Like

Hi

The current codebase is just a start and proof of concept

I havent had much time last couple of days

Will update here when I have more news

1 Like

Some Sunday work

Will most likely use mqtt instead of REST


1 Like

Ok,

So controlling SetPoint now works and showing multiple entity values with some HACS js magic

Next step is letting it run and catch any bugs in the flow, will look into th possibilty of refactor into a proper HACS module

Thank you for doing this! Getting rid of the Arctic Spa cloud would be very nice.

1 Like

Ironing out time connection drops and thermostat template


2 Likes

I’m mulling buying an Arctic Spa. I’m a software dev, with lots of experience in python. So, I could contribute if others are also building this out.

But, I’m slightly worried about bricking something in my hot-tub. Is that a realistic scenario, or is there a factory reset that could get out of any trouble?

1 Like

Published my current running solution to github

It is not hacs ready, but has been running standalone via pm2 since November

It contains the Flask base, but uses HA MQTT now

Feel free to test and report

I have not added the yaml for automations and thermostat

There is enough info if someone want to fork and make hacs friendly

I might go there at some point, but there are other projects that need my time​:wink::tada:

2 Likes

Craig added some excellent updates :fire:

Tried this out tonight because my Spa is currently not talking to the mothership, even though I can see the wifi device on the network and I can talk to port 80 & 8080 on it. First problem I found is that the code doesn’t appear to detect the Spa on the network, rather it goes directly to 192.168.68.106 and then fails to talk because nothing is there. I hardcoded the proper IP and it just looped printing the IP over and over when I ran the code. I looked at the mqtt server and there was hmd/sensor/SPABoii-CurrentTemp with an attribute of {“my attribute” : “awesome”}.

Hey Folks, this is as good a place as any for me to contribute something perhaps useful to others. I don’t know how you’ve connected the archaic tub pack brains (of an otherwise beautiful canuck tub!) to your networks, but my 2019 Klondiker with it tp-link wif extender was hot(tub) garbage of an experience. I’m all for ethernet, but did not want run cable into backyard .

In short, as I’ll create a separate thread should this be on interest, I’ve stuck a raspberry pi into the control pack, hooked it into the ethernet jack and then:

  1. Connect it’s wifi to the home network, wifi creds populated in Raspberry Pi Imager
  2. Setting the eth0 ipv4.metod to shared, and making sure dnsmasq assigns it an IP in the default 10.42.0.0/24 range
  3. Disabling the NetworkManager handling of nftables, and manually setting ip_forward: a) set firewall-backend=none in NetworkManger.conf, and b) set net.ipv4.ip_forward=1 in sysctl.conf
  4. Last but not least, as I was stuck on this the longest (with the internet telling me it’s not possible to use nftables to relay broadcasts), use this nftables* to relay udb broadcasts, and other ArcticSpaDC protocols to tub: nftables for a wifi nat-shared to eth0, port forwarding, and broadcast relay · GitHub

RESULT: I’ve had 100% reliable connectivity of my tub in BOTH ArcieSpa cloud app, and for the ArcticSpaDC protocols we intend to use is projest such as this SPABoii (and others, GitHub - xxv/arctic-spa: Interface to Arctic Spa hot tubs).

*Some of the nuances in that nftables:
-broadcasts rules/actions are not supposed to work in ip tables, as kernel ignores these at the ip layer (one is supposed to use netdev table); but I guess that does not hold for the prerouting chain!
-the last line has a couple required quirks, #1 I’m forcing daddr to 255.255.255.255 (from 192.168.x.255 of home network) as that’s the only way that archaic arctic spa respond to the discovery, #2 rather than ending that action in dup to x.x.x.x device eth0 I’m duping directly to tub ip… because it seems that the ethernet connection likes to frequently drop out… who knows if that’s not the cause for all the tub’s connectivity problems!

1 Like

@Patrick-Ohlson do you intend to include the source proto files to the repo? :slight_smile:

1 Like

Hey @Patrick-Ohlson

First off, I just want to say a huge thanks for starting this SpaBoii project. This is exactly what I was looking for to get my Klondiker spa running locally and integrated with Home Assistant!

I got the code and have been digging into it for the last few days… and I got a little carried away. :sweat_smile:

I’ve got a version running now that’s stable and implements almost everything. I wanted to share all the updates I’ve made, and then ask one small question to help get it 100% finished.

Here’s a quick rundown of all the changes:

Made spa_ip Configurable: I moved the hardcoded spa_ip from SpaBoii.py into the settings.yaml file, so now it’s fully configurable.

Added Connection Status: There’s a new ConnectionStatus binary sensor for Home Assistant, so you can tell at a glance if the script is running and connected to the spa.

All Entities Added: I added all the missing pumps and lights! Pump 2, Pump 3, Lights, Blower 1, and Blower 2 all show up as switches in HA.

Full Two-Way Control: This was the big one! I hooked up all those new switches (Pumps, Lights, Blowers) to send the correct commands back to the spa. We now have full two-way control!

More Status Sensors: Added a bunch of new read-only sensors that were in the live data:

Filter Status (e.g., “FILTER_IDLE”)

Ozone Status (e.g., “OZONE_ACTIVE”)

Heater ADC

Current ADC

Text-based status for Heater 1 and Heater 2 (so you can see “IDLE”, “HEATING”, etc.)

pH and ORP Sensors (Got 'em!): This was a fun one. I realized the pH and ORP data wasn’t in the LIVE packet. After some digging (and staring at raw packets), I found they’re in the INFORMATION (0x30) packet outside the main protobuf message. I added the raw-byte-parsing logic to find them by their IDs (\x10, \x18) and now they show up perfectly in HA.

SpaBoy “Boost” Button: I saw the onzen field and figured this was the SpaBoy. It’s now a “Button” in HA that sends the set_onzen = 1 command to kick off the boost cycle.

Cl Range Select: Mapped out the Chlorine Range settings. It’s now a dropdown in HA for “Low”, “Mid”, and “High” that sends the correct orp_min/orp_max values to the spa.

Fahrenheit Conversion: Switched all the temperature reporting and controls to Fahrenheit. The CurrentTemp sensor and SetPoint number input are now in °F.

Bug Fixes:

Fixed the Enum crash for my Klondiker (Product Code 3836). It now just prints the unknown ID instead of crashing.

My Question

This thing is 99% complete, but there are still a few fields in the SpaCommand.proto I can’t figure out just by looking at the data (like setting filter cycles, economy mode, etc.).

You mentioned in the HA forum that you had reverse-engineered the app and had the protobuf protocols. Would you be willing to share the original .proto files? (Especially SpaCommand.proto and SpaConfiguration.proto).

Having those definition files would make it super easy to map out and implement the last few remaining functions. It would be a massive help to get this thing totally finished!

Thanks again for all the awesome groundwork on this!

3 Likes

Heys all

Added the full proto pack to repo

Make good use of it​:tada::tada:

1 Like

Thanks for all this work, I’m excited! I’m going to integrate your work for my new summit xl as soon as you give the 100% complete go-ahead! I’m new to third though - would this be something on HACS eventually or more of a manual install route?

1 Like

Heys all

@walterua has done some major updates, be sure to test it out❤️

Added you to main repo, Walter​:+1::+1:

Do add your reversing info and other tidbits