DotEfekts / ElectroluxClimateComponent

Custom Component for Home Assistant to control Electrolux airconditioners
Apache License 2.0
13 stars 3 forks source link

Adding multiple devices #6

Closed dmcke5 closed 10 months ago

dmcke5 commented 10 months ago

Hi, thanks for the fantastic work so far! I have two Kelvinator air conditioners that use the same Electrolux system. The first one I was able to add and it's working perfectly but the second one shows up within the integration as an "entry" but doesn't add a second entity. It definitely works with both units, just whichever one I add second doesn't get an entity. It would be wonderful if we were able to expose the internal temperature sensor as a sensor in home assist too!``

DotEfekts commented 10 months ago

Hi, I can't say I've had this issue. I have 3 devices and they all add fine. I've just pushed an update that should improve the config flow so you can try again. The temperature is already available as the current_temperature attribute on the entity. You can use a template to create a sensor from that.

dmcke5 commented 10 months ago

So I went back and removed everything and reinstalled your updated version. Both the air conditioners show up as a device that can be added but I'm still only getting a device and an entity for one of the two air conditioners. It may not be anything to do with the order that I'm adding them in, as its always the same air condditioner that ends up working and I doubt I've fluked that every time I've tried. I've attached a screenshot to show you what I mean. Didn't know I could do that with the temperature, still new to home assist. Thanks for the help!

Screenshot 2023-10-26 173754

DotEfekts commented 10 months ago

Could you check for errors in your logs, and yes if you could try only adding the aircon you're having issues with it.

dmcke5 commented 10 months ago

Yep looks like there's an error in the logs.

Logger: homeassistant.components.climate
Source: helpers/entity_platform.py:359
Integration: Climate (documentation, issues)
First occurred: 5:37:40 PM (1 occurrences)
Last logged: 5:37:40 PM

Error while setting up electrolux_climate platform for climate
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 359, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/electrolux_climate/climate.py", line 51, in async_setup_entry
    sn = json.loads(create_from_device(discovery[0]).get_status())["sn"]
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
KeyError: 'sn'

It's a bit hard to tell which unit is which since they both show up with the same name and I don't know their IP addresses. I'll flick the isolator off on the one that's working and see what happens.

dmcke5 commented 10 months ago

Okay, just tried it again with the one working AC powered off and I get exactly the same error so its obviously a compatibility issue with this air conditioner rather than the order I was adding them in. Sorry for the misinformation!