Yeelights appear as entity, but not device, so how to automate?

There’s a lot of issues out there with Yeelights, but I got mine working fine by binding bulb mac addresses to specific ips and entering the relevant details in the config.yaml

However, these bulbs appear as entities, but not devices so when I use HA to automate the bulbs, there is no option to choose entities to automate only devices.

Any way to add yeelights as devices as well as entities?

I’m using release 0.111.1 installed in a Freenas jail, everything else seems to work fine including a Conbee 2 using ZHA direct with HA to connect to Xiaomi sensors…

Greatful for any assistance chaps.

Hey shanghaiultra,

I don’t know if they need to show up as devices. Most of my physical devices only show up as entities as well, but that’s okay :slight_smile:
To turn on your lights, you can call the service “light.turn_on” and specify an entity_id, this can be used in an automation as well of course.
Have a look at https://www.home-assistant.io/integrations/light/ to see how to use this and at https://www.home-assistant.io/integrations/yeelight/#services for the yeelight specific stuff.

1 Like

Thank you fedot for the swift help. I shall study these links closely. Cheers!

1 Like

You’re welcome!
As I said, a lot of stuff won’t show up as a device, you’ll need to use services in automations to make them do sth.
In the frontend, you can create a light card and specify the entity_id.
The only advantage devices have is an easier setup in the UI :slight_smile:

Ha yes. I was hoping the use the UI but I’ll just have to learn something new and edit the config myself. :slight_smile:

1 Like

You can still use the UI for pretty much everything! Just in the Automations, choose “Call service” as action and choose the right one from the list :smiley:

2 Likes

It’s that simple. Awesome, thanks again.

1 Like

Hi shanghaiultra,

Do you mind showing me what your configuration.yaml looks like for the yeelights. I am trying to ingrate them also. I have assigned a static IP address to them through my router; what’s next?

Looks like you want to manually configure them? They should already show up as discovered entities.
Take a look at the manual setup and report back :slight_smile:

Hey, happy to share.

Steps I took to make sure my Yeelights didn’t keep becoming inactive:

  1. Update firmware to latest version
  2. Ensure LAN control enabled
  3. Make sure Auto-discovery for Yeelights switched off in config (see below)
  4. Indicate type of Yeelight in config (see below)
  5. Stop using Yeelight app after everything is setup
  6. Use my firewall to block Yeelight Bulb IPs from connecting to the internet (don’t know if this is strictly necessary but my Yeelights are stable now)

Suggestions:

  • Double check you set bulbs’ static IPs correctly - I had one number wrong in mine for a week before I spotted my foolish error.

  • Check wi-fi strength in different areas of your home for weak spots.

  • Try changing the wi-fi channel of your router

Please see my personal config below with different kinds of Yeelights. Works solid now after I had a lot of problems initially.

default_config:
discovery:

## Tell HA not to auto-discover yeelights
ssdp:
  ignore:
    - yeelight
    
yeelight:
  devices:
    192.168.2.45:
      name: Living Room
      model: ceiling1
    192.168.2.43:
      name: veronicasstation
      ## add the type of Yeelight below for each bulb, use the app to find out type
      ##then look at "supported models" from here https://www.home-assistant.io/integrations/yeelight/ to get the code
      model: color
      ## turn on music mode so the bulb can accept multiple setting changes in a short time      
      use_music_mode: true
    192.168.2.40:
      name: Mhairilight1
      model: color2
      use_music_mode: true
    192.168.2.41:
      name: Mhairilight2
      model: color2
      use_music_mode: true
    192.168.2.42:
      name: Mhairilight3
      model: color2
      use_music_mode: true
    192.168.2.46:
      name: Halllight
      nightlight_switch_type: light
      model: ceiling1
    192.168.2.28:
      name: kitchenhalllight
      nightlight_switch_type: light
      model: ceiling1
    192.168.2.47:
      name: mavecavestriplight
      model: strip2
      use_music_mode: true`

Hope that helps!