Hass IO + yeelight bulb => dimmable

Hi Guys,

This is my first post on this forum. I’m a very beginner and I don’t know anything about programming.
So, I’d like to create, with xiaomi Aqara components something similar to Philips hue.
I have for the moment only one Yeelight RGB light but I’m waiting:

  • Mi Gateway 2
  • a switch with 2 buttons
  • a temperature/humidity sensor
  • a water sensor
  • a motion sensor

For the moment I’d like to be able to control 1 or 2 bulbs with the 2 buttons switch.
What should be the result? I’d like to control the brightness of the bulb using the 2 buttons switch:
Case 1

  1. first button should be ON/Off
  2. Second button should be used to increase the brightness: 1 click 25%, another click 50%, another one 75%, another one 100%, another one 75% (or 25% and so on).

Case 2:

  1. First button should increase the brightness with 25%
  2. Secont button should decrease the brightness with 25%
  3. Push button should be used as ON/OFF switch.

Case 3:

  1. First button should increase the brightness with 25%
  2. Second button should decrease the brightness with 25%
  3. Regular switch should be used as ON/OFF switch.

Any of the cases should be ok, but of course, I prefer first one. I hope that after switching on/off the brightness value will remain.
Anyway, I saw that If I set up a color and a brightness on my bulb (without gateway) using HASS IO and then I cut the power with a physical switch, after power on, the settings will remain.

Can it be done?

Yes, after having the switch’s and bulb’s configured in Hass you can do any of “the Case’s” with automations

Thank you Sthope for reply. I tried to modify a simple script in order to start it with only 50% of brightness but it isn’t working.

Can you please tell me what is wrong in this script?

‘1514803874807’:
alias: Dimmer

  • service: light.turn_on
    entity_id: yeelight
    data:
    brightness: 50
    transition: 3000

Thank you in advance.

Hi joystick,

Have a look at this docs https://home-assistant.io/cookbook/dim_and_brighten_lights/ & https://home-assistant.io/docs/configuration/templating/ they should provide you more help then I can until someone else jumps on board :smiley:

Thank you.
I will start reading. It’s a little difficult for be because programming is very new for me but with a little work I think that I can understand and modify a part of the code.