ccutrer / balboa_worldwide_app

Ruby library for communication with Balboa Water Group's WiFi module or RS-485
92 stars 27 forks source link

Using with BWALink in Home assistant #77

Closed mobiusmat closed 1 year ago

mobiusmat commented 1 year ago

Hi Team - I've got a Elfin EW10 all linked up and working and then I'm attempting to fire BWALink to link my Spa to MQTT but I'm getting these errors reported by Balboa Worldwide App. The log is below - I've seen talk of someone changing the status length to 27 and that fixed it for him but it appears its now set to accept anything from 24 to 32 if I'm interpreting things in status.rb correctly? Below is the message I get back. Any help greatly appreciated.

_#BWA::Messages::ConfigurationRequest D, wrote: 7e 05 0a bf 04 77 7e D, discarding invalid data prior to message bf 06 5c 7e 7e 01 00 bf 07 5b 7e D, discarding invalid data prior to message 7c 05 10 bf 07 5b 7e D, discarding invalid data prior to message 7e 05 10 3f 07 5b 7e D, discarding invalid data prior to message 7c 05 10 bf 07 53 7c D, discarding invalid data prior to message 7e 01 00 bf 07 5b 7e D, read: 7e 1c ff af 13 00 00 4c 15 1d 00 00 01 03 05 0c 00 00 02 00 00 00 00 00 00 4c 00 00 85 7e /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.4/lib/bwa/message.rb:78:in `parse’: Unrecognized data length (28) for message BWA::Messages::Status (BWA::InvalidMessage)

from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.4/lib/bwa/client.rb:65:in block in poll’* from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.4/lib/bwa/client.rb:64:inloop’ from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.4/lib/bwa/client.rb:64:in `poll’ from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.4/exe/bwa_mqtt_bridge:33:in block in initialize’* from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.4/exe/bwa_mqtt_bridge:32:inloop’ from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.4/exe/bwa_mqtt_bridge:32:in `initialize’ from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.4/exe/bwa_mqtt_bridge:421:in new’* from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.4/exe/bwa_mqtt_bridge:421:in<top (required)>’ from /usr/bin/bwa_mqtt_bridge:25:in `load’ from /usr/bin/bwa_mqttbridge:25:in `’* 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

mobiusmat commented 1 year ago

I took the cover off the spa to take a look as I only had a photo of the board layout side of the controller lid. So its called a Colossus. Part number 56205 or SIBP2P.

There is a Wifi ready logo on the control pad which from what I've read should make it compatible with this code unlike some of the earlier models? The board did have a manufacture date of 2011

mobiusmat commented 1 year ago

So going further here I looked at the wiki on what the messages mean and what I'm receiving in a status message from my Balboa is bang on - The Date / Time are perfect. The Set Temp matches the current temp but I haven't followed up how the scale works but it appears I'm getting data. I changed the message length in status.rb from

MESSAGE_LENGTH = (24..32).freeze

to MESSAGE_LENGTH = (23..32).freeze and the app stays running but just seems to endlessly be giving either

D, discarding invalid data prior to message 7c 05 10 bf 07 5b 7e

or

D, read: 7e 08 0a bf 22 02 00 00 89 7e I, from spa: #<BWA::Messages::ControlConfigurationRequest 1>

Is part of my issue that I've plugged it into an empty keypad socket on the board rather than a splitter cable meaning I need a more complex Configuration setup of the fake keypad instead of just pretenting to be the existing configured keypad? If so I'll try and order the Y splitter cable as mine didn't have one.

Or is it that my software version is slightly different - My keypad has a "Wifi Enabled" picture but the keypad is a TP800 where my mainboard/box is a Colossus which seemed to come paired with a TP700 - Does this mean my controller isn't actually supported by the BWA wifi module??

Any help on what direction I need to be looking into to get this going would be greatly appreciated as it feels like I'm so close and yet so far.

mobiusmat commented 1 year ago

Wow - I've been banging my head on a wall for at least an hour a day in free time trying to resolve this. Turns out I'm a moron who can't read (Or I got poor search results). Turns out I ended up with an EW10 (Which I didn't notice as I wrote that) and EW10 is the RS232 version - Not the EW11 which is RS485 so now my EW11 is on its way - At least I have the connectors already and all the wiring is done. That explains why I seem to be getting real data but its not being recognised correctly - I was reading blocks that had the correct date and time - I guess I need to learn the difference between RS232 and RS485 to better understand what was happening. Not sure if I blame tiredness when ordering or bad search results on Aliexpress (Happens a bit) but either way I should have figured it out by now.