W00D00 / home-assistant-elero

Elero Centero component
GNU General Public License v3.0
40 stars 10 forks source link

Homekit possible with elero.cover entities? #14

Closed XevDoc closed 3 years ago

XevDoc commented 4 years ago

Hi, thanks for your great work with this custom_component! Today I tried to add my new shiny cover's to a Homekit Bridge; unfortunately, it doesn't work, due to:

2020-07-22 16:22:17 DEBUG (SyncWorker_9) [homeassistant.components.homekit.accessories] Add "cover.buro" as "WindowCoveringBasic"
2020-07-22 16:22:17 DEBUG (SyncWorker_9) [pyhap.characteristic] set_value: Name to Rollo
2020-07-22 16:22:17 DEBUG (SyncWorker_9) [pyhap.characteristic] set_value: SerialNumber to default
2020-07-22 16:22:17 DEBUG (SyncWorker_9) [pyhap.characteristic] set_value: FirmwareRevision to 0.112.4
2020-07-22 16:22:17 DEBUG (SyncWorker_9) [pyhap.characteristic] set_value: Manufacturer to Home Assistant Cover
2020-07-22 16:22:17 DEBUG (SyncWorker_9) [pyhap.characteristic] set_value: Model to Cover
2020-07-22 16:22:17 DEBUG (SyncWorker_9) [pyhap.characteristic] set_value: SerialNumber to cover.buro
2020-07-22 16:22:17 DEBUG (SyncWorker_9) [pyhap.characteristic] set_value: PositionState to 2
2020-07-22 16:22:17 DEBUG (SyncWorker_9) [pyhap.characteristic] set_value: CurrentPosition to 100
2020-07-22 16:22:17 DEBUG (SyncWorker_9) [pyhap.characteristic] set_value: TargetPosition to 100
2020-07-22 16:22:17 ERROR (SyncWorker_9) [homeassistant.components.homekit] Failed to create a HomeKit accessory for cover.buro
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/homekit/__init__.py", line 446, in add_bridge_accessory
    acc = get_accessory(self.hass, self.driver, state, aid, conf)
  File "/usr/src/homeassistant/homeassistant/components/homekit/accessories.py", line 224, in get_accessory
    return TYPES[a_type](hass, driver, name, state.entity_id, aid, config)
  File "/usr/src/homeassistant/homeassistant/components/homekit/type_covers.py", line 302, in __init__
    self.async_update_state(state)
  File "/usr/src/homeassistant/homeassistant/components/homekit/type_covers.py", line 349, in async_update_state
    super().async_update_state(new_state)
  File "/usr/src/homeassistant/homeassistant/components/homekit/type_covers.py", line 199, in async_update_state
    if self.char_current_tilt.value != current_tilt:
AttributeError: 'WindowCoveringBasic' object has no attribute 'char_current_tilt'

Is there a way to fake the tilt attributes? I don't need specific positions, I'm only interested in up/down/stop, which is working perfectly via HA.

W00D00 commented 4 years ago

Hi @XevDoc,

I think everything is possible, maybe just the way is hard :) So, first I would like to understand the situation where we are.

I have Android and iOS phone too. However, before this time, I have used just the Google VR on Android to set the covers and everything is working well. So, at now, I have to test and reproduce your issue on iOS used my wife phone:) Please give me time for it and I will be back soon.

Thanks, Istvan

XevDoc commented 4 years ago

Hi Istvan,

thank you for your quick response!

You don't need an iOS device to test this, the integration into Homekit is failing during the creation of a "homekit cover device". To control the Homekit devices you would use iOS hardware, but that's the second step - and will probably be successful, as soon as the Homekit part works.

What I've done: 1) Adding your custom-component, creating elero devices like this:

cover:
    - platform: elero
      covers:
          buro:
            serial_number: 'AXXXIYT6'
            name: 'Buero'
            channel: 1
            device_class: roller shutter
            supported_features:
                - up
                - down
                - stop
          rollo_essen1:
            serial_number: 'AXXXIYT6'
            name: 'Essbereich 1'
            channel: 2
            device_class: roller shutter
            supported_features:
                - up
                - down
                - stop
          rollo_essen2:
            serial_number: 'AXXXIYT6'
            name: 'Essbereich 2'
            channel: 3
            device_class: roller shutter
            supported_features:
                - up
                - down
                - stop

They work perfectly within HA (a slight delay before the covers start moving, but absolutely acceptable).

2) Creating a Homekit Bridge via configuration (not via UI>Integrations, this one adds all my devices (~300)) to include only a test light bulb and an elero cover:

homekit:
  filter:
    include_entities: 
      - light.buro_1
      - cover.buro

3) Dialing in logging to see the Homekit output:

logger:
  default: warning
  logs:
    homeassistant.components.homekit: debug
    pyhap: debug

This results in the error message shown in my first posting.

W00D00 commented 4 years ago

Hi @XevDoc,

I didn’t forget I just didn’t have time to deal with it, sorry. Please be patient. Thanks

XevDoc commented 4 years ago

Thx for the Feedback! Sure thing, take your time :-)

W00D00 commented 3 years ago

Hi @XevDoc,

kindly sorry for my late answer.

I tried the HomeKit on my HA instal with an iPhone11 as you mentioned and everything is working perfectly immediately.

Here is my setup:

configuration.yaml

homekit:
- filter:
    include_entities:
      - sensor.nibe_belso_homerseklet_bt50
      - cover.guestroom
      - cover.diningroom
- platform: elero
  covers:
    guestroom:
        serial_number: 'xxxxx'
        name: 'guestroom'
        channel: 2
        device_class: roller shutter
        supported_features:
            - up
            - down
            - stop
            - set_position
            - open_tilt
            - close_tilt
            - stop_tilt
            - set_tilt_position
    diningroom:
        serial_number: 'xxxxx'
        name: 'diningroom'
        channel: 7
        device_class: venetian blind
        supported_features:
            - up
            - down
            - stop
            - set_position
            - open_tilt
            - close_tilt
            - stop_tilt
            - set_tilt_position

As I see, the main differences are the tilt commands in my setup which are missing in yours. Please try to put them in your setting and I hope they will work for you too. Please let me know what is happening to you.

Thanks, Istvan

XevDoc commented 3 years ago

Hi Istvan,

I can finally give you a feedback now; yes, it is working perfectly with the *_tilt extensions :-)

Thanks!