Balboa Hot Tub/Spa Automation and Power Savings

Your addon doesn’t appear to work anymore. A couple people have left feedback with the same issue.
When the addon is building we get this error:

The command ‘/bin/ash -o pipefail -c set -eux; apk add --no-cache --virtual .ruby-builddeps autoconf bison bzip2 bzip2-dev ca-certificates coreutils dpkg-dev dpkg g++ gcc gdbm-dev glib-dev libc-dev libffi-dev libxml2-dev libxslt-dev linux-headers make ncurses-dev openssl openssl-dev patch procps readline-dev ruby tar xz yaml-dev zlib-dev ; rustArch=; apkArch=“$(apk --print-arch)”; case “$apkArch” in ‘x86_64’) rustArch=‘x86_64-unknown-linux-musl’; rustupUrl=‘https://static.rust-lang.org/rustup/archive/1.25.1/x86_64-unknown-linux-musl/rustup-init’; rustupSha256=‘95427cb0592e32ed39c8bd522fe2a40a746ba07afb8149f91e936cddb4d6eeac’ ;; ‘aarch64’) rustArch=‘aarch64-unknown-linux-musl’; rustupUrl=‘https://static.rust-lang.org/rustup/archive/1.25.1/aarch64-unknown-linux-musl/rustup-init’; rustupSha256=‘7855404cdc50c20040c743800c947b6f452490d47f8590a4a83bc6f75d1d8eda’ ;; esac; if [ -n “$rustArch” ]; then mkdir -p /tmp/rust; wget -O /tmp/rust/rustup-init “$rustupUrl”; echo “$rustupSha256 */tmp/rust/rustup-init” | sha256sum --check --strict; chmod +x /tmp/rust/rustup-init; export RUSTUP_HOME=’/tmp/rust/rustup’ CARGO_HOME=‘/tmp/rust/cargo’; export PATH=“$CARGO_HOME/bin:$PATH”; /tmp/rust/rustup-init -y --no-modify-path --profile minimal --default-toolchain ‘1.66.0’ --default-host “$rustArch”; rustc --version; cargo --version; fi; wget -O ruby.tar.xz “https://cache.ruby-lang.org/pub/ruby/${RUBY_MAJOR%-rc}/ruby-$RUBY_VERSION.tar.xz”; echo “$RUBY_DOWNLOAD_SHA256 *ruby.tar.xz” | sha256sum --check --strict; mkdir -p /usr/src/ruby; tar -xJf ruby.tar.xz -C /usr/src/ruby --strip-components=1; rm ruby.tar.xz; cd /usr/src/ruby; wget -O ‘thread-stack-fix.patch’ ‘https://bugs.ruby-lang.org/attachments/download/7081/0001-thread_pthread.c-make-get_main_stack-portable-on-lin.patch’; echo ‘3ab628a51d92fdf0d2b5835e93564857aea73e0c1de00313864a94a6255cb645 *thread-stack-fix.patch’ | sha256sum --check --strict; patch -p1 -i thread-stack-fix.patch; rm thread-stack-fix.patch; export ac_cv_func_isnan=yes ac_cv_func_isinf=yes; { echo ‘#define ENABLE_PATH_CHECK 0’; echo; cat file.c; } > file.c.new; mv file.c.new file.c; autoconf; gnuArch=“$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)”; ./configure --build=“$gnuArch” --disable-install-doc --enable-shared ${rustArch:±-enable-yjit} ; make -j “$(nproc)”; make install; rm -rf /tmp/rust; runDeps=“$( scanelf --needed --nobanner --format ‘%n#p’ --recursive /usr/local | tr ‘,’ ‘\n’ | sort -u | awk 'system(”[ -e /usr/local/lib/" $1 " ]“) == 0 { next } { print “so:” $1 }’ )”; apk add --no-network --virtual .ruby-rundeps $runDeps; apk del --no-network .ruby-builddeps; cd /; rm -r /usr/src/ruby; if apk --no-network list --installed | grep -v ‘[1]ruby-rundeps’ | grep -i ruby ; then exit 1; fi; [ “$(command -v ruby)” = ‘/usr/local/bin/ruby’ ]; ruby --version; gem --version; bundle --version’ returned a non-zero code: 2


  1. . ↩︎

Appreciate any help, this add-on worked brilliantly last year. Ive just turned the tub back on for the season and it fails. Seems host is unreachable.
Perhaps ive forgotten to do something. Any help appreciated.

