Viron Astral Pool ChlorinatorGo integration

It has been, and continues to be…
Honestly, reverse engineering the protocol, and writing an interface in python for it was the easy bit.
Writing a HS custom component has been a battle!

1 Like

isn’t it as easy as “ChatGTP give me the code for a HomeAssistant custom component to control and manage an Equalibrium pool controller over bluetooth”
:rofl:

OK, here’s a first hack.
It’s rough round the edges, a bit funny on the entity naming, not published to HACS so you’ll have to install manually, lacks any kind of error handling, has ugly state strings reported on sensors, you get the idea.

And if you want to have a peek at the chlorinator API:

Let me know how you get on!

1 Like

Have just installed the files from GitHub - pbutterworth/astrapool_chlorinator and now waiting for it to pop up in my integrations… will keep you updated and post some results

@pbutterworth waited about an hour and had no discovery. I attempted to add an integration manually by using the + Add Integration button. I searched Pool where i found the below


I am presuming the Astral Pool Vision… is yours as it was not there before.
I clicked to add it and the below came up

I then tried to open the documentation to which the below appeared

I did also re-read the github instructions, but coulld not find any mention of yaml config…

OK, good stuff - I would have fallen out of my tree if it worked first time.
So, you can’t configure this component in the configuration.yaml file. You need to wait for it to be discovered.
In order for it to be discovered, a bluetooth adapter connected to HA needs to receive a BLE advertisement using the service UUID 45000001-98b7-4e29-a03f-160174643001

I’m using a ESPHome device as a proxy, since my Raspberry Pi is out of range of the chlorinator. Looks like this in HA:
image
The built in bluetooth adapter looks something like this:
image
As far as I know it’s fine to have both.

The other thing that might help is after you have started up HA and run it for 5 mins or so, it would be worth downloading the log file and having a look in there.

P.S: Once HA has fully started up, discovery should only take a few seconds. No need to wait ages.

Maybe add this line to your configuration.yaml:

bluetooth:

Don’t know if it is needed, but I have it in mine.

im excited, Just need to fix my pool then i can test this bad boy out lol

I’ve installed everything, double checked. No banana yet.

My RPi is 12m from my chlorinator. BT adapter is running.

@xarmoda, would you mind starting up HA and leave running for ~5 mins and then grabbing the log and sending it to me?

sure!

So, if the device isn’t getting discovered, then the problems are confined to:

  • the custom component isn’t getting loaded at all (should be able to tell from the log)
  • bluetooth not working for some reason
  • everything is working, but the chlorinator uses a different service UUID to mine

I know for sure @Mikkaat’s UUID is the same as mine (Viron Astral Pool ChlorinatorGo integration - #13 by Mikkaat). @xarmoda, you may wish to install “nRF Connect” on you phone and look to see what your chlorinator is advertising (and for that matter, what the signal strength is like where your HA bluetooth adapter is located).

1 Like

This is the kind of stuff we want to be seeing in the log file:

2023-03-20 09:28:03.946 INFO (MainThread) [homeassistant.setup] Setting up bluetooth
2023-03-20 09:28:10.224 INFO (MainThread) [homeassistant.setup] Setup of domain bluetooth took 6.3 seconds
2023-03-20 09:28:52.172 INFO (MainThread) [homeassistant.setup] Setting up bluetooth_adapters
2023-03-20 09:28:52.173 INFO (MainThread) [homeassistant.setup] Setup of domain bluetooth_adapters took 0.0 seconds

if you are using a ESPHome proxy:

2023-03-20 09:28:53.690 INFO (MainThread) [aioesphomeapi.reconnect_logic] Successfully connected to esp32-bluetooth-proxy-15185c @ 192.168.1.54

roger that. i was thinking maybe the fanless case i have on my RPi might interfere with the BT range.


seems fine.

@xarmoda, interesting. -89 dBm is borderline. -100 it’s amazing your phone was able to detect that at all.
Probably a huge PITA, but you could experiment with temporarily locating your RPi somewhere optimal.

Another line of enquiry to follow:
In your bluetooth adapter device:
image
Hit the download diagnostics button:
image

Within, you can search for what devices your bluetooth adapter has discovered:

          "discovered_devices_and_advertisement_data": [
            {
              "name": "POOL01",
              "address": "EF:1B:FD:4A:38:44",
              "rssi": -85,
              "advertisement_data": [
                "POOL01",
                {
                  "1095": {
                    "__type": "<class 'bytes'>",
                    "repr": "b'\\x01\\x04\\x00\\x01\\x00\\x00\\xaa\\x10QK\\x8c\\xd8\\xb0e\\x05\\t\\x01\\x02\\x02\\x00'"
                  }
                },
                {},
                [
                  "45000001-98b7-4e29-a03f-160174643001"
                ],
                -127,
                -85,
                []

P.S. My RPi doesn’t have a remote chance of being in range.
I use an ESP32 board, configured with ESPHome bluetooth proxy.

Disclaimer: I have never tested connecting with the RPi built in bluetooth.

1 Like

will test RPi on bench in full view of filter. my pool filter is literally only 10m away from the cabinet where i keep my HA RPi. albeit behind a brick wall, and as mentioned I have a fanless case that is effectively a huge chunk of aluminum. so who knows.

one of the first things i looked at was the bluetooth diagnostics. couldn’t see anything interesting in it at all.

Apologies for the delay in my response, have been extremely busy with family stuff.

I have not added the bluetooth: to my config (yet, unless you tell me to after this information…) as I already have the bluetooth integration successfully running with a SwitchBot.

I have just downloaded the diagnostics .txt file as you have described above and can see my chlorinator in the file and can even see the UUID you have mentioned.

          "/org/bluez/hci0/dev_D5_7D_B7_06_22_D0",
          {
            "Address": "D5:7D:B7:06:22:D0",
            "AddressType": "random",
            "Name": "POOL01",
            "Alias": "POOL01",
            "Paired": false,
            "Trusted": false,
            "Blocked": false,
            "LegacyPairing": false,
            "RSSI": -85,
            "Connected": false,
            "UUIDs": [
              "45000001-98b7-4e29-a03f-160174643001"
            ],
            "Adapter": "/org/bluez/hci0",
            "ManufacturerData": {
              "1095": {

The integration is still not auto discovered and I am still not able to add manually. Happy to DM you my whole txt file if you want.

Next step for me is to add the bletooth line then create a bleutooth proxy device.

Will keep you updated.

thanks

m

@pbutterworth Update:

I have configured and added a bluetooth proxy to my environment. No chlorinator discovered after 30 mins. Checked the diagnostics file again and it looks the same.
I have added bluetooth: to my configuration.yaml file, rebooted, waited another 30 mins and no chlorinator discovered. Checked the diagnostics file again and it looks the same.

Screenshot of my ESPHome Logs for the bluetooth proxy esp32 device (MAC and SSID blanked out)

I have also tried to add the integration manually with the same result as before.

The ESP is sitting within one foot of the chlorinator. I will leave this running all night to see if it discovers…