Lay-Z-Spa Hot Tub wi-fi pump automation

You should be able to use the login sensor, it should show you those values to save you the trouble of using fiddler.
Using the generic thermostat, I’ve got it working, but don’t think I’ll use it as it will always be battling with the settings in my integration.
So yes, the swithces and a temp feedback are probably the best for homekit.

I don’t use the pump temp, I use the water temp.
I have it scheduled so that the pump goes on for 5 minutes every 30mins and it captures the pump temp when it is running. I guess if you have your pump on all the time, then the pump temp is fine !

Water T° is at 0°C, maybe we don’t have the same model (Milan here), so the Pump T° is the only info I have about T°. The filtering is almost running 24/7 as the spa is being used usually around 2/3 times a day. :slight_smile:

In my case, Home Assistant is basically used to get in HomeKit everything we have connected in the house (mainly: Legrand/BTicino SCS for lighting & covers, Gree for the AC/Heating, Miele for the appliances)

@mayeul How do you integrate the Miele appliances?
Would like to do the same but can’t find any info on this.

@BruceH5200 Great work! This is exactly what I want to do with my lay-z-spa (the app is very buggy in my opinion).
However, I am very much a noob at HA. Is there any way this could be packaged in HACS as an integration or custom component?

When I paste the code for the hottub login sensor into the sensor definitions in my configuration.yaml file, I get an error " Invalid config for [sensor.rest]: [json_attribute_path] is an invalid option for [sensor.rest]. Check: sensor.rest->json_attribute_path. (See ?, line ?). " Any ideas what I’m doing wrong please?

@BruceH5200 I appear to have taught myself enough to get this working!
When I ask for the “temp unit set” data the string returned is in Chinese. Is there a parameter to add to the request to get the value returned in English?

That’s what it returns. I just ignore it as I will always have it set to C (not F) so it doesn’t really matter.
Well done for getting it working.

1 Like

Hi @BruceH5200,
thats an awesome find - thanks for shareing :slight_smile:

i’m not using HA (but OH) - however i would love to get this going with i.e. MQTT or similar.
From what I can see, the snippets for REST API is for some HA specific scripts?
Would it be possible to give an example with say Postman? :slight_smile:
Did some quick tries, and only get 404’s :slight_smile:

Regards,
Chris

Hi, You’ve got a lot of stuff there that shouldn’t be there.

LOGIN

POST -> https://mobileapi.lay-z-spa.co.uk/v1/auth/login

Headers:
Content-Type: application/x-www-form-urlencoded
Body: email=[email address - replace “@” with “%40”]&password=[password]

eg. email=bob%40gmail.com&password=abc123

STATUS

POST -> https://mobileapi.lay-z-spa.co.uk/v1/gizwits/status

Headers:
Content-Type: application/x-www-form-urlencoded

Body:
did=xxxxxxxxxx&api_token=xxxxxxxxxxxx
(get them from the login call)

Most of the other calls are the same:

URLS

https://mobileapi.lay-z-spa.co.uk/v1/gizwits/is_online
https://mobileapi.lay-z-spa.co.uk/v1/gizwits/turn_off
https://mobileapi.lay-z-spa.co.uk/v1/gizwits/turn_on
https://mobileapi.lay-z-spa.co.uk/v1/gizwits/turn_filter_off
https://mobileapi.lay-z-spa.co.uk/v1/gizwits/turn_filter_on
https://mobileapi.lay-z-spa.co.uk/v1/gizwits/turn_heat_off
https://mobileapi.lay-z-spa.co.uk/v1/gizwits/turn_heat_on
https://mobileapi.lay-z-spa.co.uk/v1/gizwits/turn_wave_off
https://mobileapi.lay-z-spa.co.uk/v1/gizwits/turn_wave_on
https://mobileapi.lay-z-spa.co.uk/v1/gizwits/temp_set (need to add temperature=xx to the body)

Great, thank you - got it working now.
the trick is to use “raw” as body, then it works :smiley:

/Chris

1 Like

Love this project @BruceH5200… copied with pride. :slightly_smiling_face:
thanks for sharing!

1 Like

Wrote a simple script to use this and send data to MQTT subject(s).
Based on your work Bruce, thanks! :slight_smile:

/Chris

1 Like

Sorry for my absence of reply, I found this:

Mayeul,

1 Like

This is amazing. I think I might see if I can turn this into a component! Have you started on that, or should I run with it?

If you could, that would be amazing.
It’s a bit beyond me at the moment, so would be very happy to see you work on it.
Happy to give whatever input I can.

I’m a dev, but not a Python dev. I’ll have a bash and see where I get!

FYI - I’m working on the python api here:

A long way off - but any python devs want to give me a sanity check I’d be massively appreciative!

FYI! making good progress!
image

This is a “Water Heater” component and not a climate one so you don’t have a thermostat like you would for a central heating device… it’s not ideal, but it does work.

Looking good. I’ll take a look at the code later.

I’ve not pushed the code for the component yet, only the python library I wrote. There is still a lot to do with the component. Not sure if I should try and get it into home assistant (in which case I can’t put in all the features yet - the PRs must be small) or if I should put it into HACS

I’ve done the absolute bare minimum to get it into HACS - you can add it using this repository https://github.com/rossdargan/lay-z-spa-component

Let me know how you get on with it!

Once added go to add integration and add lay-z spa, then enter your username and password. Hopefully it works!

away mode = heat power off… not sure if I will keep it like that, but it’s possibly the simplest way

1 Like