home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.62k stars 30.38k forks source link

Yeelight lights not found anymore #35862

Closed sineverba closed 4 years ago

sineverba commented 4 years ago

The problem

Upgraded from 0.109.6 to 0.110.0. Yeelights are not discovered anymore. In Frontend, yeelights are not found (yellow line). They worked also on 0.109.6 (and previous)

Environment

Problem-relevant configuration.yaml

configuration.yml


default_config:

history:
  include:
    entities:
      - alarm_control_panel.antifurto
      - switch.shelly01

logbook:
  include:
    entities:
      - alarm_control_panel.antifurto
      - switch.shelly01

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
http:
  use_x_forwarded_for: true
  trusted_proxies: 127.0.0.1

lovelace:
  mode: yaml
  resources:
    - url: /local/vertical-stack-in-card.js?v=0.1.3
      type: js

#Influx
influxdb: !include influxdb.yaml

#Python Scripts
python_script:

#telegram
telegram_bot:
  - platform: polling
    api_key: !secret telegram_bot_api_key_1
    allowed_chat_ids:
       - !secret telegram_bot_allowed_chat_ids_1
       - !secret telegram_bot_allowed_chat_ids_2

notify:
  - name: Alessandro
    platform: telegram
    chat_id: !secret telegram_bot_allowed_chat_ids_1

  - name: Security
    platform: telegram
    chat_id: !secret telegram_bot_allowed_chat_ids_2

# mysensors
mysensors:
  gateways:
    - device: 0.0.0.0
      persistence_file: '/home/sineverba/.homeassistant/mysensor_persistence.json'
  persistence: true
  version: '2.2'

# mqtt
mqtt:
  broker: 127.0.0.1
  port: 1883
  client_id: homeassistant
  username: !secret mqtt_username
  password: !secret mqtt_password

# Text to speech
tts:
  - platform: google_translate

# Cloudflare
cloudflare:
  email: !secret cloudflare_email
  api_key: !secret cloudflare_api_key
  zone: !secret cloudflare_zone
  records:
    - !secret cloudflare_zone

alarm_control_panel: !include alarms.yaml
switch: !include switches.yaml
light: !include lights.yaml
sensor: !include sensors.yaml
input_boolean: !include booleans.yaml
input_number: !include numbers.yaml
weather: !include weathers.yaml
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml

homeassistant:
  customize: !include customize.yaml

speedtestdotnet:
  manual: true
  server_id: 7898

#Logger
logger:
  default: critical
  logs:
    homeassistant.components.http.ban: warning
    homeassistant.components.mysensors: info
    mysensors: info
light.yeelight_ct2_7cxxxx:
  friendly_name: Ingresso
light.yeelight_color1_7xxxxx6:
  friendly_name: Salone
  icon: mdi:floor-lamp
light.yeelight_strip1_78xxxxx:
  friendly_name: Letto
  icon: mdi:bed-empty

Traceback/Error logs

Logger: homeassistant.helpers.service
Source: helpers/service.py:423
First occurred: 19:38:27 (2 occurrences)
Last logged: 19:38:51

Unable to find referenced entities light.yeelight_color1_7811dcexxxx, light.yeelight_ct2_7cxxxxxx6

Additional information

Workaround

In configuration.yml


#Discovery
discovery:
  ignore:
    - yeelight

yeelight:
  devices:
    192.168.1.120:
      name: Salone
    192.168.1.121:
      name: Letto
    192.168.1.122:
      name: Ingresso
#    - igd
probot-home-assistant[bot] commented 4 years ago

Hey there @rytilahti, @zewelor, mind taking a look at this issue as its been labeled with a integration (yeelight) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

j1mco commented 4 years ago

Also experiencing this problem, automatic or manual, no error logs as I've not added the lights previously.

BrenTeck commented 4 years ago

Hi I don't know if this is a new change but it could help others with the same problem. It got it working for me.

  1. Go to the Yeelight app.
  2. Go to menu
  3. Go to LAN control and make sure each device has LAN Control allowed.
  4. Go to HA configuration.yaml and use code

    yeelight

    yeelight: devices: 192.168.x.xxx: name: My Light model: color1

    end yeelight

sineverba commented 4 years ago

Yes. I got re-working re-adding via IP.

But before 0.110 they worked.

See my previous post and workaround.

Il ven 29 mag 2020, 11:22 BrenTeck notifications@github.com ha scritto:

Hi I don't know if this is a new change but it could help others with the same problem. It got it working for me.

  1. Go to the Yeelight app.
  2. Go to menu
  3. Go to LAN control and make are each device has LAN Control allowed.
  4. Go to HA configuration.yaml and use code

    yeelight

    yeelight: devices: 192.168.x.xxx: name: My Light model: color1

    end yeelight

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/35862#issuecomment-635870814, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUDIWWREMQGW7LU2I4CFXDRT55FRANCNFSM4NGFWIJA .

cybe commented 4 years ago

Got this issue as well. Model is ceiling1 if that matters.

zewelor commented 4 years ago

Is it really 0.110 version ? Latest stable ? If yes there was no yeelight specific changes afaik. There are some changes in 0.111 but its in dev now.

cybe commented 4 years ago

Is it really 0.110 version ? Latest stable ? If yes there was no yeelight specific changes afaik.

Yes.

