Closed loictinant closed 4 days ago
Ultimately I'm not sure how Culligan devices interact. I don't know if they are regional or not. I added a region selector because the underlying Ayla API has different endpoints for certain EU devices.
You can try:
Currently, the sign in code doesn't pass the EU bool to Ayla.
It doesn't change anything by activating EU or other. And how to activate the journal since I can't activate it?
Enregistreur: custom_components.culligan Source: custom_components/culligan/config_flow.py:94 intégration: Culligan (documentation, problèmes) S'est produit pour la première fois: 12:10:26 (2 occurrences) Dernier enregistrement: 12:10:39
Unexpected exception Traceback (most recent call last): File "/config/custom_components/culligan/config_flow.py", line 94, in validate_input await culligan.async_sign_in() File "/usr/local/lib/python3.12/site-packages/culligan/uniapi_culliganiot.py", line 158, in async_sign_in self._set_credentials(resp.status, await resp.json()) File "/usr/local/lib/python3.12/site-packages/culligan/uniapi_culliganiot.py", line 120, in _set_credentials self._ayla_access_token = login_result["data"]["linkedAccounts"]["ayla"]["access_token"]
KeyError: 'ayla'
You can try v1.3.5-beta1 and see what debug/error messages are different.
Unknown error occurred or The username field must be an email address, even though I entered my email address correctly.
There is a regex that is supposed to capture most valid email addresses. You can test to see if this regex is not validating your email and let me know what is missing.
sorry I didn't understand what to do (I'm French)
Try in Python to see if your email matches. Replace "emailaddress@email.com" with your email.
I would start removing characters in your email address until the regex says your email matches. There will probably be a specific character that needs to be added to the regex, especially of the character is unique to other languages (e.g. accents or other markings).
I recreated an account with a Gmail email address (before it was Hotmail), and I managed to connect.
Now the integration finds nothing.
Enregistreur: homeassistant.config_entries Source: config_entries.py:635 S'est produit pour la première fois: 23:05:40 (1 occurrences) Dernier enregistrement: 23:05:40
Error setting up entry Culligan - for culligan Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 635, in async_setup_with_context result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/culligan/init__.py", line 111, in async_setup_entry if len(culliganiot_devices) > 0 and len(culligan_devices) > 0: ^^^^^^^^^^^^^^^^ UnboundLocalError: cannot access local variable 'culligan_devices' where it is not associated with a value
So what I just saw is weird.
My new email address already doesn't work anymore and the old one does. In fact, as soon as I add my softener to the app, I can't connect to the integration anymore.
Beta2
Enregistreur: homeassistant.config_entries Source: config_entries.py:635 S'est produit pour la première fois: 15:35:33 (1 occurrences) Dernier enregistrement: 15:35:33
Error setting up entry Culligan - for culligan Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 635, in async_setup_with_context result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/culligan/init__.py", line 111, in async_setup_entry if culliganiot_devices and culligan_devices: ^^^^^^^^^^^^^^^^ UnboundLocalError: cannot access local variable 'culligan_devices' where it is not associated with a value
I just noticed that if I remove the softener from my Culligan account, the connection goes through fine without any problems, but as soon as I add it back it crashes.
Gotcha, so something is happening when the integration queries for devices ... and the checks aren't working as expected.
If you have debug logging enabled, there should be a few lines of logs regarding: x num of devices, etc.. Do you have any of those debug logs?
Where can I find these newspapers?
Hi,
I got the same initial error and digged a bit into it. Several bugs remain:
"dsn": ", ".join(d.device_serial_number for d in devices)
various uninitialized variables:
Error setting up entry Culligan - for culligan
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 635, in __async_setup_with_context
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/culligan/__init__.py", line 111, in async_setup_entry
if culliganiot_devices and culligan_devices:
^^^^^^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'culligan_devices' where it is not associated with a value
Error while setting up culligan platform for button
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 365, in _async_setup_platform
await asyncio.shield(awaitable)
File "/config/custom_components/culligan/button.py", line 67, in async_setup_entry
if len(buttons) > 0:
^^^^^^^
UnboundLocalError: cannot access local variable 'buttons' where it is not associated with a value
Error while setting up culligan platform for switch
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 365, in _async_setup_platform
await asyncio.shield(awaitable)
File "/config/custom_components/culligan/switch.py", line 82, in async_setup_entry
if len(switches) > 0:
^^^^^^^^
UnboundLocalError: cannot access local variable 'switches' where it is not associated with a value
After that, the integration no longer fails, but no device/entity is present in HA. With the culligan
Python API though, I can access my device through get_devices()
, call update()
on it and read its properties just fine. Maybe my device is just not supported? https://github.com/rewardone/Culligan/blob/8bb06c2af7e22fbf9ad9d04bf77c36a520e6df60/src/culligan/uniapi_culliganiot.py#L349 -> you can probably add Smart Modernity
there (model now commercialized here in France).
A great point. If you have VS Code plugin or another way to edit code, you can modify this integration's supported classes and include the class from the library. It doesn't include the generic CulliganIoTDevice, which the device would possible be cast to.
If you can confirm that Smart Modernity is your device["name"], I'll get those changes added and we can test them.
@rewardone yes that's the name:
import culligan
c = culligan.CulliganApi(username, password, api_id)
c.sign_in()
print(c.get_devices()[0].name)
# Smart Modernity
I'll try to test this in the next few days, when I find the time.
I released beta3, which bumps the version for the Culligan library which now includes Smart Modernity. Fingers crossed for some progress :)
Oh by the way, I got a bunch of errors when trying culligan
with Python 3.9, due to https://github.com/rewardone/ayla-iot-unofficial relying on newer Python features (e.g. here -> Foo | None
for optional is a Python 3.10 feature), but culligan
is supposedly supporting Python 3.7.
I'll have to bump it. The Fujitsu code is an addon contributed by another member. It was added a year or so ago. I recommended that it not be part of Ayla and split off like Culligan was. That has not been done and it is now supporting a Core integration.
The culligan library shouldn't call any Ayla code unless the ["access_token"] is provided in the response from culligan, but from a requirements.txt perspective, Ayla is listed and probably pulled in/executed causes those errors.
From a HA perspective, I think < 3.10 is not supported anymore and they use 3.12 currently.
I released beta3, which bumps the version for the Culligan library which now includes Smart Modernity. Fingers crossed for some progress :)
I still had to fix the _dsn
+ culligan_devices
errors I explained above, but after that: it works! 🎉 1 device and 67 entities
🚀
Pushed beta4. I bumped Culligan again to add the _dsn property to the class. Someone is using Smart HE and didn't report the issues, so I'm cautious of breaking things. This should allow the existing join(_dsn) code to work.
Indented the button and switch to be within their respective loops.
Initialized the culligan_devices array.
Pushed beta4. I bumped Culligan again to add the _dsn property to the class. Someone is using Smart HE and didn't report the issues, so I'm cautious of breaking things. This should allow the existing join(_dsn) code to work.
Indented the button and switch to be within their respective loops.
Initialized the culligan_devices array.
It seems to be working, kudos 👍 Thanks a lot!
Thank you very much, everything works.
Hello,
I can’t connect, I get a “Something unknown happened” error.
What should I do?