s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[09:16:32] INFO: Starting BWALink addon...
[09:16:32] INFO: Setting addon timezone to Europe/London based on the system timezone.
[09:16:33] INFO: Starting mqtt bridge connecting tcp://192.168.0.16:8899/ to mqtt://core-mosquitto:1883
/usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.5/lib/bwa/client.rb:42:in `initialize': Host is unreachable - connect(2) for "192.168.0.16" port 8899 (Errno::EHOSTUNREACH)
	from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.5/lib/bwa/client.rb:42:in `new'
	from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.5/lib/bwa/client.rb:42:in `initialize'
	from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.5/exe/bwa_mqtt_bridge:416:in `new'
	from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.5/exe/bwa_mqtt_bridge:416:in `<top (required)>'
	from /usr/bin/bwa_mqtt_bridge:25:in `load'
	from /usr/bin/bwa_mqtt_bridge:25:in `<main>'
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[09:16:41] INFO: Starting BWALink addon...
[09:16:41] INFO: Setting addon timezone to Europe/London based on the system timezone.
[09:16:41] INFO: Starting mqtt bridge connecting tcp://192.168.0.16:8899/ to mqtt://core-mosquitto:1883
/usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.5/lib/bwa/client.rb:42:in `initialize': Host is unreachable - connect(2) for "192.168.0.16" port 8899 (Errno::EHOSTUNREACH)
	from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.5/lib/bwa/client.rb:42:in `new'
	from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.5/lib/bwa/client.rb:42:in `initialize'
	from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.5/exe/bwa_mqtt_bridge:416:in `new'
	from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.5/exe/bwa_mqtt_bridge:416:in `<top (required)>'
	from /usr/bin/bwa_mqtt_bridge:25:in `load'
	from /usr/bin/bwa_mqtt_bridge:25:in `<main>'
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[09:16:49] INFO: Starting BWALink addon...
[09:16:50] INFO: Setting addon timezone to Europe/London based on the system timezone.
[09:16:50] INFO: Starting mqtt bridge connecting tcp://192.168.0.16:8899/ to mqtt://core-mosquitto:1883
/usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.5/lib/bwa/client.rb:42:in `initialize': Host is unreachable - connect(2) for "192.168.0.16" port 8899 (Errno::EHOSTUNREACH)
	from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.5/lib/bwa/client.rb:42:in `new'
	from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.5/lib/bwa/client.rb:42:in `initialize'
	from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.5/exe/bwa_mqtt_bridge:416:in `new'
	from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.5/exe/bwa_mqtt_bridge:416:in `<top (required)>'
	from /usr/bin/bwa_mqtt_bridge:25:in `load'
	from /usr/bin/bwa_mqtt_bridge:25:in `<main>'
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[09:16:58] INFO: Starting BWALink addon...
[09:16:58] INFO: Setting addon timezone to Europe/London based on the system timezone.
[09:16:59] INFO: Starting mqtt bridge connecting tcp://192.168.0.16:8899/ to mqtt://core-mosquitto:1883
/usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.5/lib/bwa/client.rb:42:in `initialize': Host is unreachable - connect(2) for "192.168.0.16" port 8899 (Errno::EHOSTUNREACH)
	from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.5/lib/bwa/client.rb:42:in `new'
	from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.5/lib/bwa/client.rb:42:in `initialize'
	from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.5/exe/bwa_mqtt_bridge:416:in `new'
	from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.5/exe/bwa_mqtt_bridge:416:in `<top (required)>'
	from /usr/bin/bwa_mqtt_bridge:25:in `load'
	from /usr/bin/bwa_mqtt_bridge:25:in `<main>'
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

Really appreciate any update on this, be good to know if this project is dead or if perhaps theres an alternative. OR if indeed someone still has it running so that I can look to see if my problem is elsewhere.

To be clear, GitHub - jshank/bwalink: Automate your Balboa Spa! A docker container with socat and ccutrer/balboa_worldwide_app that supports a remote serial to IP device or host running ser2net, socat or ESPEasy serial server is not dead and is the project I launched this post for.

The last few posts (and concern of an abandoned project) seem to be related to GitHub - supersebbo/bwa-mqtt-bridge-addon: A Home Assistant Add-on Packaging the bwa-mqtt-bridge ruby application for controller Balboa BP Spa Systems (not mine).

I’d recommend @supersebbo start a new thread for that add-on to make support easier. I’ve been getting direct messages for assistance with that module.

Thats great to hear Jim, I was running your version last season. As you can see it failed when trying this year. Anything you can advise based on the errors I received? Many thanks for continuing maintenance and support?

I think the last time you were running into issues, I suggested a cron job to restart in Balboa Hot Tub/Spa Automation and Power Savings - #30 by jshank

No, that wasnt me, i was responding to another user that the Bolboa wifi module was very unreliable.
I switched to the remote serial device and everything for me from that point had been good. Also I dont run docker, so not sure how to run cron job, if your suggesting thats what I should be doing. Many thanks for help.