But also: Before switching to 1.110 I updated the firmware on the three yeelight devices I have. That might have something to do with it. What about the others?

sineverba commented 4 years ago

It is really 0.110.x version. And not, I did not update the Yeelight firmware, before or after HA update.

cybe commented 4 years ago

Discovery from within the yeelight library does still work:

<Enter HA Docker container>
# python
>>> import yeelight
>>> yeelight.discover_bulbs()
[{'ip': '192.168.178.29', 'port': 55443, 'capabilities': {'id': '0x0000000004a1____', 'model': 'ceiling1', 'fw_ver': '192', 'support': 'get_prop set_default set_power toggle set_bright set_scene cron_add cron_get cron_del start_cf stop_cf set_ct_abx set_name set_adjust adjust_bright adjust_ct', 'power': 'on', 'bright': '2', 'color_mode': '2', 'ct': '2767', 'rgb': '0', 'hue': '0', 'sat': '0', 'name': ''}}]
cybe commented 4 years ago

After a bit of research this problem might very well be caused by the firmware update. As of now, the lights are discovered via MDNS. However, the official supported method is SSDP. Support for MDNS might supposedly be removed by firmware updates and is generally not supported by newer HomeKit-compatible devices.

Some references: #32493, #26574 and #35448

sineverba commented 4 years ago

My yeelights are outdated from... 1 year? I.e. in my smartphone I did not have the APP... Bought them, setup LAN control 2years ago and "forgot it".

So, I don't think issues is firmware update. I have them requesting update.

cybe commented 4 years ago

So I started a second instance of HA core in the previously known good version 1.109.6. My light is not getting discovered either. Furthermore: I ran some custom MDNS discovery tool on my network, that was also not able to discover the light. Other MDNS-capable devices were getting detected. Therefore I'm still leaning towards the firmware upgrade in my case.

It might be possible, that my problem is different to OPs. @sineverba are you (1) able to test the discovery with HA core 1.109.6.? And (2) could you test discovery with SSDP as I described in my previous post?

35448 lays the groundwork for using SSDP. But that particular PR only includes model detection. A separate PR is needed for general device detection.

rytilahti commented 4 years ago

The mdns functionality got removed on newer firemwares of homekit-supporting(?) devices at some point by yeelight due for maintenance reasons, so that would explain why you are not seeing mdns responses. There is an issue on github somewhere discussing the details what needs to be done to fix the issue for good.

sineverba commented 4 years ago

@cybe I tried with a docker container with 0.109.6 (followed your instructions) and found 0 bulbs from python ( [])

cybe commented 4 years ago

@cybe I tried with a docker container with 0.109.6 (followed your instructions) and found 0 bulbs from python ( [])

You might misunderstood me: I was aiming to test two separate things to narrow down the issue:

  1. Check if a HA Core downgrade to 0.109.6 is detecting the lights the normal HA way again (MDNS).
  2. Check if SSDP discovery works. You said you started a docker container. It is essential that you start the container with --net=host for SSDP to work. I think it is also necessary for MDNS.
sineverba commented 4 years ago

Oh, you are right. A docker container with 0.109.6 and net=host can find (from python library) the yeelights, but not the frontend.

I cannot revert my installation to 0.109.6 'cause it is the only one I have at the moment, in "production" in my house.

But I can assure that Yeelights worked on version < 0.110.0.

cybe commented 4 years ago

I cannot revert my installation to 0.109.6 'cause it is the only one I have at the moment, in "production" in my house.

But I can assure that Yeelights worked on version < 0.110.0.

Same for me on both ;)

Could you print the output of yeelight.discover_bulbs() here? You may want to obfuscate the id. I'm particularly interested in the firmware version.

sineverba commented 4 years ago

Yes...

[{
    'ip': '192.168.1.122',
    'port': 55443,
    'capabilities': {
        'id': '',
        'model': 'ct_bulb',
        'fw_ver': '16',
        'support': 'get_prop set_default set_power toggle set_bright start_cf stop_cf set_scene cron_add cron_get cron_del set_ct_abx set_adjust adjust_bright adjust_ct set_music set_name',
        'power': 'off',
        'bright': '100',
        'color_mode': '2',
        'ct': '4584',
        'rgb': '0',
        'hue': '0',
        'sat': '0',
        'name': ''
    }
}, {
    'ip': '192.168.1.120',
    'port': 55443,
    'capabilities': {
        'id': '',
        'model': 'color',
        'fw_ver': '70',
        'support': 'get_prop set_default set_power toggle set_bright start_cf stop_cf set_scene cron_add cron_get cron_del set_ct_abx set_rgb set_hsv set_adjust adjust_bright adjust_ct adjust_color set_music set_name',
        'power': 'off',
        'bright': '100',
        'color_mode': '2',
        'ct': '4098',
        'rgb': '16711680',
        'hue': '359',
        'sat': '100',
        'name': ''
    }
}]
cybe commented 4 years ago

Hm, no idea in your case.

sineverba commented 4 years ago

Another issue... Now with 0.111.1

Cannot determine device type for 192.168.1.122, Ingresso. Falling back to white only
zewelor commented 4 years ago

@sineverba It should be fixed via https://github.com/home-assistant/core/pull/36658 . In meantime you can try to set model: color1 . I hope fix will be in 0.111.2, then you can remove model.