Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single/double click of Xiaomi wireless button no longer works since 0.83.x #19413

Closed
tedsluis opened this issue Dec 17, 2018 · 11 comments
Closed

Comments

@tedsluis
Copy link
Contributor

tedsluis commented Dec 17, 2018

Home Assistant release with the issue: 0.83.x, 0.84.0, 0.84.1, 0.84.2 and 0.84.3

Last working Home Assistant release (if known): 0.82.1

Operating environment (Hass.io/Docker/Windows/etc.): Docker

  • Xiaomi gateway
  • Xiaomi WXKG02LM Aqara smart ligth switch double

Component/platform: components/binary_sensor.xiaomi_aqara

Description of problem: Single/double clicks on Xiaomi wireless buttons (WXKG02LM) are no longer captured on the dev-state page nor do they trigger any automation since updating from 0.82.1 to 0.84.x. The state on the dev-state page and in the Lovelace UI is presented as off.

Remarkable: The last action of the Xiaomi buttons on the dev-state page and the Lovelace UI changes to double when I double click! A single click will change it into single. A long click does make any change. No history is available.

The Xiaomi wireless switch (WXKG02LM) entities are displayed on the dev-state as below:

binary_sensor.wall_switch_left_158d00xxxxxxxx
binary_sensor.wall_switch_right_158d00xxxxxxxx
binary_sensor.wall_switch_both_158d00xxxxxxxx

Triggers in my automations.yaml do not act on the click_type single or both_click.
Here automation snippet that works in 82.1, but not works in 0.83.x and 0.84.x:

- alias: Dimm light
  trigger:
    platform: event
    event_type: click
    event_data:
      entity_id: binary_sensor.wall_switch_left_158d00027c19e9
      click_type: single
  action:
    service: light.turn_on
    entity_id: light.hue_ambiance_slaapkamer
    data_template:
      brightness: 80

Other Xiaomi components including motion sensors, temp/humidity sensors and power plug are still working fine in 0.82.x, 0.83.x and 0.84.x

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

# Xiaomi gateway
xiaomi_aqara:
  discovery_retry: 5
  gateways:
    - mac: !secret xiaomi_mac
      key: !secret xiaomi_key

Traceback (if applicable):

Below the xiaomi_aqara component logging. It starts with some sensors that work okay.

note: I did add comments to indicate which button I pushed.

# The okay working xiaomi sensors 
dec 17 19:29:17 nuc docker[29530]: 2018-12-17 19:29:17 DEBUG (SyncWorker_13) [homeassistant.components.xiaomi_aqara] Gateways discovered. Listening for broadcasts
dec 17 19:29:48 nuc docker[29530]: 2018-12-17 19:29:48 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Plug_158d000xxxxxxx: on>: {'voltage': 3600, 'status': 'on', 'inuse': '1', 'power_consumed': '1506', 'load_power': '1.67'}
dec 17 19:29:59 nuc docker[29530]: 2018-12-17 19:29:59 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Temperature_158d000xxxxxxx: 18.1>: {'temperature': '1816'}
dec 17 19:29:59 nuc docker[29530]: 2018-12-17 19:29:59 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Humidity_158d000xxxxxxx: 57.8>: {'temperature': '1816'}
dec 17 19:29:59 nuc docker[29530]: 2018-12-17 19:29:59 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Pressure_158d000xxxxxxx: 1019.2>: {'temperature': '1816'}
dec 17 19:29:59 nuc docker[29530]: 2018-12-17 19:29:59 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Temperature_158d000xxxxxxx: 18.2>: {'humidity': '6380'}
dec 17 19:29:59 nuc docker[29530]: 2018-12-17 19:29:59 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Humidity_158d000xxxxxxx: 57.8>: {'humidity': '6380'}
dec 17 19:29:59 nuc docker[29530]: 2018-12-17 19:29:59 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Pressure_158d000xxxxxxx: 1019.2>: {'humidity': '6380'}
dec 17 19:29:59 nuc docker[29530]: 2018-12-17 19:29:59 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Temperature_158d000xxxxxxx: 18.2>: {'pressure': '101930'}
dec 17 19:29:59 nuc docker[29530]: 2018-12-17 19:29:59 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Humidity_158d000xxxxxxx: 63.8>: {'pressure': '101930'}
dec 17 19:29:59 nuc docker[29530]: 2018-12-17 19:29:59 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Pressure_158d000xxxxxxx: 1019.2>: {'pressure': '101930'}
dec 17 19:30:06 nuc docker[29530]: 2018-12-17 19:29:59 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Motion Sensor_158d000xxxxxxx: off>: {'no_motion': '120'}
dec 17 19:30:06 nuc docker[29530]: 2018-12-17 19:29:59 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Illumination_158d000xxxxxxx: 9.0>: {'no_motion': '120'}
dec 17 19:30:19 nuc docker[29530]: 2018-12-17 19:29:59 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Plug_158d000xxxxxxx: on>: {'voltage': 3600, 'status': 'on', 'inuse': '1', 'power_consumed': '1506', 'load_power': '1.67'}

