Scraper sensor

Now it is far beyond my knowledge regarding Api and how to make it work.
I have to thank you all that have tried to help me but now I have to accept myself defeated for now :frowning:

Don’t be! First ask Arctic Spa for a documentation. And tell them that you want to use it with Home Assistant. Tell them what is your use case what you want to use it for, they might going to provide information what is not available at the moment.

Having a working API with an integration into a Home Automation system is a good selling point, but the producers hasn’t got any idea about.

I talked with Lay-Z-Spa representatives about the WiFi models, they were telling me that this is absolutely new and they don’t know will be there newer models with WiFi. (They have no clue about this part of the market.) Currently their top models with bubbles and jets hasn’t got the wifi module, but the more simple bubble models do. For non-Wifi models there is another DIY project, which is about to install a module between the display and the pump as a man-in-the-middle, and that does the smart control.
So, believe me, the producers and seller has no idea what anybody would use remote control for especially when there is no interfacing. - Ask them, it cannot hurt.

For use cases look at the other topic what I linked above. There are a few great ideas, like use the heater when there is low price for electricity. Or heat the water when there is excess power produced from solar panels, etc.

Indeed! Definitely ask them!!!

This is a few lines of code from their Demo page:

<script type="text/javascript">
        window.mqttclient = mqtt.connect('wss://broker.myarcticspa.com:8081', { username: "99999999-9999-9999-9999-999999999999" });
    </script>

They use MQTT, you just need to get the messages from the SPA to your own MQTT broker or get access to their broker and subscribe for changes.

I would prefer the first one as that would mean local access/control.

I have now asked them waiting for reply /thanks

@pewi, have you got any reply from Arctic Spas?

Any reply from them? I am curious.

Hey,

I have ArticSpa too. Any response from Artic Spa?

Hi no answer sorry

PAW

Hey all. I did just get an respons from them. But im not sure how to proceed as I’m not in a position to write code for it. Anyone qualified wanna try? :slight_smile: If not I might want to follow the thread of this IFTTT integration…

The respons:
“We do have API’s built for compatibility with Alexa commands and IFTTT support. We may be able to help you out but there is currently not any polished documentation that we can just “send” unfortunately. Are you a developer and would you want to spend some time on getting this to work? If so wed be happy to try and help (and learn a bit in the process).”

If they do have RESTFUL API then you can build REST sensors in HA to get information from there.

What features exactly the Spa has what you can or want to control?

You need to get the way how the authentication working first of all. Usually it is done by tokens. The token is assigned to the username and password and for a period of time. Then you just need to do POST or GET commands with the authentication to the right endpoint to get back the response from the server.

Different endpoints will provide different information, like temperature, temperature aim point, heater is on or off etc… You can build sensors with those values.
With other endpoints you will be able to control the device turn on/off set the heating temperature etc…

Send them a link about the REST sensor and REST command documentation in HA, that will be a good start and ask them how to authenticate to the API and how to get temperature, aim point, how to turn on/off, set temperature as a start.

Thanks @GSzabados, I’ve emailed them back and also actually referred them to this post. Lets see how the respons is :slight_smile:

Let’s hope they give something positive.

Actually as they seem to be using MQTT for communication with their server, the best would be if the Spa could send messages to a local MQTT broke as well. Or would provide a REST API endpoint where the queries could go. Basically to keep things local and do not rely on a cloud server.

The main issue with many manufacturers that they implement only cloud connection on the device to their server and they serve any service from the cloud only.
What they do not recognise is the fact, that running a cloud server cost money for them, unless they run a subscription service model.
Local access could make things vulnerable as it was with TP-Link Kasa plugs. So the manufacturers tend to opt out from that, and just keep connection to their servers.

But let’s hope the best, that they do support local API and it can be accessed without any issues.

1 Like

any updates from Arctic Spas? I just got one and started looking into connecting to HA.

I’ve look at recently how these Arctic Spas supposed to work, and they should have local control as well, if you don’t have internet at your place.

Might worth to try to capture the communication between the app and the spa to see how it happens.