Just an update, my tub came back online, maybe needed a couple of days to settle…

Jim,
I’m glad to hear the project is still alive and hoping you can help me. I have the Elfin-EW11 all set up and configured per your specs. I’m trying to install the addon but it immediately says Failed to install add-on
Unknown error, see supervisor

The Supervisor log says
2024-05-09 04:24:05.905 ERROR (MainThread) [supervisor.docker.addon] Invalid build environment, can’t build this add-on!

I’ve double checked the contents and am pretty sure I have that correct.

Any idea what I am missing?

So I tried your Docker route instead, subscribed to homie/# and expected to see activity in MQTT Explorer but don’t see anything. My Docker Compose

version: "3"
services:
  bwalink:
    image: ghcr.io/jshank/bwalink:latest
    container_name: bwalink
    restart: unless-stopped
    environment:
      # See https://iotbyhvm.ooo/using-uris-to-connect-to-a-mqtt-server/ for MQTT_URI format
      # MQTT_URI *must* be properly URI encoded, e.g. mqtt://useename:pa##[email protected] would 
      # be mqtt://username:pa%23%[email protected]
      # BRIDGE_IP and BRIDGE_PORT are the address and port for your serial to IP device or 
      # host running ser2net, socat or ESPEasy serial server
      MQTT_URI: mqtt://mqtt_broker:[email protected]
      BRIDGE_IP: 192.168.1.163
      BRIDGE_PORT: 8899
      TZ: America/Los_Angeles
      LOG_LEVEL: WARN # Any of FATAL, ERROR, WARN, INFO or DEBUG
networks: {}

Using Mosquito in HA, user name is mqtt_broker, password has no special characters, Ha is on 192.168.1.110

Any ideas what I am missing here?

Does the docker container start correctly? Do you get anything in the docker logs docker logs bwalink ? Set the LOG_LEVEL to INFO or DEBUG and restart the container.

davidtja shared the contents of his addon folder (which appear to be different than your link - bwalink/ha-addon at 5f8c102eb9cbac258f0693d4b1b162b68e4f4ca9 · jshank/bwalink · GitHub) with me so I was able to get the addon running however it doesn’t seem to be doing anything. The logs just say

[06:09:41] INFO: Starting BWALink addon...
[06:09:41] INFO: Setting addon timezone to America/Chicago based on the system timezone.
[06:09:42] INFO: Starting mqtt bridge connecting tcp://192.168.1.163:8899/ to mqtt://core-mosquitto:1883

no matter how many times I refresh. I expected something in MQTT Explorer as I’m subscribed to homie/# but nothing there. I have the Serial Port & Communication Port settings of the Elfin-EW11 set to your spec. I tried reversing the RS485 A and B wires but after a couple minutes my hot tub had a communication error so switched it back.
Another thing to note is that in the Elfin web interface Status section there are 0 bytes being sent so maybe MQTT has no data to work with?

@jshank Thanks for all the time and effort that you’ve put into this! Just about to pull the trigger and order the require parts. My tub is very similar to yours. However, a small question: You mentioned a media box / pocket. I’m assuming that’s for if you have a tub with speakers? Mine doesn’t, and I don’t see any additional boxes or pockets where it would make sense to put the wifi device. Should I get a waterproof enclosure for it then?

Yep, I do and that’s where I keep it. I’d get something fairly weatherproof, the Elfin isn’t waterproof.

I was able to fit mine behind a corner trim piece between the insulation and the bracket that holds the trim in place. That way if I need to service the Wi-Fi adapter I only have to undo two screws and remove the trim to access. The cable I connected to was long enough. Is it water proof, no, but I’ve never had an issue with moisture in that spot. I have a vita spa, but it looks similar in construction to a Sinclair, so maybe all you need to do is remove a corner trim piece.

Has anyone been able to read out data from GS510DZ and vl801 display by the display cable ?
I have build the PCB from magnusPers GitHub project, but having problem getting any reliable data out of it.

Hi all,

Some posts back I asked if anyone had this working with a Balboa GS523DZ with a VL801D panel.
The UK weather has been so poor I have only just managed to build and try the code and setup on this link:

https://github.com/Shuraxxx/-Balboa-GS523SZ-with-panel-VL801D-DeluxeSerie–MQTT

I’m delighted to advise it worked 1st time and I now have control and monitor of the hot tub working via MQTT into home assistant.

I need to do a better dashboard but for now can confirm all functions seem to work except the spa heater status icon. More to investigate on this one.

School boy error mounting the D1 mini not leaving enough clearance for the USB plug so notched the board as a simple quick fix.

The inside panels of my Hot Tub have foil shielding which dropped the wifi signal but still good enough to maintain a connection.

