DanielNagy / astralpool_halo_chlorinator

Home Assistant custom component to interface with Astra Pool Halo pool chlorinators
MIT License
11 stars 1 forks source link

Error trying to connect #1

Closed shanelord01 closed 8 months ago

shanelord01 commented 8 months ago

Logger: aiohttp.server Source: /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py:421 First occurred: 4:46:27 PM (18 occurrences) Last logged: 5:09:43 PM

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request resp = await request_handler(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 543, in _handle resp = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 114, in impl return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 233, in auth_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware response = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 149, in handle result = await handler(request, request.match_info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 63, in with_admin return await func(self, request, *args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 177, in post return await super().post(request, flow_id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper result = await method(view, request, data, args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post result = await self._flow_mgr.async_configure(flow_id, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 320, in async_configure result = await self._async_handle_step( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 416, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/astralpool_halo_chlorinator/config_flow.py", line 67, in async_step_halo_bluetooth_confirm manufacturer_data = self._discovery_info.manufacturer_data[1095]


KeyError: 1095
DanielNagy commented 8 months ago

Key error 1095 is because the Bluetooth proxy device is not providing the manufacturer data (1095) from the BLE advertisement.

Assuming you are using esphome BLE proxy, power cycle the esphome proxy device.

Also upgrade to latest firmware of esphome if not already.

Also try bringing the BLE proxy closer for the pairing process. Once paired, we don't need the manufacturer data.

If you are not using a esphome Bluetooth proxy device, and using a usb or onboard raspberry pi Bluetooth, then you'll likely be experiencing the dbus / bluez bug that I experienced early when developing.

Unfortunately other than erroring out with a gui message saying it can't see the advertisement data, there's no other things I can do.

shanelord01 commented 8 months ago

If you are not using a esphome Bluetooth proxy device, and using a usb or onboard raspberry pi Bluetooth, then you'll likely be experiencing the dbus / bluez bug that I experienced early when developing.

Thanks. I am trying to use the onboard Bluetooth of my HA Yellow. I do have an ESP32 that I can try.

Do you have instructions on how to set this up?

DanielNagy commented 8 months ago

With the esp32 directly connected to your PC, goto this webpage.

https://esphome.io/projects/index.html

Select "Bluetooth proxy", and "Generic esp32"

Then connect and flash, once flashed, you can continue to follow the instructions to get the Bluetooth proxy onto your wifi, and then finally to connect / adopt into your home assistant.

Once you've done that, you can then move the esp32 anywhere and power it by usb / phone charger.

Once you've paired your halo, you should be able to use the onboard BLE of your yellow. As mentioned earlier, the manufacturer data 1095 is only required for pairing.

shanelord01 commented 8 months ago

OK. Up and running with a Bluetooth proxy. Not all sensors showing data yet but I’ll keep an eye on it.

Awesome work.

DanielNagy commented 8 months ago

Show me a screenshot of what you have. Also give me description of your current setup, do you have PH Sensor? ORP sensor? Acid Doser?

shanelord01 commented 8 months ago

Seems to be filling out. Yes I have the full kit. All sensors, Viron variable speed pump and halo lite 2.

IMG_1477 IMG_1478

shanelord01 commented 8 months ago

OK everything unknown is now filled out. All good.

Happy to help test any additions (lights etc) you may develop.

DanielNagy commented 8 months ago

Ok, keep an eye out on that unknown. You should have all or nothing, because upon connection it requests everything, so it should get everything as per when you connect your mobile app it says synchronising.

If it keeps coming back randomly as unknown, you've got BLE proxy connectivity issues, and recommend moving the esp32 closer to the halo if it's far away.

If you went back to the yellows BLE, try and disable it and use the esp32 only.

I've had someone have all sorts of issues reach out to me due to BLE connectivity issues which were related to an old esphome firmware version, and outdated BLE proxy configuration. But since you used that web page to flash, that shouldn't be an issue.

DanielNagy commented 8 months ago

Happy to help test any additions (lights etc) you may develop.

My next steps are to remove the noise based on the configured halo sensor configuration. Ie, if you don't have ORP sensor, remove ORP details, same with acid dozer and PH sensor.

Then it will be lights and heater control.

It already displays heater details if you have a connected heater.