# left button pressed
dec 17 19:30:04 nuc docker[29530]: 2018-12-17 19:30:04 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Left)_158d000xxxxxxx: off>: {'channel_0': 'click'}
dec 17 19:30:04 nuc docker[29530]: 2018-12-17 19:30:04 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Both)_158d000xxxxxxx: off>: {'channel_0': 'click'}
dec 17 19:30:04 nuc docker[29530]: 2018-12-17 19:30:04 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Right)_158d000xxxxxxx: off>: {'channel_0': 'click'}

# right button pressed
dec 17 19:30:07 nuc docker[29530]: 2018-12-17 19:30:07 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Left)_158d000xxxxxxx: off>: {'channel_1': 'click'}
dec 17 19:30:07 nuc docker[29530]: 2018-12-17 19:30:07 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Both)_158d000xxxxxxx: off>: {'channel_1': 'click'}
dec 17 19:30:07 nuc docker[29530]: 2018-12-17 19:30:07 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Right)_158d000xxxxxxx: off>: {'channel_1': 'click'}

# left button double pressed
dec 17 19:30:11 nuc docker[29530]: 2018-12-17 19:30:11 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Left)_158d000xxxxxxx: off>: {'channel_0': 'double_click'}
dec 17 19:30:11 nuc docker[29530]: 2018-12-17 19:30:11 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Both)_158d000xxxxxxx: off>: {'channel_0': 'double_click'}
dec 17 19:30:11 nuc docker[29530]: 2018-12-17 19:30:11 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Right)_158d000xxxxxxx: off>: {'channel_0': 'double_click'}

# right button double pressed
dec 17 19:30:15 nuc docker[29530]: 2018-12-17 19:30:15 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Left)_158d000xxxxxxx: off>: {'channel_1': 'double_click'}
dec 17 19:30:15 nuc docker[29530]: 2018-12-17 19:30:15 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Both)_158d000xxxxxxx: off>: {'channel_1': 'double_click'}
dec 17 19:30:15 nuc docker[29530]: 2018-12-17 19:30:15 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Right)_158d000xxxxxxx: off>: {'channel_1': 'double_click'}

# buttons both pressed
dec 17 19:30:18 nuc docker[29530]: 2018-12-17 19:30:18 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Left)_158d000xxxxxxx: off>: {'dual_channel': 'both_click'}
dec 17 19:30:18 nuc docker[29530]: 2018-12-17 19:30:18 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Both)_158d000xxxxxxx: off>: {'dual_channel': 'both_click'}
dec 17 19:30:18 nuc docker[29530]: 2018-12-17 19:30:18 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Right)_158d000xxxxxxx: off>: {'dual_channel': 'both_click'}

