gpulido / homeassistant-airzone

Home Assistant Custom component to manage Airzone Climate installations
MIT License
26 stars 6 forks source link

Error while setting up airzone platform for climate #13

Closed gabrio79 closed 3 years ago

gabrio79 commented 3 years ago

can you help me?

Logger: homeassistant.components.climate Source: custom_components/airzone/localapi.py:41 Integration: Climate (documentation, issues) First occurred: 4:29:58 PM (1 occurrences) Last logged: 4:29:58 PM Error while setting up airzone platform for climate Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform await asyncio.shield(task) File "/config/custom_components/airzone/climate.py", line 78, in async_setup_platform devices = await async_get_devices(config, hass) File "/config/custom_components/airzone/climate.py", line 57, in async_get_devices devices = [Machine(machine)] + [Zone(z) for z in machine.zones] File "/config/custom_components/airzone/climate.py", line 57, in <listcomp> devices = [Machine(machine)] + [Zone(z) for z in machine.zones] File "/config/custom_components/airzone/localapi.py", line 30, in __init__ self.airzone_zone = airzone_zone File "/config/custom_components/airzone/localapi.py", line 41, in airzone_zone self._name = value.name File "/usr/local/lib/python3.9/site-packages/airzone/localapi.py", line 217, in name return self.zone_state['name'] KeyError: 'name'

gpulido commented 3 years ago

Hello @gabrio79 I guess that you are using localapi.

gabrio79 commented 3 years ago

Hello, first of all, thanks for your code and versy fast answer. Yes, i tried local api

  - platform: airzone
    host: 192.168.50.191
    port: 3000 # the aizone port for modbus or localapi
    device_id: 2 # the Innobus machine address id / Aidoo slave id / LocalAPI system id
    device_class: "localapi" # 'aido' for the aidoo integration / LocalAPI for localapi

and yes, I configured name on system, but if I try manual POST on IP, the answer doesn't contain system name... http://192.168.50.191:3000/api/v1/hvac

{
    "data": [{
            "systemID": 1,
            "zoneID":   1,
            "on":   1,
            "maxTemp":  30,
            "minTemp":  18,
            "setpoint": 24,
            "roomTemp": 24.600000,
            "modes":    [1, 1, 4, 2, 3],
            "mode": 2,
            "speeds":   3,
            "speed":    0,
            "coldStages":   1,
            "coldStage":    1,
            "heatStages":   2,
            "heatStage":    2,
            "humidity": 67,
            "units":    0,
            "errors":   []
        }]
}

Screen Shot 2021-08-11 at 08 49 10

gabrio79 commented 3 years ago

I opened a ticket to Airzone for other reason and I understood che in FW 3.173 the system name is not resolved via LocalAPI. FW 3.2 is required (3.36 is availables)

gpulido commented 3 years ago

Thanks for the clarification. I will modify the code to take this into account and return a generic "zoneid" name.instead in such case. I hope I could made the changes this afternoon I'm out without access to a reliable internet connection. Sorry for the inconvenience.

gabrio79 commented 3 years ago

@gpulido thanks to you! PS: I opened also a new request regarding naming...

gabrio79 commented 3 years ago

Just a quick question, why you have created only one "heat_cool" HVAC status instead of standard: "heat", "cool", "fan" etc?

gpulido commented 3 years ago

In airzone the one that manages the state is the machine not the zone. So is the machine the one that can change all status. Each zone can only decide if be on/off for the current status of the machine and the zone can't change the machine status.

gabrio79 commented 3 years ago

In airzone the one that manages the state is the machine not the zone. So is the machine the one that can change all status. Each zone can only decide if be on/off for the current status of the machine and the zone can't change the machine status.

right. I'm using it, i will change my script/scene thanks again

gabrio79 commented 3 years ago

in order to say thank once again... I'd like share to you a quick, useful markdown overview Screen Shot 2021-08-11 at 18 59 11 and a stupid (but useful) xls to easily create it Crea Airzone-Shelly_Lovelace.xlsx adapt first column with your system and zones name, then copy yellow within a markdown

gpulido commented 3 years ago

@gabrio79 I have just updated the python-airzone to provide a default name for the old firmwares.

Thanks for the sheet! Btw really the "heat_cool" in that system just means that the zone is open for whatever the system is doing (heating / cooling). In my old innobus system there is a third "state" for automations (shedule) in the zone so I have: off / heat_cool / auto.

I'm going to close this issue, please reopen if needed.