ximon / Hot-tub-remote

Lay-z-Spa wifi remote (3 pin model)
44 stars 7 forks source link

6 pin version #4

Closed sanyatuning closed 3 years ago

sanyatuning commented 4 years ago

Can anyone help me with 6 pin version: images Any guess how to start?

Measured on cabels from base unit without the head:

phiberjenz commented 4 years ago

What is the model number of your pump? I have a #54112 (Swedish market, bought last year). Haven’t opened it up yet but my guess is that it is not 3-pin...

phiberjenz commented 4 years ago

Nope, I have 4 pins :D

byles commented 4 years ago

I have 6 pins, when it stops raining I plan to stick the logic analyser on it..

byles commented 4 years ago

Here's a real quick capture in sigrok pulseview. I don't really know what I'm doing :) And it's still wet outside :( Archive.zip

D0 = pin 3, and so on. D3 (pin 6) goes high when I pressed a button and it goes beeeep

sanyatuning commented 4 years ago

@byles this is awesome, huge thanks I have model #54314

byles commented 4 years ago

I can't make any sense of that short capture if I'm honest... I will do it again properly as soon as the weather is better and at a higher sample rate. Any thoughts on what that connector is? I don't want to hack up mine :)

sanyatuning commented 4 years ago

mine is SM connector

pdecat commented 4 years ago

FWIW, I've got a model #54129 Palm Springs (French market bought two years ago) and it's a 4 pin.

image image

byles commented 4 years ago

The one I'll be poking around on is #54123 UK market. Thanks to sanyatuning, 6 pin connectors should be arriving in a few days!

byles commented 4 years ago

Just a thought... I've seen they have an iphone/android app for controlling these things. I wonder if the 5/6th line is for a Wi-Fi adapter of some sort on a newer/higher model.

sanyatuning commented 4 years ago

@byles what was the state of the hot tub when you captured this? It was turned on? It was filtering or heating? What was the water temperature? (as you remember)

Thanks!

byles commented 4 years ago

Hey sorry didn't see the email til just now. I'm attaching a capture from earlier today.

Pin 6 is just the beep, if it's disconnected, there's no beep!

I didn't seem to get any data at all on 3,4 or 5 from the control panel when the control panel was disconnected, maybe it only sends in response to messages from pump during the gap or when polled. master/slave?

3,4 and 5 always have data sending from pump regardless of control panel being connected.

State of machine during this capture:

On Unlocked No timer Bubbles Off Filter On Heat On (green - standby/not heating) 35℃

hottub2.zip

Would I be daft to think this is SPI, D0 (line 3) data, D1 Clock, D2 Chip select. 24us bits time

sanyatuning commented 4 years ago

may be correct

this short message is repeating image

sometimes there is a longer message Screenshot from 2020-05-06 17-50-10

byles commented 4 years ago

https://docs.google.com/spreadsheets/d/1mqK0INE1kh0g_M_HerP3LNWXHpvr-ZIPXr-yXfrYt_k/edit?usp=sharing

Sorry, I went LSB first 🙄

sanyatuning commented 4 years ago

I am using lib SPISlave with esphome on a wemos d1 mini and I got this:

[19:51:00][D][HotTub:018]: D8.C1.FE.03.FE.9F.90.FF.AF.FF.11.D8.D8.42.D8.D8.42.D8.D8.42.D8.D8.80.02.03.80.7F.B0.7F.F0.7F.80 (32)
byles commented 4 years ago

So that looks the same as in my spreadsheet, more or less. You have bubbles and heat on?

All mine started C0 so I wonder what C1 is. What state was yours in?

Should I flip the data in my spreadsheet to be msb first? If you want to request edit and add to it feel free.

sanyatuning commented 4 years ago

fully off or standby I will capture some data in all states soon

byles commented 4 years ago

Well, I wouldn't capture any data if it was fully off 😁

Standby, when screen is dim and not running.

sanyatuning commented 4 years ago

How you capture the data?

byles commented 4 years ago

IMG_20200505_2006552

Cheap logic analyser from Amazon and sigrok. Capturing at 250Hz just so I didn't miss anything. When it was slower sample rate, that clock line wasn't so obviously a clock.

Made jump wires with the SM connectors you identified.

sanyatuning commented 4 years ago

Can you please share a new capture file?

byles commented 4 years ago

The hottub2.zip above is the last one Ive done, is what makes up spreadsheet :)