# buttons both double pressed
dec 17 19:30:22 nuc docker[29530]: 2018-12-17 19:30:22 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Left)_158d000xxxxxxx: off>: {'dual_channel': 'double_both_click'}
dec 17 19:30:22 nuc docker[29530]: 2018-12-17 19:30:22 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Both)_158d000xxxxxxx: off>: {'dual_channel': 'double_both_click'}
dec 17 19:30:22 nuc docker[29530]: 2018-12-17 19:30:22 WARNING (MainThread) [homeassistant.components.binary_sensor.xiaomi_aqara] Unsupported click_type detected: double_both_click
dec 17 19:30:22 nuc docker[29530]: 2018-12-17 19:30:22 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Right)_158d000xxxxxxx: off>: {'dual_channel': 'double_both_click'}

# left button long pressed
dec 17 19:30:28 nuc docker[29530]: 2018-12-17 19:30:28 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Left)_158d000xxxxxxx: off>: {'channel_0': 'long_click'}
dec 17 19:30:28 nuc docker[29530]: 2018-12-17 19:30:28 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Both)_158d000xxxxxxx: off>: {'channel_0': 'long_click'}
dec 17 19:30:28 nuc docker[29530]: 2018-12-17 19:30:28 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Right)_158d000xxxxxxx: off>: {'channel_0': 'long_click'}

# right button long pressed
dec 17 19:30:33 nuc docker[29530]: 2018-12-17 19:30:33 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Left)_158d000xxxxxxx: off>: {'channel_1': 'long_click'}
dec 17 19:30:33 nuc docker[29530]: 2018-12-17 19:30:33 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Both)_158d000xxxxxxx: off>: {'channel_1': 'long_click'}
dec 17 19:30:33 nuc docker[29530]: 2018-12-17 19:30:33 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Right)_158d000xxxxxxx: off>: {'channel_1': 'long_click'}

Additional information:

Community thread that other users report similar issues:

https://community.home-assistant.io/t/xiaomi-button-no-longer-registers-single-or-double-press/83129

@marchingphoenix
Copy link
Contributor

breaking change in 0.83.

