RainerStaude / hass-becker-component-plus-pybecker

A native home assistant component to control becker RF shutters with a Becker Centronic USB Stick.
MIT License
47 stars 4 forks source link

aqara door sensors + value_template #38

Open m4r1k opened 4 months ago

m4r1k commented 4 months ago

Hey there!

I'm in love with this integration! It has automated one of the last remaining item at home.

All doors and windows have aqara sensors, integrated in HA through the Aqara E1 hub. On HA side their status is exposed through the native HomeKit integration.

Screenshot 2024-05-14 at 21 45 09

Now, with the following config, the window state (open, opening, closing, closed) becomes unresponsive.

cover:
  - platform: becker
    device: "/dev/ttyACM0"
    filename: "my-centronic-stick.db"
    covers:
      bathroom:
        friendly_name: "Bathroom Velux"
        channel: "1"
        tilt_intermediate: off
        travelling_time_up: 40
        travelling_time_down: 50
        value_template: "{{ 0 if is_state('binary_sensor.bathroom_velux_sensor', 'closed') else None }}"

The Window "Value Template" status in HA remains also unknown.

I kinda have a clue this issue might be related to the type of sensors exposed by the HomeKit integration, which is a binary_sensor.

Any clue if I'm doing something wrong? The code doesn't show, to me at least, a preference for a specific type of HA sensor. Any help is greatly appreciated.

RainerStaude commented 4 months ago

Anything in the log with log level debug enabled? There should be something in the log whenever the result of the template changes Is the template properly returning 0 or None?

I guess you also have a master remote. So check the log and add the remote_id to the config remote_id: "12345:2"

m4r1k commented 3 months ago

Hey @RainerStaude

Apologies for such late answer!! Where I live rained nonstop and it was difficult to do the debug. See the following logs:

2024-06-16 13:23:34.643 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration becker which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-06-16 13:23:35.637 INFO (MainThread) [homeassistant.setup] Setting up becker
2024-06-16 13:23:35.637 INFO (MainThread) [homeassistant.setup] Setup of domain becker took 0.00 seconds
2024-06-16 13:23:35.637 INFO (MainThread) [homeassistant.components.cover] Setting up becker.cover
2024-06-16 13:23:35.637 DEBUG (MainThread) [custom_components.becker.cover] device: /dev/ttyACM0; filename: my-centronic-stick.db
2024-06-16 13:23:35.638 DEBUG (MainThread) [custom_components.becker.rf_device] Use filename: my-centronic-stick.db
2024-06-16 13:23:35.639 DEBUG (MainThread) [custom_components.becker.pybecker.becker_helper] Try to open connection.
2024-06-16 13:23:35.644 DEBUG (Thread-2) [custom_components.becker.pybecker.becker_helper] BeckerCommunicator thread started.
2024-06-16 13:23:35.645 WARNING (MainThread) [custom_components.becker.cover] Both "value_template" and "travelling_time" are configured for cover Bathroom Velux. "value_template" might influence with "travelling_time"!
2024-06-16 13:23:35.649 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'becker' accesses hass.helpers.dispatcher. This is deprecated and will stop working in Home Assistant 2024.11, it should be updated to import functions used from dispatcher directly at custom_components/becker/cover.py, line 253: receive = self.hass.helpers.dispatcher.async_dispatcher_connect(, please report it to the author of the 'becker' custom integration
2024-06-16 13:23:35.650 DEBUG (MainThread) [custom_components.becker.cover] Bathroom Velux: Update template with result: None with type <class 'NoneType'>

I believe the template returns None. Was this expected?