hllhll / HomeAssistant-EKON-iAircon

EKON iAircon / Tadiran climate component written in Python3 for Home Assistant. On the bases of Gree Climate component for easier interfacing with HASS
GNU General Public License v3.0
14 stars 7 forks source link

Support for custom entity id #2

Closed liorm0505 closed 4 years ago

liorm0505 commented 4 years ago

Is it possible to change the entity name other than ekon (default one) ?

hllhll commented 4 years ago

Not possible at the moment, a little tricky since you only configure the user and the rest is pulled off the servers. One option is to match the ACid (today ekon.XXXXX) to a user defined string.

Also you could probably get away with it by using templates, try it first. (Any features that I personally don't need might take a while, feel free to contribute :P )

liorm0505 commented 4 years ago

Hi,

Does this mean we can set a custom entity ID via the configuration.yaml? if yes, than for some reason i am still getting an "ekon298" name.

what am i missing here?

hllhll commented 4 years ago

That's a quick one I Have not yet updated the README, ` climate:

liorm0505 commented 4 years ago

Well, i figured you had some time to work on it on Saturday ;) Keep you updated.

Thanks,

hllhll commented 4 years ago

FYI, id (and for everyone else) is just the number that was originally in the EkonXXX

liorm0505 commented 4 years ago

Does that mean i have to hard code the original id to the configuration file?

hllhll commented 4 years ago

Yup. I Name/match the entities according their id in ekon systems (the id is generated on server-side and is consistent, not locally)

liorm0505 commented 4 years ago

I am getting the following error while trying to set the component:

Error while setting up ekon platform for climate Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT) File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for return fut.result() File "/config/custom_components/ekon/climate.py", line 174, in async_setup_platform await controller.async_load_init_data() File "/config/custom_components/ekon/climate.py", line 200, in async_load_init_data matching_items = list(filter(lambda x: int(x['id'])==int(dev_raw['id']), self._name_mapping)) File "/config/custom_components/ekon/climate.py", line 200, in matching_items = list(filter(lambda x: int(x['id'])==int(dev_raw['id']), self._name_mapping)) KeyError: 'id'

My configuration file:

Thanks,

liorm0505 commented 4 years ago

Found my error: The correct config is as follows:

(note: "name" shell not have "-")