home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.58k stars 29.91k forks source link

Omnilogic integration gets Unexpected error fetching Omnilogic data: syntax error: line 1, column 0 #72637

Closed sddgit closed 1 year ago

sddgit commented 2 years ago

The problem

I’m getting the following in the log. After this, all sensors become unavailable for a short time, presumably until the next poll:

Logger: homeassistant.components.omnilogic.common
Source: components/omnilogic/common.py:47 
Integration: Hayward Omnilogic (documentation, issues) 
First occurred: 10:38:05 AM (21 occurrences) 
Last logged: 4:11:37 PM

Unexpected error fetching Omnilogic data: syntax error: line 1, column 0
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 191, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/components/omnilogic/common.py", line 47, in _async_update_data
    data = await self.api.get_telemetry_data()
  File "/usr/local/lib/python3.9/site-packages/omnilogic/__init__.py", line 974, in get_telemetry_data
    config_data = await self.get_msp_config_file()
  File "/usr/local/lib/python3.9/site-packages/omnilogic/__init__.py", line 228, in get_msp_config_file
    configitem = self.convert_to_json(mspconfig)
  File "/usr/local/lib/python3.9/site-packages/omnilogic/__init__.py", line 1048, in convert_to_json
    my_dict = xmltodict.parse(xmlString)
  File "/usr/local/lib/python3.9/site-packages/xmltodict.py", line 327, in parse
    parser.Parse(xml_input, True)
xml.parsers.expat.ExpatError: syntax error: line 1, column 0

I think my Hayward controller is running firmware V4.4.0.

If I may, I also have a few other queries:

  1. Will this integration handle multiple pools under the same account? Does it just return all the sensors prefixed by the second pool’s name, as set up in the account?
  2. What is the polling interval? Can this be changed?
  3. In the setup for my Hayward system, there is a “Backyard” section, separate from the main body of water - the pool. I have things like a pond filter and aerator in there, but they don’t show up in HA. Any idea why?
  4. I’ve read that a local API is documented with the information provided under NDA. Are there any plans for getting this to work instead of/as well as the cloud API?

Thanks for the great Integration. Looking forward to getting more out of my Hayward system, including getting it to automatically switch schedules based on a solar forecast.

What version of Home Assistant Core has the issue?

2022.5.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Omnilogic

Link to integration documentation on our website

https://www.home-assistant.io/integrations/omnilogic/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

probot-home-assistant[bot] commented 2 years ago

omnilogic documentation omnilogic source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

Hey there @oliver84, @djtimca, @gentoosu, mind taking a look at this issue as it has been labeled with an integration (omnilogic) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

sddgit commented 2 years ago

@djtimca Sorry to hassle, but is there any chance you could take a look at this? I just can’t use the integration at present. Thank you.

djtimca commented 2 years ago

Not sure on the XML issue. Will be related to our API to Hayward which I will have some updates for in the coming week or so which will be incorporated into the custom integration.

For your questions:

  1. Yes will handle multiple pools on one account using naming.
  2. I can't remember how it is set in core for polling. On the custom integration it is 6 seconds default and can be configured.
  3. Core doesn't have all platforms integrated (like relays, valves, pumps, water heaters etc) so those additional features won't be available. You would need the custom integration for those.
  4. I have seen the local API doc. Unfortunately we got it after the core API integration was built. At some point I would look at it, but that will require a lot more time than I have at the moment since the cloud integration is working well.

I am no longer personally working to extend the core integration so any future improvements to core will need to come from another member of the community.

You can get the custom integration by adding https://GitHub.com/djtimca/haomnilogic as a custom repo in HACS and installing from there. I expect that integration will continue to have a fair bit of development (including API fixes that might help with the XML problem you have).

sddgit commented 2 years ago

Thank you very much for that detailed response.

Oh, I didn’t realise the custom version was available already. I’ll certainly give that a try and report any issues on that repo. Thank you for all your efforts.

github-actions[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.