sanyatuning commented 4 years ago

@byles I wrote a code what reads the current state of the spa. It is an esphome custom component running on a esp8266.

byles commented 4 years ago

@sanyatuning nice, would be good to see what you've got. I was busy this weekend so wasn't able to get anything more done yet.

sanyatuning commented 4 years ago

@byles https://github.com/sanyatuning/hot-tub

chunkysteveo commented 4 years ago

I have a 4 pin model like @phiberjenz - would love to get some remote monitoring and management of the 'Tub. Great work so far guys - i'm very interested in this project. Is the 4 pin going to be different to the 6 pin do you think, SPI, I2C? - V, G, D, C?? has anyone probed the 4-pin version?

reevery commented 4 years ago

I've also got a four pin version and have ordered some kit to start probing that. Model 54156. Not entirely sure what I'm doing, but will figure it out.

chunkysteveo commented 4 years ago

Haha good! Keep me posted @reevery ! I suspect the lines are clock and data, and it would just be a case of reversing the protocol and copying. But I've literally no idea!! Would give me an excuse to buy a logic analyser. Was a pain walking to the bottom of the garden today to turn the heater on.... lol #firstworldproblems 😂

chunkysteveo commented 4 years ago

Found this guys who has a diy product for sale, and uses the 4-pin model too - https://hottubmanager.co.uk/ Only has monitoring states, but surely just need to add in a sending module to the mix to add in the controls? Looks promising too!

reevery commented 4 years ago

I have finally got round to recording data from the 4-pin.

Pins 1-4 are: vcc, signal 1, signal 2, gnd. Starts with pump on, heat on, air off. Temp would have been early 30s centigrade. Then heat off, pump off, pump on, heat on, air on, air off, and I think air cycles again.

I really don't know what I'm looking at though.

Data is here.

chunkysteveo commented 4 years ago

Cool! Nice work - hope someone can work with it?!

reevery commented 4 years ago

I've been trying to make some headway but am struggling a little with direction.

From what I can work out, the 6-pin uses SPI, but I think @ximon yours is UART. Is the 74LVC1T45 then just to split your input and output out? If so, with a signal in and out line on the 4-pin I imagine I don't need this component. What was your baud rate? This is 9600 on mine - does it look similar? image

If that is the case, then my suspicion is that I can use your code but wiring directly to the ESP.

Would the capacitor be needed in all situations and if so where is it wired in? Is it literally just across VCC and GND of the ESP?

Then the next problem is figuring out how to write the code to the Wemos. I know you posted this link (am copying here for my info mainly): https://averagemaker.com/2018/03/wemos-d1-mini-setup.html

ximon commented 4 years ago

The hot tub i have uses a three wire cable between the display/buttons and the controller. It uses some odd protocol that i'm not familiar with - dont think it would work with UART due to the really long start pulse in comparison to the rest of the bits - It looks quite a bit different to the images above, yours won't need the 74LVC1T45 - i only needed it due to the DMA hack I'm using to send out the data.

The big capacitor is just a buffer for when the pump and blower motors turn on - It's directly across the supply.

chunkysteveo commented 4 years ago

Hi @reevery - I'm going to guess that the protocol is I2C for the 4 pin version. Looks like the 7 step I2C message. If it is, we may need an I2C level shifter board for the ESP to read and write back. Although if those signals are from the two data lines, then there's no clock signal - so could well be asynchronous serial communication, like UART. Hmmm?!!?

reevery commented 4 years ago

Thanks @chunkysteveo! There's definitely only two signal wires. pdecat's picture above https://github.com/ximon/Hot-tub-remote/issues/4#issuecomment-623143621 shows Vcc and Gnd on the outer wires. I'm banking on UART but I will investigate it as I2C when I get a chance.

I'm struggling to configure the Wemos at present. It appears their website is kerplunk and I haven't yet found a mirror for it. Baby steps...

eddcaton commented 4 years ago

Looks like I have the 6 pin version as well 😭 doesn’t anyone have an update on this?

Edd

ximon commented 4 years ago

If we can make the control code generic enough then we should be able to just #include the relevant control code for each model, I'll take a look at doing this for the current code - 3 pin model.

Can anyone share the missing info for the other pumps?

I've collated all the information above, with pinouts, in Models.md

Thanks Guys!

