Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95481

Control Yeelight RGB and White in Homekit (suggestion)

$
0
0

@andrepia wrote:

Hi guys!
I wanted to share with you a workaround that I’ve been working on to control my Yeelight Bedside Lamp 2, both RGB colors and white temperature, on my Apple Devices using homekit.
Since the original entity will only let me control RGB colors and brightness on homekit entity, I created a “fake light” using light template that replicates the brightness and color temperature from the Bedside Lamp original entity.
Here’s the code I added on configuration.yaml:

light:
  - platform: template # white light fake entity
    lights:
      yeelight_bedside_white: # name of the fake entity to control white
        value_template: "{{ is_state('light.yeelight_bedside' , 'on') }}" #get status from original entity
        level_template: "{{ state_attr('light.yeelight_bedside', 'brightness')|int }}" #get status from original entity
        temperature_template: "{{ state_attr('light.yeelight_bedside', 'color_temp')|int }}" #get status from original entity
        turn_on:
          - service: light.turn_on
            data_template:
              entity_id: light.yeelight_bedside
              color_temp: 500 # every time I turn the Bedside Lamp using fake entity, it will turn on as 'warm white'
        turn_off: 
          - service: light.turn_off
            data_template:
              entity_id: light.yeelight_suite_bedside_ana
        set_level:
          - service: light.turn_on
            data_template:
              entity_id: light.yeelight_suite_bedside_ana
              brightness: "{{ brightness }}"
        set_temperature:
          - service: light.turn_on
            data_template:
              entity_id: light.yeelight_suite_bedside_ana
              color_temp: "{{ color_temp }}"

This way, I have “2 lights” on my homekit for the same device.

IMG_0161

I’m not sure if it applies to other Yeelight and Alexa or Google, since the only yeelight device I have is this Bedside Lamp 2 and I only use Siri on my iPhone for now.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 95481

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>