Viron Astral Pool ChlorinatorGo integration

Try using NRF Connect to scan for the bluetooth address then look for that in the Diagnosis file

i did. cant seem to resolve/see a recognizable address.

@xarmoda, OK, good news. That Service UUID 45000001ā€¦ is the same as the eq units. This is the number that HA knows to look for to decide whether to set up the custom integration (see manifest.json).

Search for that number (45000001) in the in the diagnostics file. I have this:

          "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,
                []
              ],
              "details": {
                "source": "cc:db:a7:15:18:5c",
                "address_type": 1
              }
            },

And/or send me you home-assistant.log file and that might reveal some other issues.

So, thereā€™s a list a mile long of things to improve.

  • Stability: thereā€™s no error checking anywhere. This could be causing a lot of the unavailable states. Thereā€™s some off-the-shelf stuff to improve ble connectivity reliability which I should probably get in there too.
  • Read/write: My aim was to get something working end to end. Now that thatā€™s done, I can expand the API to do some of the other features of the chlorinator. Not sure I will ever be bothered with timer settings, lighting, spa or any of that. Iā€™d like to control the mode, set points and acid dosing controls.
  • Publish to HACS: This would allow me to publish updates, and you would get a nice notification saying thereā€™s a new version, making everyoneā€™s life a lot easier.

Iā€™m thinking of going in this order:

  1. publish to HACS
  2. add read/write controls
  3. improve stability
2 Likes

OK, new version is up (0.1.6) which includes a selector for the mode (off/auto/manual).
You should now be able to fetch this via HACS as a custom repository:

Open HACS
image

Choose Integrations

Open the overflow menu (top-right) and choose Custom repositories

Type in pbutterworth/astrapool_chlorinator
Select Integration
Click ADD

The rest should be reasonably self-explanitory.

1 Like

Thank you @pbutterworth.

Just to also add (clarify for myself). I presume removal of the files we manually added is also required? or will this new HACS version just go over those files?

Just added the HACS repo and updated without removing the old version and it is working fineā€¦

Thank you again for all your great work

@Mikkaat, is the mode selector working?

I will test it out a little moreā€¦ It seems to be a little sporadic. Sometimes the signal is received by the chlorinator, sometimes it is nowā€¦

When the signal is received, it will update the chlorinator to the correct mode setting.

I will capture some screenshots and post them

@Mikkaat, I had a look at your log files. Seems to be predominantly failing when trying to connect.
Can you try updating your astralpool_chlorinator version to 0.1.7 and see if there is any change in the behaviour?

Have just updated the firmware on my Chlorinator and the app from the HACS repo (it just showed up now)ā€¦

I will allow it to run a while and let you know.

how does one upgrade the firmware

@sam43434
Open up HACS
image

Choose Integrations

Select Astral Pool Viron eQuilibrium Chlorinator (if you have already installed it. If you havenā€™t installed it yet, then a different process applies).

In the top-right menu, choose Redownload

Select the latest version in the dropdown, and click Download.

You will need to restart home assistant.

Wow, can I just say Iā€™ve been on home assistant for 5 years and never felt the need to postā€¦ until now!

This is a fantastic hack, Iā€™ve been looking to integrate the Chlorinator for a few years now, with the catch being that my EQ25 didnā€™t have bluetooth until last month when it died and I replaced the box. I had considered the Astral connect gateway, but it seemed overly expensive for an interface.

As Iā€™ve hacked my fair share of things into home assistant, this is not a small thing and the fact that you took the time to provide it into HACS to share it with us is great (looks for the buy him a coffee button).

Given Iā€™ve only just configured mine and it mostly working, I donā€™t have any feedback that can really assist just yet. If I find anything Iā€™ll be sure to post it!!!

Anyways massive thanks @pbutterworth

2 Likes

I wonder if the newer Astral Halo system has the same Bluetooth design and operation? Guess I should try this out and see. BLE looks very similar but last digit is 2 and not 1?

Hi @farsonic, Iā€™m fairly confident that pychlorinator wonā€™t talk to that service UUID.
But I had a look back in the decompiled android C# code and there is lots of this sort of thing:

					if (e.get_Characteristic().get_Uuid() == "45000002-98b7-4e29-a03f-160174643001")
					{
						val = GetCharacteristic("45000003-98b7-4e29-a03f-160174643001");
					}
					else if (e.get_Characteristic().get_Uuid() == "45000001-98b7-4e29-a03f-160174643002")
					{
						val = GetCharacteristic2("45000002-98b7-4e29-a03f-160174643002");
					}

Itā€™s deciding between two different protocols based on the service UUIDs. I havenā€™t dug any deeper.
If anyone is interested in extending pychlorinator to talk, Iā€™m happy to send through the decompiled C# code from the ChlorinatorGo app

ok, the App I use is totally different thoughā€¦

Looks like the app probably shares quite a bit of code with other app.

I wouldnā€™t think astral would reinvent the wheel, but interesting they released a new app of the halo system.

On a different topic, these unavailable sensors are annoying me, Iā€™m trialling a code fix (more bandaid) to retain the last value if the async_gatherdata return an empty dict. Iā€™ll let you know how I go over night, but I think Iā€™d want to put a limit of 5 reads and force it back to empty. its more for neatness of the sensors than anything, the root cause still looks to be the bluetooth stability.

Thoughts on how long the data is stale before it should be forced to unavailable? (5 reads is ~5mins)

Edit: Well it looks like every failure is related to the connection failing, Iā€™ll have a look tomorrow maybe how the error is handled

Yep - this is what iā€™ve found (at least with the HaloChlor model).

First off, nice work @pbutterworth at getting this going. It had never occurred to me to decompile the app and I was going to do the time to attempt to reverse engineer the protocol from bluetooth sniffing. Given the encryption, this would have failed - so very grateful you cracked the nut first.

Iā€™ve just got my development environment going, so hoping I can sort this out soon. Iā€™ve found (from the decompilation) that the HaloChlor uses a different secret key, but same encryption method. IT also uses a different handshake protocol to initiate the session (as you mention above), but overall it looks like the rest of the comms are similar. Iā€™ll try and get something working and post back here once Iā€™ve got more info.

But @DunkeyDaMonkey, it would be worth decompiling your app and seeing how it communicates with the unit.

1 Like

Iā€™m on the ChlorinatorGO app as everyone else on this thread as I have the astral EQ25. From my own integration I see a lot of data loss from the BT comms, so Iā€™m just looking into a bit of global error handling on the python side to reduce the or remove the data loss, 1 minute polling is great, but if the data is ā€œunavailableā€ 10% of the time, there will be times when Iā€™m viewing my dashboard an not be able to see the values. in those cases Iā€™d rather see the value from the last 5mins if its available.