Xiaomi cube package to control lights

Hi all,

I just wrote a package configuration for my xiaomi cube which let me control all my living room lights. Right now it supports:

  • Flip90 the cube will select and blink a light.
  • Rotating the cube will set color or brightness based on cube_mode state.
  • flip180 will alternate between color or brightness state.
  • double tapping will toggle the light
  • Shaking the cube will select and apply a scene from a list.
  • throw the cube in the air (free fall action) will call the generate_scene script (wrote by @sunnythaper) and save the config in a file.

Colours, lights and scenes could be easily changed by adding/modifying the options of the related input_select component.

The package is here.

10 Likes

Is this available still?

thanks for point it. Don’t know what happened, but it’s now on my repository. here: https://github.com/clyra/homeassistant

1 Like

Hey thanks for this.

Do you mind posting your scenes yaml?

Also, any idea how I can use your python_script.scene_generator in hassio?

you are welcome. I don’t mind post my scenes but they will not make sense outside my home… anyway here is the sala_conforto (living room comfort light):

Name: Sala Conforto
entities:
  light.fita_sala:
    state: on
    brightness: 122
    rgb_color: [255, 0, 126]
  light.c1:
    state: on
    brightness: 180
    rgb_color: [255, 189, 46]
  light.w4:
    state: off
  light.rc1:
    state: off
  light.a2:
    state: off
  light.w5:
    state: off
  light.w3:
    state: off
  light.rc3:
    state: on
    brightness: 254
    rgb_color: [255, 189, 46]
  light.a1:
    state: off

about the script I’m not sure. I don’t use hassio myself so I’m not aware of its limitations.

do you have a a github with you configuration? Just got the cube and your examples look great. Specifically trying to get the colors changing at the minute. I’m not very familiar with python and scripting so don’t fancy messing about with it

EDIT: never mind, just seen your post above :slight_smile: