Automação downlights philips zhirui

boa noite, queria desde já agradecer a todos voces pela ajuda prestada, principalmente ao @RodolfoVieira pois foi ele que deu com o gato.

O que estava mal

homeassistant:

###############################################################################
#                                                                             #
#                         INPUT   BOOLEAN                                     #
#                                                                             #
###############################################################################      

###############################################################################
#                                                                             #
#                           A U T O M A Ç Õ E S                               #
#                                                                             #
##############################################################################

#automation: O ERRO ESTAVA AQUI

  - alias: Ligar Downlights 17h 23h
    initial_state: true
    trigger:
      platform: state
      entity_id: binary_sensor.motion_sensor_158d00029be9c3
      from: 'off'
      to: 'on'
    condition:
    - condition: time
      after: '17:00:00'
      before: '23:00:00'
    - condition: numeric_state
      entity_id: sensor.illumination_158d00029be9c3
      below: 20
    action:
      - service: light.xiaomi_miio_set_scene
        data:
          entity_id: light.xiaomi_philips_zhirui
          scene: 1
      - service: light.xiaomi_miio_set_scene
        data:
          entity_id: light.xiaomi_philips_zhirui_2
          scene: 1
          
  - alias: Ligar Downlights 23h 02h
    initial_state: true
    trigger:
      platform: state
      entity_id: binary_sensor.motion_sensor_158d00029be9c3
      from: 'off'
      to: 'on'
    condition:
    - condition: time
      after: '23:00:00'
      before: '02:00:00'
    - condition: numeric_state
      entity_id: sensor.illumination_158d00029be9c3
      below: 20
    action:
      - service: light.xiaomi_miio_set_scene
        data:
          entity_id: light.xiaomi_philips_zhirui
          scene: 3
      - service: light.xiaomi_miio_set_scene
        data:
          entity_id: light.xiaomi_philips_zhirui_2
          scene: 3
          
  - alias: Ligar Downlights 02h 06h30
    initial_state: true
    trigger:
      platform: state
      entity_id: binary_sensor.motion_sensor_158d00029be9c3
      from: 'off'
      to: 'on'
    condition:
    - condition: time
      after: '02:00:00'
      before: '06:30:00'
    - condition: numeric_state
      entity_id: sensor.illumination_158d00029be9c3
      below: 20
    action:
      - service: light.xiaomi_miio_set_scene
        data:
          entity_id: light.xiaomi_philips_zhirui
          scene: 4
      - service: light.xiaomi_miio_set_scene
        data:
          entity_id: light.xiaomi_philips_zhirui_2
          scene: 4
          
  - alias: Ligar Downlights 06h30 09h00
    initial_state: true
    trigger:
      platform: state
      entity_id: binary_sensor.motion_sensor_158d00029be9c3
      from: 'off'
      to: 'on'
    condition:
    - condition: time
      after: '06:30:00'
      before: '09:00:00'
    - condition: numeric_state
      entity_id: sensor.illumination_158d00029be9c3
      below: 20
    action:
      - service: light.xiaomi_miio_set_scene
        data:
          entity_id: light.xiaomi_philips_zhirui
          scene: 2
      - service: light.xiaomi_miio_set_scene
        data:
          entity_id: light.xiaomi_philips_zhirui_2
          scene: 2
          
          

  - alias: Desligar Downlights 17h 09h
    initial_state: true
    trigger:
      platform: state
      entity_id: binary_sensor.motion_sensor_158d00029be9c3
      from: 'on'
      to: 'off'
      for:
        minutes: 4
    condition:
    - condition: time
      after: '17:00:00'
      before: '09:00:00'
    action:
      - service: light.turn_off
        entity_id: light.xiaomi_philips_zhirui
      - service: light.turn_off
        entity_id: light.xiaomi_philips_zhirui_2
        
        
###############################################################################
#                                                                             #
#                           L U Z E S                                         #
#                                                                             #
###############################################################################  

##############################################################################
#                                                                             #
#                         G R O U P S                                         #
#                                                                             #
###############################################################################      

group:

  Iluminação da cozinha:
    control: hidden
    entities:
      - light.xiaomi_philips_zhirui
      - light.xiaomi_philips_zhirui_2
      
  Sensor de movimento cozinha:
    control: hidden
    entities:
      - binary_sensor.motion_sensor_158d00029be9c3
      - sensor.illumination_158d00029be9c3
      
  Automações da Cozinha:
    control: hidden
    entities:
      - automation.ligar_downlights_17h_23h
      - automation.ligar_downlights_23h_02h
      - automation.ligar_downlights_02h_06h30
      - automation.ligar_downlights_06h30_09h00
      - automation.desligar_downlights_17h_09h
    
      
  cozinha:
    view: yes
    name: cozinha
    entities:
      - group.iluminacao_da_cozinha
      - group.sensor_de_movimento_cozinha
      - group.automacoes_da_cozinha

Agora vou partilhar o meu código para as downlights da xiaomi philips zhirui
Espero que seja do vosso agrado e que vos seja útil.

homeassistant:

###############################################################################
#                                                                             #
#                         INPUT   BOOLEAN                                     #
#                                                                             #
###############################################################################      

###############################################################################
#                                                                             #
#                           A U T O M A Ç Õ E S                               #
#                                                                             #
###############################################################################   
automation:

# automações
       
  - alias: Ligar Downlights 17h 23h
    initial_state: true
    trigger:
      platform: state
      entity_id: binary_sensor.motion_sensor_158d00029be9c3
      from: 'off'
      to: 'on'
    condition:
    - condition: time
      after: '17:00:00'
      before: '23:00:00'
    - condition: numeric_state
      entity_id: sensor.illumination_158d00029be9c3
      below: 20
    action:
      - service: light.xiaomi_miio_set_scene
        data:
          entity_id: light.xiaomi_philips_zhirui
          scene: 1
      - service: light.xiaomi_miio_set_scene
        data:
          entity_id: light.xiaomi_philips_zhirui_2
          scene: 1
          
  - alias: Ligar Downlights 23h 02h
    initial_state: true
    trigger:
      platform: state
      entity_id: binary_sensor.motion_sensor_158d00029be9c3
      from: 'off'
      to: 'on'
    condition:
    - condition: time
      after: '23:00:00'
      before: '02:00:00'
    - condition: numeric_state
      entity_id: sensor.illumination_158d00029be9c3
      below: 20
    action:
      - service: light.xiaomi_miio_set_scene
        data:
          entity_id: light.xiaomi_philips_zhirui
          scene: 3
      - service: light.xiaomi_miio_set_scene
        data:
          entity_id: light.xiaomi_philips_zhirui_2
          scene: 3
          
  - alias: Ligar Downlights 02h 06h30
    initial_state: true
    trigger:
      platform: state
      entity_id: binary_sensor.motion_sensor_158d00029be9c3
      from: 'off'
      to: 'on'
    condition:
    - condition: time
      after: '02:00:00'
      before: '06:30:00'
    - condition: numeric_state
      entity_id: sensor.illumination_158d00029be9c3
      below: 20
    action:
      - service: light.xiaomi_miio_set_scene
        data:
          entity_id: light.xiaomi_philips_zhirui
          scene: 4
      - service: light.xiaomi_miio_set_scene
        data:
          entity_id: light.xiaomi_philips_zhirui_2
          scene: 4
          
  - alias: Ligar Downlights 06h30 09h00
    initial_state: true
    trigger:
      platform: state
      entity_id: binary_sensor.motion_sensor_158d00029be9c3
      from: 'off'
      to: 'on'
    condition:
    - condition: time
      after: '06:30:00'
      before: '09:00:00'
    - condition: numeric_state
      entity_id: sensor.illumination_158d00029be9c3
      below: 20
    action:
      - service: light.xiaomi_miio_set_scene
        data:
          entity_id: light.xiaomi_philips_zhirui
          scene: 2
      - service: light.xiaomi_miio_set_scene
        data:
          entity_id: light.xiaomi_philips_zhirui_2
          scene: 2
          
          

  - alias: Desligar Downlights 17h 09h
    initial_state: true
    trigger:
      platform: state
      entity_id: binary_sensor.motion_sensor_158d00029be9c3
      from: 'on'
      to: 'off'
      for:
        minutes: 4
    condition:
    - condition: time
      after: '17:00:00'
      before: '09:00:00'
    action:
      - service: light.turn_off
        entity_id: light.xiaomi_philips_zhirui
      - service: light.turn_off
        entity_id: light.xiaomi_philips_zhirui_2
        
        
###############################################################################
#                                                                             #
#                           L U Z E S                                         #
#                                                                             #
###############################################################################  

##############################################################################
#                                                                             #
#                         G R O U P S                                         #
#                                                                             #
###############################################################################      

group:

  Iluminação da cozinha:
    control: hidden
    entities:
      - light.xiaomi_philips_zhirui
      - light.xiaomi_philips_zhirui_2
      
  Sensor de movimento cozinha:
    control: hidden
    entities:
      - binary_sensor.motion_sensor_158d00029be9c3
      - sensor.illumination_158d00029be9c3
      
  Automações da Cozinha:
    control: hidden
    entities:
      - automation.ligar_downlights_17h_23h
      - automation.ligar_downlights_23h_02h
      - automation.ligar_downlights_02h_06h30
      - automation.ligar_downlights_06h30_09h00
      - automation.desligar_downlights_17h_09h
    
      
  cozinha:
    view: yes
    name: cozinha
    entities:
      - group.iluminacao_da_cozinha
      - group.sensor_de_movimento_cozinha
      - group.automacoes_da_cozinha

Este tópico foi automaticamente fechado 90 dias após a última resposta. Novas respostas não são permitidas.


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


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