Open Ylianst opened 4 months ago
freshwater.csv.gz gabe_thinkworx (1).csv.gz
Here are about a weeks worth of logs. freshwater.csv.gz is all messages received by the connected spa system, whether for it or not. The thinkworx log is everything sent to the cloud service.
In general, if the lights are on, we're using the tub. If both jets are on full and the lights are off, chlorine was being added to the tub (between 2 and 5 oz of 10%).
I'm pretty confident COL36 is chlorine in 10ths of PPM. Col 40 looks to me to be Ph in 10ths as well. Going to try and automate chlorine control with something like this today (key in is 'spa_usage', i.e. the salt system setting):
### less than 45, go full
if chlorine["chlorine"] < 30:
json_rec[key] = 10
print("Chlorine low. Going to 10")
### more than 60, go minimal
elif chlorine["chlorine"] > 50:
json_rec[key] = 6
print("Chlorine high. Going to 6.")
### if we're less than 50 and going down, go up to maintain
### remain in maintain until we hit full or minimal
elif json_rec[key] <= 6 and chlorine["chlorine"] < 40:
json_rec[key] = 8
print("Chlorine coming down, go to 8 to maintain.")
### if we're over 50 and going up, go to maintain
### remain in maintain until we hit full or minimal
if json_rec[key] == 10 and chlorine["chlorine"] > 40:
json_rec[key] = 8
print("Chlorine coming up, go to 8 to maintain.")
Manually sending values to the salline_test value that gets surfaced in the mobile app. It appears it only goes low_yellow (at 30) to high yellow (89).
Everything else takes the system offline. (It looks like 20's are also low yellow, but in offline - low status state)
Here's what I got fiddling with it:
salline_test 0,grey,"offline" 1,grey,"offline" 60,low_green 50,low_yellow 40,low_yellow? 30,low_yellow? 20,grey,"offline" 25,Low_yellow,"offline - low status" 29,Low_yellow,"offline - low status" 70,mid_green 80,high_green 90,grey,"offline" 85,high_green 87,high_green 89,grey,off 88,high_yellow
ok, I think I have it automated. set_tanas_menu_entry in the thinkworx channels is the salt system setting (value + 256, so a salt setting of 10 is 266).
This is amazing! I could probably figure it out, but if there is anyway you can take an example data packet and decode it, that would be great. I don't have Freshwater IQ, but if there is interest in having it added to the ESP-IQ2020 integration, I am willing to put in the work. I would need someone with this module and Home Assistant to confirm that it works.
Works like a Charme!, Hotspring Grandee, just three minor issues/requests
Motor Power consumption appears to measure 1 motor only? ( Shelly is reporting around 2kwh for each motor if turned on fully), but the ESP32 reports approx 1.95kwh only, just a minor issue
Are there any plans to support fresh water system? (salt system), e.g. changing boost mode, level, ...
After a few days, with the fresh water system, the pool stops producing chlor and waits for a user confirmation, any plans on supporting this? (this would be help a lot if not at home and you get a notification when the whirlpool stops)
Anyway, great work and really great instructions how to setup, very appreciated!!
@robertsze Thanks for the feedback. Can you post the year of your hot tub and the version string? I will add your device to the tested page.
Again, thanks for the report. The extras page has more controls for lights, etc. Feel free to check it out.
@Ylianst
Thanks for the feedback. Can you post the year of your hot tub and the version string? I will add your device to the tested page. Hotspring Grandee Model Year 2021
For the hot tub power sensors, I have no real idea what the numbers measure and just took guesses. If you find what the measurement is exactly for, let me know and I will change the name / unit. This value may also change depending on your tub model. So, you're likely right, not sure what the value truly is I can debug this a bit and try the find the correct values / meaning
Yes, take a look at the extra's page here. You can add extra sensors for Freshwater (Note that Freshwater IQ is something different). Let me know if that works. Awesome, will give it a try
Yes, we have the "Salt Level Confirmed" sensor that tells you confirmation is needed. I do not have a command to remotely confirm, but it's not impossible it exists and has not been captured yet. Will give it a try too!
Thanks a lot, I will dig into the source a bit if something is missing and try to provide patches if I find something
This is great! This has saved me £500.00 as I was about to by the wifi controller from Hot Springs in the UK. My hot tub is HotSpring HotSpot SX 2017 version 110T 7b54A002 v2.6
There is one little issue, is that the light switch is a bit unstable and turns on off as and when it likes. Sometimes its comes on its own. The light in the hot tub is just one blue colour, but you can control the intensity, by pressing the light button, once for dimmed, and then again, for full power and then press again, its off. I have tried to tweak the yaml code, but I hasnt worked. I remove jets 2 and 3, as there is only one pump on the tub.
On Debug I do get a warning now again the Component IQ2020 took a long time for operation (63ms).
Also The pump power doesnt show any power when the pump is on.
I am also using this, without HA, and just logging into the web interface, using portfowarding on the router. This hot tub is our holiday home, and I dont want to set up another smart home server. I also use Openhab, in our main home, and it gets a bit tricky to multi cast over VPN so that openhab can control it.
Many thanks for figuring this out!!
Hi @nigeljg and thank you for sending the model, version and image. That is super useful.
For the "pump power", that is only a guess on my part as to what that sensor is and many hot tubs will not have this sensors at all. If it's always zero, just remove it from the YAML.
For the light, your hot tub does seems to have a different light configuration for sure. If you want to debug it, follow the debugging guide here and you will see all the RS485 traffic. If I had to guess, you hot tub has only the underwater light with brightness 0 to 2. Again, complete guess but if this is correct, you can adjust the YAML to this. I will guess any brightness over 2 will turn the lights off. For you debug you lights, please send the information over, I will change the integration if needed and post your YAML for others to use.
Not using Home Assistant is perfectly ok. If you have suggestions for stand alone usage, let me know. I would be interested in providing stand alone usage since not everyone uses HA.
If you ever get a chance, take a picture of your setup with the ESP32 installed. I would like an example of the connection for horizontal connectors like yours.
Hi @Ylianst, I have just removed the light switch YAML code, and just left in the YAML code to change the intensity, to 3, ie giving 3 positions. Trouble is I am not there at our holiday home at the moment, and will not be down this weekend, so I dont know if it is really working and controlling the light, but is not throwing up errors on the debug. I dont notice on the Debug, that setSwitchState, switchid=0, status = 0, and I cant seem to figure out what that switch ID is in the YAML code.
I have found a ESPHome Link, on here, github, where someone has developed a standalone app for ESPHome, and all you need to do is point the app at it. It appears to work OK. I attach a screen shot, with my IP address greyed out. I think you can encrypt it, but Im not using the encrypted bit, and Im NOT that really worried, if someone hacks into the control of the hot tub!
I will take a picture next time I am down there of the ESP32 connected to the pins on the board and post it.
Many thanks once again on figuring this out!!!
Thanks @nigeljg. I did a quick search and found ESPHome Link, indeed this is very interesting as it allows access to a ESPHome device without the need for HomeAssistant. Good find, I will take a look at it in more detail when I get a chance.
Hi @gdbassett. I just took a look at the logs your provided to decode Freshwater IQ data. So far, I have this:
<-- 37 01 40 23D500
<-- 01 37 80 23D5000000003234313130304E30A76EBD3915FF7E9C30303744000000040000000400000004000031500000271000002710000007E2000007E2
AAAAAAAABBBBBBBB
AAAAAAAA - Cartridge use in hours (Small-Endian)
BBBBBBBB - Cartridge use in hours (Small-Endian)
The one week log you provided has many 0x37
commands, both polling and response, and I see the two last 4 byte values increase every hour. However, I don't see any other changes. Can you point to exactly where are the Ph and Chlorine values and how you decode them? I will update the documentation and add support for it in the integration. Thanks.
Note that in my packet notation, I remove the starting 1C
, the packet length and the trailing checksum. Anyway you can point me in the data and tell me the values you found would be great.
@Ylianst you should be looking for messages from 37 to 01 with command 23D1. (These messages only occur about once per hour vs the 23D5 messages that occur very frequently.) It's possible I sent the wrong csv before as I've had some issues with the data being cut off. The CSV below is specifically these messages.
I'm very confident COL 36 is chlorine. I took the water to the local pool place to test and they tested about half a PPM above what my reading was, but that's close enough. It tracks almost perfectly with when I add chlorine, use the tub, or change the salt output.
I'm less sure about Ph. I had thought it was COL 40. But I added phDown around 8:30 GMT on the 17th and then ran the jets, but saw the Ph reading go up. I'm really going to need a digital Ph meter to test it regularly to figure out what provides Ph. I guess it's possible COL31-32 is Ph as the pool place tested me at 8-something and it's in that range. Part of my problem is because I have a salt system, I keep overall hardness generally low (60 currently, but prefer lower) which makes fiddling with Ph more difficult.
The figure below is all channels that actually change over time. (minus a few channels that change when there's a failed reading. You can find those by searching for what columns change when COL40 is "00".
I'm not sure about COL45. It's clearly wrapping, but COL44 is clearly connected to COL43 so not the higher bits for it and COL46 isn't changing (to provide major bits when it wraps.) No clue about the others.
Thank you @gdbassett. I went back into your data with your latest information and decoded 0x23D1
like this:
<-- 01 37 80 23D100000000000000000000087A000003090000000F0000004B00001F2C
AAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDEEEEEEEEFFFFFFFFGGGGGGGG
AA = Unknown, always zero.
BB = Unknown, always zero.
CC = Unknown, 32 bit small-endian.
DD = Unknown, 32 bit small-endian.
EE = Chlorine in 10ths of PPM, 32 bit small-endian, Convert to decimal and divide by 10.
FF = Ph in 10ths, 32 bit small-endian, Convert to decimal and divide by 10.
GG = Hours remaining count-down, 32 bit small-endian.
Note that your COL45 is the packet checksum and so, you need to ignore that and also, anytime the packet is longer than COL45 you need to ignore it. Sometimes multiple data packets get sent at the same time and overlap causing long packets.
Looking at all your data, I will make the assumption that 0x23D1
contains 7 x 32bit numbers. Chlorine, Ph and what seems to be a count-down timer in hours. The count down would be around 332 days (1F2C
= 7980 hours) - Does that match up with the time you need to replace something?
I just added initial Freshwater IQ support to my iq2020-dev
integration. Of course, I don't have this module, so I only see unknown values:
I added sensors for all 7 values reported by this module command 0x23D1
so that everyone with Home Assistant can track these values. I will add it for the iq2020
production integration soon.
I added a bunch of documentation on the Freshwater IQ commands here.
Initial Freshwater IQ support was added to the integration, instructions here. Please report back anything and everything as I don't have this module and so, need community feedback.
I added the config as described in your instructions:
[11:53:44][D][iq2020:1204]: Poll Freshwater IQ
[11:53:44][D][iq2020:1209]: Poll
[11:53:45][D][iq2020:338]: Invalid checksum. Got 0x33, expected 0x56.
[11:53:49][D][iq2020:1204]: Poll Freshwater IQ
[11:53:49][D][iq2020:1209]: Poll
[11:53:51][D][iq2020:338]: Invalid checksum. Got 0x1c, expected 0xcd.
[11:53:54][D][iq2020:1204]: Poll Freshwater IQ
[11:53:54][D][iq2020:1209]: Poll
[11:53:54][D][iq2020:338]: Invalid checksum. Got 0x21, expected 0x60.
I'll try to debug it further myself but do you have any pointers where to start @Ylianst?
I also encountered a strange behavior that the program doesn't transmit all the sensor values until I set a audio source manually. It's stuck polling audio source until I set it.
[11:37:44][D][iq2020:1196]: Poll Audio
[11:37:49][D][iq2020:1196]: Poll Audio
Thanks for the report @spangenberg. I will take a look at this as soon as I get a chance.
Small heater power, looks to me that this is the circulation pump? Running constant at around 40W
Same experience as spangenberg, only values shown, when audio source is set manually. As soon as IQ sensors are integrated there are no values at all.
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
any thoughts? thx gene
ignore above - this is what happens when you come home from work exhausted and want to relax with a little project. user error.
@pettab - Circulation pump, that makes sense. I am very much novice with hot tubs and did not know about circulation pumps at all until recently.
@grossimd - Thanks for correcting. If you ran into and issue that others could also run into, please don't hesitate to let us know how you fixed it. It could help many. In any case, thanks for enjoying ESP-IQ2020.
@spangenberg, @RWag-AC - I just released an update to ESP-IQ2020 with a fix for Freshwater IQ and Audio polling when first starting. Can you update your firmware, try again and let me know if it works better now? Note that you may need to add refresh: 10m
to your config file just to make sure ESP-Home checks and pulls the latest version, something like this:
external_components:
- source: github://ylianst/esp-iq2020
refresh: 10s
Small heater power, looks to me that this is the circulation pump?
Running constant at around 40W
My 'small heater power' constantly shows approx 120W when the hot tub is idle, but according to my energy monitor on the hot tub supply, it's only pulling approx 80W. How ever the 'small heater power' some times increases & some time decreases when the main pump is on. Other than that, it's steady around '120W'.
@Ylianst that worked perfectly for IQ as well as for Audio source.
Just posting screenshot here to take note for myself as I'll try then to make sense of the other values.
@Ylianst also works perfect on our 2024 Jetsetter LX now. Here are my values, maybe it helps to figure out what Unknown C and D myght be:
@spangenberg, @RWag-AC - Nice! I am always worried of coding things that I can't test, but it worked out this time. For figuring out the values, what I would do is setup the DataViewer tool, instructions here. This Windows tool allows you to see all the traffic on the RS485 bus and send data. Normally, IQ data is refreshed every hour, but I would send the following command:
01 37 80 23D100000000000000000000087A000003090000000F0000004B00001F2C
This is normally a response to a IQ data poll, but I am guessing this will cause the user interface to change. You can then change the following values and send the command again to update the UI at will. This is how I figured out the ACE values. There are probably 7 values in HEX you can play with:
<-- 01 37 80 23D100000000000000000000087A000003090000000F0000004B00001F2C
AAAAAAAABBBBBBBBCCCCCCCCDDDDDDDDEEEEEEEEFFFFFFFFGGGGGGGG
AA = Unknown, always zero.
BB = Unknown, always zero.
CC = Unknown, 32 bit small-endian.
DD = Unknown, 32 bit small-endian.
EE = Chlorine in 10ths of PPM, 32 bit small-endian, Convert to decimal and divide by 10.
FF = Ph in 10ths, 32 bit small-endian, Convert to decimal and divide by 10.
GG = Hours remaining count-down, 32 bit small-endian.
So, what you need to do is change the values and mark what value changes what element of the UI and what is the upper/lower bounds in the UI of each value.
That will give us exactly how to setup the gauges in Home Assistant to match the user interface.
After an hour, your UI should go back to correct values as the IQ2020 polls the IQ module again. You can also use DataViewer to send 37 01 40 23D100
, this is the IQ2020 polling command to restore your UI to correct values.
Thanks, I'll try to do this the upcoming days.
And many thanks already for responding so quickly and of course the entire project at all :)
@Ylianst the values for PH (7,3) and Chlorine (2,8) seem to fit to the reading on the monitor, assumed that the green region for chlorine goes from 1 to 5 and for PH from 7,2 to 7,8 (as shown as ok-values in the manual) The salt reading went down today when filling up some fresh water (from mid green to low green), the same did unknown value C (from 2.168 to 2.005), but this numbers do not correspond to the green region if the ok-values are between 1,500 and 2,000. From the value, unknown value D could be alkalinity, but there is no column on the moitor for this.
Thanks @RWag-AC. That is excellent data. It does look like I can rename unknown value C to salt. I will hold off, if @spangenberg can just push values to the UI and see how it reacts, that will be the best way to know exactly what value is what and what the ranges are.
@Ylianst just wanted to give a small update. I managed to play around with the DataViewer tool and mess up my readings but haven't figured out yet what the upper and lower bounds are. Need to first figure out a way how to not drop my Laptop into the pool while working on it :) Think I should have the values some time this week.
Thanks for the update @spangenberg - Yes, please be careful.
@Ylianst I would agree with C being salt content as well. I added a large amount of water to my tub the afternoon of the 6th. (I also added a lot of Ph Down.) Here are the two charts:
I also can send you the logs as well if you'd like.
Also, to your question here but for the salt bar, : https://github.com/Ylianst/ESP-IQ2020/issues/13#issuecomment-2386303559, you can find what I charted out (for the app) here: https://github.com/Ylianst/ESP-IQ2020/issues/13#issuecomment-2351061039.
Thanks @gdbassett. Oh, I now get your numbers in you comment! I am traveling now, but when I get back, I will update the names and data.
That reminds me, In case you want to build the automation into the server, I was going to post the code I'm using for automating it:
if chlorine < 30:
json_rec["set_tanas_menu_entry"] = 256 + 10
my_logger.debug("{0} {1}".format("chlorine", "Chlorine low. Going to 10"))
print("Chlorine low. Going to 10")
time.sleep(5) # sleep 5 seconds as a debounce
### more than 60, go minimal
elif chlorine > 40:
json_rec["set_tanas_menu_entry"] = 256 + 5
my_logger.debug("{0} {1}".format("chlorine", "Chlorine high. Going to 5."))
print("Chlorine high. Going to 5.")
time.sleep(5) # sleep 5 seconds as a debounce
### if we're less than 50 and going down, go up to maintain
### remain in maintain until we hit full or minimal
elif channel_values["spa_usage"] <= 5 and chlorine < 35:
json_rec["set_tanas_menu_entry"] = 256 + 7
# my_logger.debug("{0} {1}".format("chlorine", "Chlorine coming down, going from 5 to 7 to maintain."))
# print("Chlorine coming down, going from 5 to 7 to maintain.")
# time.sleep(5) # sleep 5 seconds as a debounce
### if we're over 50 and going up, go to maintain
### remain in maintain until we hit full or minimal
if channel_values["spa_usage"] > 6 and chlorine > 35:
json_rec["set_tanas_menu_entry"] = 256 + 6
# my_logger.debug("{0} {1}".format("chlorine", "Chlorine coming up, going from 10 to 7 to maintain."))
# print("Chlorine coming up, going from 10 to 7 to maintain.")
# time.sleep(5) # sleep 5 seconds as a debounce
### END replace chlorine with auto setting
That's for a 650gal tub and may be on the low side. (I was getting overshoots near 60 chlorine with an upper at 50 instead of 40 and a rise setting of 7 instead of 6 so decreased both.) The middle 'maintain' values (6 & 7 here) and decrease (5 here) will vary by tub size. There's a table from watkins on 'maintain' settings per tub size that can help as a guide. The break points (30, 35, 40, or 3ppm, 3.5ppm, 4ppm) are probably ok, but fiddling with them wouldn't hurt. (the commented out log lines may be out of sync. And no need for a debounce really as it only tests once per hour.)
'set_tanas_menu_entry' is the value the app sets in the cloud service to then change the tub.
I attach a picture of the leads plugged into the Hawk board.
It might be a coincidence, but the PSU on the board, I think has failed. I couldnt log into the ESP module and thought the wifi had dropped out. As soon as i got to our summer house, the spa display was dead. There is voltage to high voltage side, but the low voltage side is dead. There is an openframe PSU on board which can be disconnected. its Delta PSU, but it is not made anymore. Its obsolete. Some companies have brought up old stock of these PSUs but you need to buy 300 of them. Spa dealers are selling for £85.00, which you could have brought from digikey for about £15.00. The newer version are slightly bigger boards, in width dimensions.
Hi @nigeljg. I am not familiar with the Hawk board. What model and year is this hot tub? If this is a pre-2014 board, there is a discussion here that may help.
What's y'alls experience with the the salt cartridge running out? I've heard the cartridges are set to self-expire after 3 or 4 months. Mine is reporting done though I've also had some water issues including hardness creeping past 100.
I took a look and there's a saline_test channel on the connected spa kit:
But all the issues since Oct 6th seem to be related to to the water issues (Alkalinity, eating 1ppm chlorine / hour, hardness too hard for the salt system). My hope was fixing those would bring the salt cartridge back online, but the peripheral current is hovering at it's 1A steady state rather than 2A 'salt system in use level':
And the app shows "Offline - Low Status"
Have y'all had success with keeping the salt system running and really detecting when it was run out? I understand after-market salt systems tend to last for years before the anode/cathode need to be replaced.
@gdbassett Good questions and data. I have a Freshwater system, but don't use it and disconnected the module, so, I don't have anything to offer here sadly. It would be interesting to take one of the anode/cathode modules apart and get a look at it.
@Ylianst
Here's what they look like w/o taking apart. Front is new, back is old. It definitely is timing 4 months. They have a serial number on them so I wonder if the system is keeping track of age by serial number or if it's actually built into the module itself. (If it's not in the module, can you just overwrite the serial number? If it's in the module, can you just send a message with a new serial number or age to reset it?)
LMK if cracking the old salt system might be useful. (though if I crack it I won't be able to put it back in and test if it'll still work)
I think DD on the salt system is chlorine related as well. I just had 6 14yo's in the hot tub which, as expected, trashed the water. I've put chlorine in several times. Here's what the chlorine reading looks like: Here's what Channel DD looks like:
Through the whole time the UI has read red (low), even when "chlorine" was supper high as a number. This leads me to believe actual chlorine is a combination of DD and EE (chlorine). Maybe EE is combined chlorine and DD is free making total chlorine the combination of the two?
Based on this figure and the assumption that chlorine should mostly be positive between 0 and 10, I think that implies DD is total chlorine and EE is maybe free chlorine?
@gdbassett - Nice. I don't have this module, but please let me know what if any changes I should do to the integration. By the way, good work here.
Note that the ultimate way to know what is going on is to do what I posted here. This is the way to exactly know what value is what.
@spangenberg any news about the measurement ranges? @Ylianst I am still quite sure about value C beeing salt. I asked Watkins which values are measured with the sensor and they said these are chlorine, pH and salt. Also, I asked, why the stick reads around 2.000ppm for salt (which is the same as my value C) when the display shows green in the lower half. The answer was that the freshwater IQ system needs more salt and, as long as the readings are green, everythink is ok. Value D in my opinion could either be alkalinity or hardness. My value D is around 810 (81.0) and it is the same range I measure for alkalinity and hardness with the stick.
New discussion thread. Please post anything on IQ2020 ESP.