I’m now going to focus on working on the most efficient method of heating the Spa at lower cost tariff times etc… Also do some experiments dropping the temperature a deg or so and just remotely increase set temp prior.

Very interested in any thoughts on this and how people optomised the energy use.

Thanks.

This might help someone with the same set up of the GS510DZ with the panel VL801D

Hi all, I’m a little late to the party here and I need a little guidance (well actually, probably a lot of guidance!!). I am not from a coding background so a lot of this is very new to me, I sort of get the basics but that’s about it. I am an electrical engineer and was in the process of putting together a solution to remotely control my hot tub via a PLC controller and a few contactors and relays etc when I came across this guide. I work with Modbus devices on a regular basis at work so I was very excited to find the hot tub communicates via RS-485 as if I can get it working I would be able to have much better control and more options when it comes to the energy saving strategy I am wanting to implement.

I have been trying to follow the guide and decided to go down the V1 route as I had an old Pi1 and a usb WiFi adaptor lying around back from when I used them to run Kodi. Everything was going well until I got to to the bwa_mqtt_bridge.service, I cannot get it to run, I keep getting the following error -

Job for bwa_mqtt_bridge.service failed because the control process exited with error code.
See “systemctl status bwa_mqtt_bridge.service” and “journalctl -xeu bwa_mqtt_bridge.service” for details.

When I run systemctl status bwa_mqtt_bridge.service I get the following

● bwa_mqtt_bridge.service - Balboa Spa MQTT Bridge
Loaded: loaded (/etc/systemd/system/bwa_mqtt_bridge.service; enabled; preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Tue 2024-08-27 23:15:26 BST; 2s ago
Process: 3315 ExecStart=/usr/local/bin/bwa_mqtt_bridge mqtt://MY USERNAME:MY PASSWORD@MY Pi’s IP ADDRESS:1883/ /dev/ttyUSB0 (code=exited, status=217/USER)
Main PID: 3315 (code=exited, status=217/USER)

From what I have googled it looks to be an issue with the user not being found or something, I can see the service also fails while the Pi is booting up so I am assuming its a local issue on the Pi and not on the MQTT Broker end? I have tried various username and password combinations but nothing is working. This might be a very simple fix but I am stumped, I’ve been working on it on and off for about 2 days now and still no further towards a solution so I am throwing myself at your mercy

Well it looks like I managed to sort it, I merely had to change the user to the user I logged into the Pi with and it seemed to work.

Thank you to everyone that contributed to this project

Now I need to turn my attention to transposing the controls strategy I was going to use into Node-Red. The basics of it are as follows

  • Set HT to run at 26c when not in use (ie through the week)
  • Schedule from Google Calendar to set HT to target temp for use
  • Implement weather compensation to set target temp based on local ambient temp
  • Off/On/Auto selector switch, selecting On reverts back to Auto after 48hrs
  • Override to adjust target temp that resets at midnight
    I saw further up the thread that someone had set a ‘ready in X hours’ input up, I really like that idea so will try to integrate that too

The next piece of the puzzle for the HT is to monitor the energy consumption so I can fine tune the controls strategy for maximum efficiency, I had intended to use a 0-10v split CT, I just need to work out how to integrate that into the Pi and then pull that into HA or Node-Red

And last but not least I have found a water monitor that measures PH etc that has a modbus output, if I could also integrate this that would be idea, as I could set alerts up to stay on top of the chemicals

Paul, welcome to the club :slightly_smiling_face:

Some interesting ideas you have.

From my side (With the esp8266) approach it has worked flawless since installation. Only this last week I have seen a few random changes in the spa set temperature value via mqtt. I’ve not resolved the reason why but for some reason older backups of HA do not seem affected. Anyway…

I’ve implemented a number of your ideas. For me I tend to use the Tub every day due to back pain which it helps with. I therefore tend to keep the tub at 37 Deg C and heat to 38 before use. It’s quite a quick heat up for one degree but you can see a general reduction in energy use over time.
The time to heat up function works well. I had to tune config to match accurate times - easy to be fair.
I like the idea of the weather compensation, will look into this.
I purchased a low cost Tuya device that clamped around the live connection which gives me a wireless power / current / energy usage that is quite accurate. It gives a good daily look at tub energy.
From an automation perspective I have one that alerts me if the temperature set level <37 Deg or >38.5 Degrees. It’s come into use a few times when someone has accidently changed the temperature putting the lid down.
I’m looking at my Electricity tariff and wondering if one of the lower cost kWh rates overnight would allow me to take advantage of a higher heat-up that would decay during the day. The tub is quite well insulated to tends to not lose too much heat when the cover is on.
It’s definitely on of the ‘best’ HA projects I’ve added.
Cheers

1 Like