Try using NRF Connect to scan for the bluetooth address then look for that in the Diagnosis file
@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:
- publish to HACS
- add read/write controls
- improve stability
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
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.
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
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
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
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.
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.