hcoohb/hass-yeelightbt

How to find MAC address?

Closed this issue · 11 comments

As in the subject, how to find MAC address of my yeelight bedside BT lamps?
I tried to find it inside yeelight app and xiaomi home app, but both do not show the MAC address....
I am running HASSIO 0.114.3 on a RPi 4.

Hi,

I am hoping to be able to code a discover service for HA so that it is detected automatically... when I have some time.

In the meantime, if you do not know the MAC, if using Android, you can dl the app called BLE Scanner by Bluepixel Technologies.

  • Turn the lamp off,
  • push the top btn for 10sec and plug the lamp (while still holding the btn).
    This will reset the lamp and it will expose itself (assuming no other app is connecting with it directly).
    Use the app and search for a device with the name XMCTD_. The Mac is displayed, it should start with F8:24:...

But just so you are aware, others have reported some issues with HASSIO... we are trying to find out what is happening: #3

Hi,

I have just pushed a new version that allow to scan devices nearby when you set it up from the integration menu.
Please note however that I do not know if HASSIO has the correct permissions to scan BLE devices.
But feel free to give it a go and report please

Yes, ok, i found how to discover MAC address and now i have all my three yeelight lamps working good, but if i try to automate a change in the color or in the brightness (like i do with wifi yeelight lamps) it fails. The color is always the same i set through the yeelight app. Is there a syntax to use in automations for these lamps like 'color' or 'brightness' or transition' like for the wifi lamps?

Automation should work... I have to say, I do not use HA for automation so I haven't really tested that part.

Calling the turn_on service with brightness or rgb_color parameter definitely works (Developer Tools>Services>light.turn_on and adding wanted parameters) so you should be able to use this in automation.
Would you be able to share the yaml for the automation that does not work?
I am sure we can make it work. (Transition is not going to be supported by this lamp though)

btw, unrelated question, but you are on HASSIO, right?
Were you able to scan using the Integration menu?

Thanks

This is my automation to light up the lamps when motion sensor is activated:

- alias: Accendi Luce Camera Letto Sera
  initial_state: on
  trigger:
    platform: state
    entity_id: binary_sensor.motion_sensor_158d0001a92ca1
    to: 'on'
  condition:
    condition: or
    conditions:
      - condition: sun
        after: 'sunset'
      - condition: time
        before: '01:00:00'
  action:
    - service: light.turn_on
      entity_id:
        - light.yeelight_3
        - light.yeelight_4
        - light.bedside_1
        - light.bedside_2
        - light.bedside_3        
      data_template:
        transition: 2
        brightness: 255
        rgb_color: ['{{ (range(0, 255)|random) }}','{{ (range(0, 255)|random) }}','{{ (range(0, 255)|random) }}']
    - delay: 00:01:30
    - service: light.turn_off
      entity_id:
        - light.yeelight_3
        - light.yeelight_4
        - light.bedside_1
        - light.bedside_2        
        - light.bedside_3

But the rgb_color option is working with the first two lights (wifi lights) and not working with the bt lamps (the last three).
The color of the bt lamps is always the one chosen from the yeelight app. About the brightness i think it's working (still not tried).
This option seems not working also if called from developer->services->light.turn_on with those parameters.
Yes, i am on HASSIO and i was able to use scan from integration menu.

I tested the lamps rgb_color from the developer->service->light.turn_on with the parameters i have in the automation (disabling the random template) and from there it works, but still continue to not working from automations....

Did you find something related to my problem with automations and rgb_color options?

Hello,
So I played a bit around this morning, and I see what you meant, the colors would always be the last set when using your automation.
This happened due to the light ignores any command while it it transitioning from off to on.
So I have set a delay properly for those commands.

So your animation should now work (note that transition is not supported so it will be ignored for the bedside).
However, we cannot set a new color for the lamp while it is off. So the the light will always set to the previous state while turning on, and straight away switch to the new parameters given by the automation.
Due to the limitation, I do not really see a way around.

All changes are in v0.11.2
Let me know if that solves it!

Ok, thanks, i'll test the new release and let you know....

It works GREAT !!!
Thanks for all....

With latest version, there is no need to find the mac address manually anymore.

Closing for now