cryptk / haomnilogic-local

A Home Assistant integration for Hayward OmniLogic/OmniHub pool controllers using the local UDP api
Apache License 2.0
18 stars 4 forks source link

Unable to add Omnilogic local #84

Open srivers12 opened 5 months ago

srivers12 commented 5 months ago

Installed the custom repository. Then when trying to install the interface I am getting an unexpected error. Have been trying to figure out the issue but not obvious (I am low level). Here is a link to the data obtained so far.

Data

cryptk commented 5 months ago

It looks like your controller isn't responding to the request. If you are sure the IP address is correct, try completely powering down your controller and the powering it back on. We have seen controllers get into a state where they refuse to talk to anything over the local API and it requires a power cycle to snap them out of it.

lurgh commented 5 months ago

I will jump in since I looked at @srivers12's traces when I was trying to help out in the HA forum thread. The wireshark traces they posted were split into two, one trace for each direction, so you need to scroll down a bit in their document to find the second (response) trace. When taken together it looked to me like the MSP was responding; the MSPConfig block and the (compressed) telemetry both are there in the 2nd trace, in frames 2-40 and frame 42, respectively. Seemed to me that something in processing the telemetry response was causing an exception.

srivers12 commented 5 months ago

I tried the power cycle of the controller. Unfortunately same error as previous. Not sure how best to look for an exception. Likely debugging but I am not good at turning that one on / reviewing.

meow4agreencard commented 1 month ago

I'm getting the same error. I'm willing to spend time to troubleshoot a little bit. These are the errors that I'm getting:

2024-05-31 23:02:49.338 ERROR (MainThread) [custom_components.omnilogic_local.config_flow] Unexpected exception: Failed to parse Telemetry: 10 validation errors for Telemetry ColorLogic-Light -> 0 -> @specialEffect field required (type=value_error.missing) ColorLogic-Light -> 1 -> @specialEffect field required (type=value_error.missing) VirtualHeater -> 0 -> @SolarSetPoint field required (type=value_error.missing) VirtualHeater -> 0 -> @Mode field required (type=value_error.missing) VirtualHeater -> 0 -> @SilentMode field required (type=value_error.missing) VirtualHeater -> 0 -> @whyHeaterIsOn field required (type=value_error.missing) VirtualHeater -> 1 -> @SolarSetPoint field required (type=value_error.missing) VirtualHeater -> 1 -> @Mode field required (type=value_error.missing) VirtualHeater -> 1 -> @SilentMode field required (type=value_error.missing) VirtualHeater -> 1 -> @whyHeaterIsOn field required (type=value_error.missing) Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/pyomnilogic_local/models/telemetry.py", line 237, in load_xml return Telemetry.parse_obj(data["STATUS"]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pydantic/main.py", line 526, in parse_obj return cls(**obj) ^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pydantic/main.py", line 341, in __init__ raise validation_error pydantic.error_wrappers.ValidationError: 10 validation errors for Telemetry ColorLogic-Light -> 0 -> @specialEffect field required (type=value_error.missing) ColorLogic-Light -> 1 -> @specialEffect field required (type=value_error.missing) VirtualHeater -> 0 -> @SolarSetPoint field required (type=value_error.missing) VirtualHeater -> 0 -> @Mode field required (type=value_error.missing) VirtualHeater -> 0 -> @SilentMode field required (type=value_error.missing) VirtualHeater -> 0 -> @whyHeaterIsOn field required (type=value_error.missing) VirtualHeater -> 1 -> @SolarSetPoint field required (type=value_error.missing) VirtualHeater -> 1 -> @Mode field required (type=value_error.missing) VirtualHeater -> 1 -> @SilentMode field required (type=value_error.missing) VirtualHeater -> 1 -> @whyHeaterIsOn field required (type=value_error.missing) The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/config/custom_components/omnilogic_local/config_flow.py", line 105, in async_step_user await validate_input(self.hass, user_input) File "/config/custom_components/omnilogic_local/config_flow.py", line 51, in validate_input telemetry = await omni.async_get_telemetry() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyomnilogic_local/models/util.py", line 43, in wrapper return pydantic_type.load_xml(resp_body) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyomnilogic_local/models/telemetry.py", line 239, in load_xml raise OmniParsingException(f"Failed to parse Telemetry: {exc}") from exc pyomnilogic_local.exceptions.OmniParsingException: Failed to parse Telemetry: 10 validation errors for Telemetry ColorLogic-Light -> 0 -> @specialEffect field required (type=value_error.missing) ColorLogic-Light -> 1 -> @specialEffect field required (type=value_error.missing) VirtualHeater -> 0 -> @SolarSetPoint field required (type=value_error.missing) VirtualHeater -> 0 -> @Mode field required (type=value_error.missing) VirtualHeater -> 0 -> @SilentMode field required (type=value_error.missing) VirtualHeater -> 0 -> @whyHeaterIsOn field required (type=value_error.missing) VirtualHeater -> 1 -> @SolarSetPoint field required (type=value_error.missing) VirtualHeater -> 1 -> @Mode field required (type=value_error.missing) VirtualHeater -> 1 -> @SilentMode field required (type=value_error.missing) VirtualHeater -> 1 -> @whyHeaterIsOn field required (type=value_error.missing)

cryptk commented 1 month ago

@meow4agreencard can you please download the diagnostic data from the integration and provide it here?

meow4agreencard commented 1 month ago

@meow4agreencard can you please download the diagnostic data from the integration and provide it here?

Not sure how to, given that I can't get through the initial setup window. image

cryptk commented 1 month ago

Can you give me any information at all about your light and heater setup? What model of light, what kind of heater, etc?

meow4agreencard commented 4 weeks ago

Can you give me any information at all about your light and heater setup? What model of light, what kind of heater, etc?

Missed your response. Sure, here's what I know. I assume you're looking for both the physical setup as well as the app capabilities: Lights - I can't figure out the HW model. The previous owner doesn't know either. I have 2 lights: one for spa, one for pool. The pool light settings in the app are more advanced: I can set the speed, brightness and light color or preset. The spa lights don't have the speed or brightness options. They have an option to "Sync Lights", but I'm not sure what it does. The pool lights don't have a sync option. Heater - Hayward H400FD connected to an automatic valve that allows to heat either the spa or the pool. Meaning in the app I have a "Heater" option for the Spa and the Pool, but technically it's one unit.

cryptk commented 4 weeks ago

@meow4agreencard if you know how python virtualenvs work, you should be able to follow these instructions to get me the data I need:

python -m venv venv
source venv/bin/activate
pip install python-omnilogic-local
OMNILOGIC_HOST=<SOME_IP_ADDRESS> OMNILOGIC_RAW=True omnilogic

Make sure to replace with the IP address of your omnilogic controller, so the last line would be something like

OMNILOGIC_HOST=192.168.1.28 OMNILOGIC_RAW=True omnilogic

This should print out some debug logging as well as some XML data. Can you please attach a file with the XML data to this issue?

meow4agreencard commented 3 weeks ago

omnilogic_local_log_with_XML.txt @cryptk here you go. I wasn't sure if the initial few lines of debug logs were important, so I included them even though you only asked for the XML. I hope that's not an issue.

cryptk commented 3 weeks ago

Awesome, it will take me a few days to have some time to work on it, but that is everything I should need to get the integration working with your pool.

I should probably wrap that up into a docker image or something that people can run to pull diagnostics... and maybe make a proper CLI for it...