Prefix all xiaomi_aqara events with “xiaomi_aqara”. Please update your automations: motion -> xiaomi_aqara.motion, click -> xiaomi_aqara.click, cube_action -> xiaomi_aqara.cube_action (@syssi - #17354) (binary_sensor.xiaomi_aqara docs) (breaking change)

Check the docs and that pr for the fix.

@tedsluis
Copy link
Contributor Author

@marchingphoenix Thnx for your reply.

breaking change in 0.83.

Prefix all xiaomi_aqara events with “xiaomi_aqara”. Please update your automations: motion -> xiaomi_aqara.motion, click -> xiaomi_aqara.click, cube_action -> xiaomi_aqara.cube_action (@syssi - #17354) (binary_sensor.xiaomi_aqara docs) (breaking change)

Check the docs and that pr for the fix.

I tried to use the xiaomi_aqara prefix, but it did not work, see the examples below.

This does not work:

- alias: Dimm light
  trigger:
    platform: event
    event_type: click
    event_data:
      entity_id: xiaomi_aqara.binary_sensor.wall_switch_left_158d00027c19e9
      click_type: single
  action:
    service: light.turn_on
    entity_id: light.hue_ambiance_slaapkamer
    data_template:
      brightness: 80

And the ui-lovelace.yaml below also does not work:

title: My Home
views:
  - icon: mdi:home-assistant
    title: home-assistant
    cards:
      - type: entities
        title: Woonkamer
        entities:
          - xiaomi_aqara.binary_sensor.wall_switch_left_158d000xxxxxx

It returns the error below when I reload the Lovelace UI:

Invalid entity ID at position 1:
xiaomi_aqara.binary_sensor.wall_switch_left_158d000xxxxxxx
{
 "type": "entities",
 "title": "Woonkamer",
 "entities": [
 "xiaomi_aqara.binary_sensor.wall_switch_left_158d000xxxxxx
 ]
}

Also the dev-state page does not use the xiaomi_aqara prefix. It looks like these Xiaomi binary switch sensors don't use the xiaomi_aqara prefix. Or do I use the prefix wrongly?

@syssi
Copy link
Member

syssi commented Dec 17, 2018

Please prefix the value of event_type instead of the entity_id.

@tedsluis
Copy link
Contributor Author

tedsluis commented Dec 17, 2018

@syssi Thanks for your suggestion. My mistake, silly me, although I tried it correctly before.

Now I did put the xiaomi_aqara. as a prefix for the event_type, like below:

# Dimm hue light with xiaomi switch
- alias: Dimm slaapkamer licht
  trigger:
    platform: event
    event_type: xiaomi_aqara.click
    event_data:
      entity_id: binary_sensor.wall_switch_left_158d00027c19e9
      click_type: single
  action:
    service: light.turn_on
    entity_id: light.hue_ambiance_slaapkamer
    data_template:
      brightness: 80

Unfortunately it doesn't work. Do you have more suggestions?

I turned on debug logging:

logger:
     default: debug

and I captured these related log lines when I pressed the buttons:

# left button pressed
dec 17 22:19:45 nuc.bachstraat20 docker[3769]: 2018-12-17 22:19:45 DEBUG (Thread-3) [xiaomi_gateway] MCAST (report) << {'cmd': 'report', 'model': 'remote.b286acn01', 'sid': '158d000xxxxxxx', 'short_id': 53379, 'data': '{"channel_1":"click"}'}
dec 17 22:19:42 nuc.bachstraat20 docker[3769]: 2018-12-17 22:19:42 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Both)_158d000xxxxxxx: off>: {'channel_0': 'click'}
dec 17 22:19:42 nuc.bachstraat20 docker[3769]: 2018-12-17 22:19:42 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Right)_158d000xxxxxxx: off>: {'channel_0': 'click'}
dec 17 22:19:42 nuc.bachstraat20 docker[3769]: 2018-12-17 22:19:42 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Left)_158d000xxxxxxx: off>: {'channel_0': 'click'}
dec 17 22:19:42 nuc.bachstraat20 docker[3769]: 2018-12-17 22:19:42 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event xiaomi_aqara.click[L]: entity_id=binary_sensor.wall_switch_left_158d000xxxxxxx, click_type=single>
dec 17 22:19:42 nuc.bachstraat20 docker[3769]: 2018-12-17 22:19:42 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=binary_sensor.wall_switch_left_158d000xxxxxxx, old_state=<state binary_sensor.wall_switch_left_158d000xxxxxxx=off; last_action=None, battery_level=51.0, friendly_name=schakelaar links slaapkamer annelies & ted, hidden=True @ 2018-12-17T22:19:23.745643+01:00>, new_state=<state binary_sensor.wall_switch_left_158d000xxxxxxx=off; last_action=single, battery_level=51.0, friendly_name=schakelaar links slaapkamer annelies & ted, hidden=True @ 2018-12-17T22:19:23.745643+01:00>>
dec 17 22:19:42 nuc.bachstraat20 docker[3769]: 2018-12-17 22:19:42 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.140300477145776] Sending {'id': 2, 'type': 'event', 'event': {'event_type': 'state_changed', 'data': {'entity_id': 'binary_sensor.wall_switch_left_158d000xxxxxxx', 'old_state': <state binary_sensor.wall_switch_left_158d000xxxxxxx=off; last_action=None, battery_level=51.0, friendly_name=schakelaar links slaapkamer annelies & ted, hidden=True @ 2018-12-17T22:19:23.745643+01:00>, 'new_state': <state binary_sensor.wall_switch_left_158d000xxxxxxx=off; last_action=single, battery_level=51.0, friendly_name=schakelaar links slaapkamer annelies & ted, hidden=True @ 2018-12-17T22:19:23.745643+01:00>}, 'origin': 'LOCAL', 'time_fired': datetime.datetime(2018, 12, 17, 21, 19, 42, 252564, tzinfo=<UTC>), 'context': {'id': '5a1b2e6f6bcd4a49ae263b6b21b9aacc', 'user_id': None}}}

