Using MiLight remote in HASS

Hi,

Do you mean controlling Hue bulbs with MiLight remote?

How did you setup MiLight? As mqtt/mqtt_json/mqtt_template? If using mqtt_json you can try this (can also send RGB, color_temp, etc, just needs the update in the condition). You can template it further by adding wildcards in the mqtt topic (use + instead of 0xAAAA and 1) and setting Hue light name to be extracted from the payload ({{ trigger.topic.split(’/’)[3] }}) so a 4 zone MiLight remote is controlling 4 Hue bulbs. This way, you don’t need 4 automations for each group by templating (below MiLight group 1 is sending its payload to Hue1).

I can’t tested at the moment but I think 3 or 4 automations should cover all the different buttons of the MiLight remote (as I’m unsure all light properties are sent in a single mqtt payload; I recall saturation is separate).

- alias: Milight2Hue
  initial_state: True
  trigger:
    - platform: mqtt
      topic: 'milight_gw/0xAAAA/rgb_cct/1'
  condition: 
    condition: template
    value_template: '{{ "brightness" in trigger.payload }}'  
  action:
    - service: light.turn_on
      data_template:
        entity_id: light.hue1
        brightness: '{{ trigger.payload_json.brightness }}'