Custom AppDaemon which adds a new sensor with the state of the cube top side and also generates events like the xiaomi binary sensor.
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 }}"