For iOS they have a local control app, for Android as I understand there is a button for local control.

Unfortunately I do not own an Arctic Spa to investigate it myself, but happy to provide more ideas and ways how to tinker with it.

I’ve gotten access to their API since I asked about it 6 months ago. I think it’s still under development, so it might not be open for everyone.

Arctic Spas Public API (myarcticspa.com)

https://myarcticspa.com/spa/SpaAPIManagement.aspx

My experience with custom HA sensors and switches and APIs are limited, but I managed to create sensors from the status API.

sensor:
- platform: rest
  resource: https://api.myarcticspa.com/v2/spa/status
  headers: 
    X-API-KEY: !secret arctic_spa_apikey
    Content-Type: application/json
  method: GET
  name: "Arctic Spa Temperature"
  value_template: '{{ value_json.temperatureF }}'
  scan_interval: 900
- platform: rest
  resource: https://api.myarcticspa.com/v2/spa/status
  headers: 
    X-API-KEY: !secret arctic_spa_apikey
    Content-Type: application/json
  method: GET
  name: "Arctic Spa Temperature Setpoint"
  value_template: '{{ value_json.setpointF }}'
  scan_interval: 900
- platform: rest
  resource: https://api.myarcticspa.com/v2/spa/status
  headers: 
    X-API-KEY: !secret arctic_spa_apikey
    Content-Type: application/json
  method: GET
  name: "Arctic Spa Lights"
  value_template: '{{ value_json.lights }}'
  scan_interval: 900
- platform: rest
  resource: https://api.myarcticspa.com/v2/spa/status
  headers: 
    X-API-KEY: !secret arctic_spa_apikey
    Content-Type: application/json
  method: GET
  name: "Arctic Spa Pump 1"
  value_template: '{{ value_json.pump1 }}'
  scan_interval: 900
- platform: rest
  resource: https://api.myarcticspa.com/v2/spa/status
  headers: 
    X-API-KEY: !secret arctic_spa_apikey
    Content-Type: application/json
  method: GET
  name: "Arctic Spa Pump 2"
  value_template: '{{ value_json.pump2 }}'
  scan_interval: 900
- platform: rest
  resource: https://api.myarcticspa.com/v2/spa/status
  headers: 
    X-API-KEY: !secret arctic_spa_apikey
    Content-Type: application/json
  method: GET
  name: "Arctic Spa Pump 3"
  value_template: '{{ value_json.pump3 }}'
  scan_interval: 900
- platform: rest
  resource: https://api.myarcticspa.com/v2/spa/status
  headers: 
    X-API-KEY: !secret arctic_spa_apikey
    Content-Type: application/json
  method: GET
  name: "Arctic Spa Pump 4"
  value_template: '{{ value_json.pump4 }}'
  scan_interval: 900

Is there anyone that can help me figure out how to make a switch? I guess I need to specify payload in some kind of format, and do I also have to get the current status of the light?
The curl command to turn on the light:
image

1 Like

Does all the status comes from that single endpoint?

You could create a RESTFul sensor and add all the details into separate “template” sensors from that. They are actually part of the same rest call. So you would not call 7 times the same endpoint every 900 seconds (15 minutes). But you could call it every 120 seconds and get all 7 at once.

For creating a switch you will need the RESTful Switch:

The integration has the option to verify the value of the switch as well. The example at the bottom of the page will have mostly everything what you need!

Hi, yes they come from the same endpoint. I created a seperate topic for the API. It’s now pulling the data into binary sensors with a single call.

1 Like

Hi I’m Paul, and recently I’ve been trying to experiment with my spa but I need access to my API key. By any chance did you ever find out how to get it?

@dagm - how did you get early access to the API? Did you email someone? Your API Management link doesn’t work for me. I suspect that is where you would create an X-API-KEY for authentication to your account. Otherwise, I’ll also need help getting the X-API-KEY.

I asked them a year ago if they had an API. He contacted me later and asked if I wanted early access to the API. I’ll send you his email by PM.