# right button pressed
dec 17 22:19:45 nuc.bachstraat20 docker[3769]: 2018-12-17 22:19:45 DEBUG (Thread-3) [xiaomi_gateway] MCAST (report) << {'cmd': 'report', 'model': 'remote.b286acn01', 'sid': '158d000xxxxxxx', 'short_id': 53379, 'data': '{"channel_1":"click"}'}
dec 17 22:19:45 nuc.bachstraat20 docker[3769]: 2018-12-17 22:19:45 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Both)_158d000xxxxxxx: off>: {'channel_1': 'click'}
dec 17 22:19:45 nuc.bachstraat20 docker[3769]: 2018-12-17 22:19:45 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Right)_158d000xxxxxxx: off>: {'channel_1': 'click'}
dec 17 22:19:45 nuc.bachstraat20 docker[3769]: 2018-12-17 22:19:45 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Left)_158d000xxxxxxx: off>: {'channel_1': 'click'}
dec 17 22:19:45 nuc.bachstraat20 docker[3769]: 2018-12-17 22:19:45 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event xiaomi_aqara.click[L]: entity_id=binary_sensor.wall_switch_right_158d000xxxxxxx, click_type=single>
dec 17 22:19:45 nuc.bachstraat20 docker[3769]: 2018-12-17 22:19:45 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=binary_sensor.wall_switch_right_158d000xxxxxxx, old_state=<state binary_sensor.wall_switch_right_158d000xxxxxxx=off; last_action=None, battery_level=51.0, friendly_name=schakelaar rechts slaapkamer annelies & ted, hidden=True @ 2018-12-17T22:19:23.744390+01:00>, new_state=<state binary_sensor.wall_switch_right_158d000xxxxxxx=off; last_action=single, battery_level=51.0, friendly_name=schakelaar rechts slaapkamer annelies & ted, hidden=True @ 2018-12-17T22:19:23.744390+01:00>>
dec 17 22:19:45 nuc.bachstraat20 docker[3769]: 2018-12-17 22:19:45 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.140300477145776] Sending {'id': 2, 'type': 'event', 'event': {'event_type': 'state_changed', 'data': {'entity_id': 'binary_sensor.wall_switch_right_158d000xxxxxxx', 'old_state': <state binary_sensor.wall_switch_right_158d000xxxxxxx=off; last_action=None, battery_level=51.0, friendly_name=schakelaar rechts slaapkamer annelies & ted, hidden=True @ 2018-12-17T22:19:23.744390+01:00>, 'new_state': <state binary_sensor.wall_switch_right_158d000xxxxxxx=off; last_action=single, battery_level=51.0, friendly_name=schakelaar rechts slaapkamer annelies & ted, hidden=True @ 2018-12-17T22:19:23.744390+01:00>}, 'origin': 'LOCAL', 'time_fired': datetime.datetime(2018, 12, 17, 21, 19, 45, 57445, tzinfo=<UTC>), 'context': {'id': 'eb8ac0f6031f45bc83dcb33c29971c59', 'user_id': None}}}

# both pressed
dec 17 22:19:47 nuc.bachstraat20 docker[3769]: 2018-12-17 22:19:47 DEBUG (Thread-3) [xiaomi_gateway] MCAST (report) << {'cmd': 'report', 'model': 'remote.b286acn01', 'sid': '158d000xxxxxxx', 'short_id': 53379, 'data': '{"dual_channel":"both_click"}'}
dec 17 22:19:47 nuc.bachstraat20 docker[3769]: 2018-12-17 22:19:47 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Both)_158d000xxxxxxx: off>: {'dual_channel': 'both_click'}
dec 17 22:19:47 nuc.bachstraat20 docker[3769]: 2018-12-17 22:19:47 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Right)_158d000xxxxxxx: off>: {'dual_channel': 'both_click'}
dec 17 22:19:47 nuc.bachstraat20 docker[3769]: 2018-12-17 22:19:47 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Wall Switch (Left)_158d000xxxxxxx: off>: {'dual_channel': 'both_click'}
dec 17 22:19:47 nuc.bachstraat20 docker[3769]: 2018-12-17 22:19:47 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event xiaomi_aqara.click[L]: entity_id=binary_sensor.wall_switch_both_158d000xxxxxxx, click_type=both>
dec 17 22:19:47 nuc.bachstraat20 docker[3769]: 2018-12-17 22:19:47 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=binary_sensor.wall_switch_both_158d000xxxxxxx, old_state=<state binary_sensor.wall_switch_both_158d000xxxxxxx=off; last_action=None, battery_level=51.0, friendly_name=schakelaar beide slaapkamer annelies & ted, hidden=True @ 2018-12-17T22:19:23.741326+01:00>, new_state=<state binary_sensor.wall_switch_both_158d000xxxxxxx=off; last_action=both, battery_level=51.0, friendly_name=schakelaar beide slaapkamer annelies & ted, hidden=True @ 2018-12-17T22:19:23.741326+01:00>>
dec 17 22:19:47 nuc.bachstraat20 docker[3769]: 2018-12-17 22:19:47 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.140300477145776] Sending {'id': 2, 'type': 'event', 'event': {'event_type': 'state_changed', 'data': {'entity_id': 'binary_sensor.wall_switch_both_158d000xxxxxxx', 'old_state': <state binary_sensor.wall_switch_both_158d000xxxxxxx=off; last_action=None, battery_level=51.0, friendly_name=schakelaar beide slaapkamer annelies & ted, hidden=True @ 2018-12-17T22:19:23.741326+01:00>, 'new_state': <state binary_sensor.wall_switch_both_158d000xxxxxxx=off; last_action=both, battery_level=51.0, friendly_name=schakelaar beide slaapkamer annelies & ted, hidden=True @ 2018-12-17T22:19:23.741326+01:00>}, 'origin': 'LOCAL', 'time_fired': datetime.datetime(2018, 12, 17, 21, 19, 47, 987760, tzinfo=<UTC>), 'context': {'id': '193cbe523844446fbe2ce0df3bf35275', 'user_id': None}}}

I could not find any action in the logging that was triggered by my automation that triggers my light. I am sure I did not miss anything.

@syssi
Copy link
Member

syssi commented Dec 18, 2018

As first step could you update to HA 0.84.3 and try again?

@tedsluis
Copy link
Contributor Author

I upgrade already to HA 0.84.3 before I opened this issue.

@syssi
Copy link
Member

syssi commented Dec 18, 2018

Could you check out automation called "Dimm slaapkamer licht" at the dev-state page f.e.? Is the automation enabled? It looks like the ZigBee device is working fine. Just your automation doesn't work. Could you try this automation:

- alias: Test single click event of the wall switch
  trigger:
    platform: event
    event_type: xiaomi_aqara.click
    event_data:
      entity_id: binary_sensor.wall_switch_left_158d00027c19e9
      click_type: single
  action:
    - service: persistent_notification.create
      data:
        title: "Aqara Wall Switch"
        message: "Single press of the left button detected"

@tedsluis
Copy link
Contributor Author

Thnx for your instructions.
Good news: Your example works. I get notifications. So that is good.
Conclusion: my actions don't work?

Is the automation enabled?

What do you mean by that?

I am still a bit puzzled about some things:

  • all my own automation's that are triggered using the Xiaomi switch sensors show last_triggered: null on the dev-state page, but your example automation shows the actual 'date & time' ?
  • your automation shows on in the column filter states on the dev-state page. My automation's show off?
  • the binary_sensor.wall_switch_left_158d00027c19e9 on the dev-state page does not show any history. Why?
  • the binary_sensor.wall_switch_left_158d00027c19e9 on the dev-state only shows the last action: single and double, not long.

Now you have proved the Xiaomi sensor is working, I will look into my actions. Thx for your help!

@syssi
Copy link
Member

syssi commented Dec 19, 2018

You could add initial_state: tue to your disabled automation:

- alias: Send notification on fire alarm
  initial_state: true
  trigger:
    platform: state
    entity_id: binary_sensor.smoke_sensor_158d00028f62ad
    from: 'off'
    to: 'on'
  action:

Or you could add group.all_automations to your UI. This is a group/list of all automations. It does look like this:

all_automations

@syssi
Copy link
Member

syssi commented Dec 19, 2018

The first generation of the wall switch doesn't support a long press events AFAIK.

@tedsluis
Copy link
Contributor Author

@syssi. Very useful, I didn't know that automation's could be disabled. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants