Como configurar uma lâmpada xiaomi no hassio ?

Olá malta,

Tenho tentado configurar uma lâmpada yeelight (a versão mais recente RGB) e dá me sempre erro.
Utilizo a seguinte configuração:

light:

  • platform: yeelight
    devices:
    192.168.1.65:
    name: Teste
    transition: 1000

Alguém sabe o quê que posso fazer para resolver esta situação ?

Quando publicares código, selecciona o texto e depois clica no ícone </>. Muito provavelmente o código está mal formatado e falta um “-” antes do IP mas sem formatares o código não dá para ver…

Dá me erro quando ponho um “-” atrás do ip.
Estou a seguir a configuração que está no site : https://www.home-assistant.io/components/light.yeelight/

Sem formatares o código devidamente não te podemos ajudar…

Formatar o código é o quê ?

Formatar o código é seleccionar o texto e depois clicar no ícone </> para que aqui no forum apareça, por exemplo, assim:

kitchen_night_lights_on:
  sequence:
    - service: mqtt.publish
      data_template:
        topic: 'home/indoor/switch/H801-1AAF41/channel/4/set'
        payload_template: '255'
light:
  - platform: yeelight
devices:
  192.168.1.65:
    name: Teste
    transition: 1000

Da linha devices para baixo faltam espaços: Deve ser:

light:
  - platform: yeelight
    devices:
      192.168.1.65:
        name: Teste
        transition: 1000

Continua a dar erro.

Quais são os erros que aparecem no ficheiro home-assistant.log?

`2018-06-30 18:10:21 ERROR (MainThread) [homeassistant.components.hassio] Testing configuration at /config

ERROR:homeassistant.util.yaml:YAML file /config/configuration.yaml contains duplicate key “light”. Check lines 77 and 88.`

O erro parece ser o de teres duas entradas com o nome light. Quais são as tuas linhas 77 e 88 ou melhor ainda podes publicar o ficheiro na totalidade?

`Indentar texto pré-formatado até 4 espaços`
homeassistant:
  # Name of the location where Home Assistant is running
  name: Casa
  # Location required to calculate the time the sun rises and sets
  latitude: 
  longitude: 
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: 20
  # metric for Metric, imperial for Imperial
  unit_system: metric
  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  time_zone: Europe/Lisbon
  # Customization file
  customize: !include customize.yaml

# Show links to resources in log and frontend
#introduction:

# Enables the frontend
frontend:

# Enables configuration UI
config:

http:
  # Secrets are defined in the file secrets.yaml
  api_password: 
  # Uncomment this if you are using SSL/TLS, running in Docker container, etc.
  # base_url: example.duckdns.org:8123

# Checks for available updates
# Note: This component will send some information about your system to
# the developers to assist with development of Home Assistant.
# For more information, please see:
# https://home-assistant.io/blog/2016/10/25/explaining-the-updater/
updater:
  # Optional, allows Home Assistant developers to focus on popular components.
  # include_used_components: true

# Discover some devices automatically
discovery:

# Allows you to issue voice commands from the frontend in enabled browsers
conversation:

# Enables support for tracking state changes over time
history:

# View all events in a logbook
logbook:

# Enables a map showing the location of tracked devices
map:

# Track the sun
sun:

# Weather prediction
sensor:
  - platform: yr

# Text to speech
tts:
  - platform: google

# Cloud
cloud:

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml

xiaomi_aqara:
  discovery_retry: 5
  gateways:
- key: 

light:
  - platform: flux_led
automatic_add: True

homekit:
  filter:
include_domains:
  - light
  - media_player
  - switch

light:
  - platform: yeelight
devices:
  192.168.1.65:
    name: Teste
    transition: 1000

Tal como te tinha dito, não podes ter duas entradas light:, uma para a flux_led e a outra para a yeelight. Tens de juntar as duas numa só.

Mesmo assim voltou a dar erro tal como o auto discovery que o home assistant faz.

E o erro é o mesmo que te aparecia?

Desculpe a demora mas nunca mais vi isto.
Sim o mesmo erro.

Colocaste em Developer mode / “LAN Control” ??
https://forum.yeelight.com/t/developer-mode-how-activate-it-with-the-new-app-redesigned/2602
https://www.yeelight.com/en_US/developer

1 Curtiu

Talvez possa ajudar, mas cada vez que mudo a configuração do HA, antes de gravar, testo sempre se a Syntax está correta, a partir desta tool: http://yaml-online-parser.appspot.com/

2 Curtiram

Obrigado era por isso estar desativado que não estava funcionar.


Copyright © 2017-2021. Todos os direitos reservados
CPHA.pt - info@cpha.pt


FAQ | Termos de Serviço/Regras | Política de Privacidade