chunkysteveo commented 4 years ago

LOVE this idea. Being able to define model number at the start of the script to compile is brilliant. Here's mine:

Model No: 54154 PinCount: 4 (Vcc, Data, Data, Gnd) Model Name: ? From a 'Paris' Tub Date: 2018? Country: UK Comments: Dark-blue/grey, Oval display. Buttons: On/Off, Lock, Timer, Bubbles, °C/°F, Heat, Filter, Temp Down, Temp Up

der-moep commented 4 years ago

Model No. | PinCount | Protocol | Model Name | Date | Country | Colour | Comments 54123 | 4 | -- | Miami | 2018 | Germany | Grey | Round display 54174 | 6 | -- | Honolulu | 2020 | Germany | Grey | Round display

ximon commented 4 years ago

Model No. | PinCount | Protocol | Model Name | Date | Country | Colour | Comments 54123 | 4 | -- | Miami | 2018 | Germany | Grey | Round display 54174 | 6 | -- | Honolulu | 2020 | Germany | Grey | Round display

Thanks! I've added these to the main list.

877dev commented 4 years ago

Model No. | PinCount | Protocol | Model Name | Date | Country | Colour | Comments 54112 | 6 | SPI ? | Vegas | 2020 | UK | Grey | Round display

ximon commented 4 years ago

Model No. | PinCount | Protocol | Model Name | Date | Country | Colour | Comments 54112 | 6 | SPI ? | Vegas | 2020 | UK | Grey | Round display

Thanks! I've added this to the main list.

Friseurazubi commented 4 years ago

Here is the next model ;)

Model | PinCount | Protocol | Name | Date | Country | Colour | Comm 54173 | 4 | ? | Maldives HydrojetPro | 2020 | Germany | Grey | 2 WaterPump

Hawaii HydrojetPro should have the same controller.

635AE1B9-9F31-4564-A170-B86154F2FFB0 4BE7C954-E57F-438E-9D4C-4C8D2478AC20 1E4C1212-63B1-4C73-9EC9-A48F38E64053

danjunx commented 4 years ago

Love this idea! Really interesting in helping out if I can. I've got 2 Vegas model spas here, one is older than the other by a couple of years, however the internals of the pump "egg" are identical bar some different PCB rev numbers, they have the same model numbers.

I've been doing a bit of googling around and found this project among a few others specifically for the 4 pin version - according to this document, it's using UART, and I can confirm that. link

Following the bit pattern settings on the above document, I was able to hook into the TX/RX sides and sniff the traffic from the control panel/display to the controller unit and see the data being sent between them both. Was not able to sniff the data going the other direction for whatever reason. I can provide some direct dumps of the serial output from the control panel/display while going through the various functions if required.

Regarding the model number of the pump "eggs" I have and their details:

Model No. | PinCount | Protocol | Model Name | Date | Country | Colour | Comments 54112 | 4 | UART | Vegas | 2015 | UK | Grey | round display, lock/timer/pump/C-F/heater/bubbles/temp up/down, one has a "test" button in place of the power button.

Am curious about the 2 PROG headers on the boards, may be worth trying to dabble with them although I definitely don't have kit to do so at the moment - it looks like there's replacement controller boards for relatively cheap on ebay (at least here in the UK!) and I was tempted to pick one up to dabble with instead of working with my spare pump.

Couple of photos below, note the pinout of the white 4 pin display connector down the bottom left of the board, also the PROG2 header.

IMG_20200806_140302 IMG_20200806_141954

chunkysteveo commented 4 years ago

That link is fascinating reading. Need to look into the links to their software etc. Not sure why they have an extra blower button though? Good find though!

faboaic commented 4 years ago

You all know this one ? That's what I will try with my lay-z-spa Miami.

https://github.com/visualapproach/WiFi-remote-for-Bestway-Lay-Z-SPA

chunkysteveo commented 4 years ago

That's a great find too!

ricoghardforth commented 3 years ago

Is anyone getting anywhere with a four wire version for a esp2866 solution. Thanks

pejov74 commented 3 years ago

Is anyone getting anywhere with a four wire version for a esp2866 solution. Thanks

Im also looking for a four wire version for a esp2866 solution.

markgdev commented 3 years ago

I've been having a look at this based on the link above, I'm hoping to have a basic setup to test in the next few days. Assuming the comms between the display and controller match for my model 🤞