JoDehli / PyLoxone

Python Loxone binding
Apache License 2.0
200 stars 42 forks source link

Cover device_class integration #17

Closed Juxz closed 4 years ago

Juxz commented 4 years ago

Hi,

I propose to improve the Cover integration.

In loxone miniserver there are 6 types of objects to be mapped to Cover in HA:

In HA, there only 1 object Cover which has 10 possible values for device_class:

In current PyLoxone version:

Anyway, I suggest improving this part because it has several impacts related to voice assistant integrations (alexa, google assistant, homekit...). The vocal commands and security might be different whether it's door or a garage door or other.

As a workaround I'm using this type of entry in customize.yaml, but this is not ideal:

cover.porte_garage:
  device_class: garage   

Here below one mapping table proposal. I don't know if loxone API is offering all this flexibility, but I refer to loxone config capabilities

Loxone Config device_class
Garage/Gate controller, animation =0: Garage door garage
Garage/Gate controller, animation = 1: Single Gate Opening to the left door
Garage/Gate controller, animation = 2: Single Gate opening to the right door
Garage/Gate controller, animation = 3: Gate opening to both side door
Garage/Gate controller, animation = 4: Folding Door opening to the left door
Garage/Gate controller, animation = 5: Folding Door opening to the right door
Skylight controller window
Skylight shade controller shade
Automatic blind controller, type = 0: Venetian Slatted Blinds blind
Automatic blind controller, type = 1: Roller Blinds or Shutters blind
Automatic blind controller, type = 2: Curtains opening to both sides curtain
Automatic blind controller, type = 3: Schlotterer Retrolux shutter
Automatic blind controller, type = 4: Curtain left curtain
Automatic blind controller, type = 5: Curtain right curtain
Automatic blind controller, type = 6: Awning awning
EIB blind controller blind
Door controller door

Thanks

JoDehli commented 4 years ago

Have you checked it if the changes in the dev branch? Is something missing?

Juxz commented 4 years ago

I need to test a few more combinations of devices but so far it's working well.

Juxz commented 4 years ago

Tested in release PyLoxone 0.2.1 with Loxone Miniserver 10.3.11.27 and it's all good Thanks JoDehli