Mi-light Modes

In the Mi-light app i found the Modes button with some Memory buttons in it.
Is it possible to use them in Home Assistant?
My children likes the disco preset…
So would be hard to make myself, hope it is possible to recall the presets?

I’ve been playing around using the Yeelight app and Home Assistant for my Xiaomi Yeelight RGBW - I have not seen a way to access the preset lights in the app from Home Assistant unfortunately.

Hi @Wesley2004

If you don’t mind a little DIY have a look at this project (actually costs are quite low and there’s no soldering involved):

With Chris’ project not only MQTT (used by emulator) is faster than UDP (used by the native iBox) but it is also more reliable. As a mater of fact, any number of iBox units can be emulated (so you don’t need to un-pair and re-pair current bulbs).

See my post for using MiLight modes (on the emulator):

You can then use MiLight bulbs pretty much in every way you can think off :slight_smile:

2 Likes

I’ve been going this route as well since about a year. I only used the rgb+cct control, I’ve just added the modes and they work (without the mode effects conversion) nice!
You can also use all mi-light/futlight remotes and map them to seperate mqtt topics, so you can integrate them into home assistant.

I’ve posted also some additional tricks (below is a script to set different accents should there be more than one lights in a room “_edge” and “_downlight” are individual bulbs in the same room and I also update the “light.bedroom1” if the invidual bulbs are on). I’ve also got the bulbs settings for the scenes in the Philips Hue bridge (again, considering at least 2 bulbs).

random_scene_bedroom1:
  alias: 'Random scene'
  sequence:
    - service: light.turn_on
      data_template:
        entity_id: light.bedroom1_downlight
        brightness: 255
        rgb_color: ['{{range(1,255)|random}}', '{{range(1,255)|random}}', '{{range(1,255)|random}}']
    - delay:
        milliseconds: 100
    - service: light.turn_on
      data_template:
        entity_id: light.bedroom1_edge
        brightness: 255
        rgb_color: ['{{range(1,255)|random}}', '{{range(1,255)|random}}', '{{range(1,255)|random}}']
    - service: light.turn_on
      entity_id: light.bedroom1

I cant make it work.
Is it possible to make a loop in an automation?
So i can change color in the automation with random color.
And make it loop so color changes again?

```    - service: light.turn_on
  data_template:
    entity_id: light.kleine_tafel
    brightness: 255
    rgb_color: ['{{range(1,255)|random}}', '{{range(1,255)|random}}', '{{range(1,255)|random}}']```

Hi,

I don’t know what kleine tafel :slight_smile: means but you can try the settings below. Either use the automation triggered at each 15 min and 56 sec or the scripts. Or you can use an automation to call the first script (for which you have a greater flexibility). In either case, turning off the input boolean will stop the loop.

Do you know how to create the components outside configuration.yaml (I have the configuration split into multiple files)?

Input boolean

loop_kleine_tafel:
  name: 'Enable random light loop'
  icon: mdi:power
  initial: on

automation:

- alias: loop_kleine_tafel
  initial_state: 'on'
  trigger:
    - platform: time
      minutes: '/15'
      seconds: 56
  condition:
    condition: and
    conditions:
      - condition: state
        entity_id: input_boolean.loop_kleine_tafel
        state: 'on'
  action:
      - service: light.turn_on
        data_template:
          entity_id: light.kleine_tafel
          brightness: 255
          rgb_color: ['{{range(1,255)|random}}', '{{range(1,255)|random}}', '{{range(1,255)|random}}']

scripts:

loop_kleine_tafel:
  alias: 'Loop light'
  sequence:
    - service: script.turn_on
      entity_id: script.random_kleine_tafel
    - delay: '00:15:56'
    - service: script.turn_on
      entity_id: script.loop_kleine_tafel_turnon
loop_kleine_tafel_turnon:
  alias: 'Loop turnon'
  sequence:
    - service: script.turn_off
      entity_id: script.loop_kleine_tafel_iterate
    - service: script.turn_on
      entity_id: script.random_kleine_tafel
    - delay: '00:15:56'
    - service: script.turn_on
      entity_id: script.loop_kleine_tafel_iterate
loop_kleine_tafel_iterate:
  alias: 'Loop iterate'
  sequence:
    - service: script.turn_off
      entity_id: script.loop_kleine_tafel_turnon
    - service_template: >
        {% if states.input_boolean.loop_kleine_tafel.state == "off" %}
          script.turn_off
        {% else %}
          script.turn_on
        {% endif %}
      data:
        entity_id: script.loop_kleine_tafel_turnon
    - service: input_boolean.turn_on
      data:
        entity_id: input_boolean.loop_kleine_tafel
random_kleine_tafel:
  alias: 'Random light'
  sequence:
    - service: light.turn_on
      data_template:
        entity_id: light.kleine_tafel
        brightness: 255
        rgb_color: ['{{range(1,255)|random}}', '{{range(1,255)|random}}', '{{range(1,255)|random}}']

Hi all,

Brand new here to Home Assistant and I tell you it wasn’t without some serious effort to finally get it up and running. I now am able to control all my Mi-Light groups with Google Assistant via Home Assistant.
But, I do have one problem that I don’t know how to address. One group of lights whenever I ask Google to turn them on, they always come on at about 50% brightness. I can of course increase the brightness with Google, but why is this particular group of bulbs defaulting to lower Brightness?

If you know how to help, please explain as you would to a 4yr old (kind of), as I am still trying to understand how to create / modify Scripts etc…

Thanks,