Improved deCONZ xiaomi aqara mi cube integration with AppDaemon

Custom AppDaemon which adds a new sensor with the state of the cube top side and also generates events like the xiaomi binary sensor.

:point_right: Code

Example automations:

- alias: Cube aqara logo side is facing up
  trigger:
    platform: state
    entity_id: sensor.aqara_cube
    to: '1'
  action:
    - service: light.turn_on
      entity_id: group.all_lights
      data:
        flash: short

- alias: Cube event shake
  trigger:
    platform: event
    event_type: xiaomi_aqara.cube_action
    event_data:
      entity_id: sensor.aqara_cube
      action_type: shake_air
  action:
    - service: light.turn_on
      entity_id: group.all_lights
      data:
        flash: long

- alias: Cube - Rotate to affect brightness
  trigger:
    platform: event
    event_type: xiaomi_aqara.cube_action
    event_data:
      entity_id: sensor.aqara_cube
      action_type: rotate
  action:
    - service: light.turn_on
      entity_id: all
      data_template:
        transition: 1
        brightness_step: "{{ trigger.event.data.action_value | int }}"
3 Likes

Thanks for the cube appdaemon! Works great for me after I managed the general appdeamon setup which was new to me.