Créer une ambiance avec les lampes Hue

Bonsoir à tous, toujours en mode packages voici un fichier yaml qui permet de choisir l’ambiance lumineuse à l’extérieur ou l’intérieur

input_select:
  outdoor_theme:
    name: Outdoor Lighting Theme
    options:
      - Default
      - Easter
      - Halloween
      - Christmas
    icon: mdi:gift

automation: 
##################################################################
## Outdoor Automations
##################################################################

        ##########################################################
        ## Halloween Lighting
        ##########################################################

  - alias: Outdoor Theme - Halloween On

    trigger:
      - platform: sun
        event: 'sunset'
        offset: '-00:15:00'

    condition:
      - condition: state
        entity_id: input_select.outdoor_theme
        state: 'Halloween'

    action:
      - service: light.turn_on
        entity_id: light.front_door
        data:
          transition: 5
          brightness_pct: 50
          color_name: orange
      - service: light.turn_on
        entity_id: light.garage_1
        data:
          transition: 5
          brightness_pct: 100
          color_name: orange
      - service: light.turn_on
        entity_id: light.garage_2
        data:
          transition: 5
          brightness_pct: 100
          color_name: blueviolet
      - service: light.turn_on
        entity_id: light.garage_3
        data:
          transition: 5
          brightness_pct: 100
          color_name: orange
      - service: light.turn_on
        entity_id: light.outdoor_spot_2
        data:
          transition: 5
          brightness_pct: 100
          color_name: blueviolet
      - service: light.turn_on
        entity_id: light.outdoor_spot_3
        data:
          transition: 5
          brightness_pct: 100
          color_name: orange


        ##########################################################
        ## Easter Lighting
        ##########################################################

  - alias: Outdoor Theme - Easter On

    trigger:
      - platform: sun
        event: 'sunset'
        offset: '-00:15:00'

    condition:
      - condition: state
        entity_id: input_select.outdoor_theme
        state: 'Easter'

    action:
      - service: light.turn_on
        entity_id: light.front_door
        data:
          transition: 5
          brightness_pct: 50
          color_name: yellowgreen
      - service: light.turn_on
        entity_id: light.garage_1
        data:
          transition: 5
          brightness_pct: 100
          color_name: aqua
      - service: light.turn_on
        entity_id: light.garage_2
        data:
          transition: 5
          brightness_pct: 100
          color_name: lime
      - service: light.turn_on
        entity_id: light.garage_3
        data:
          transition: 5
          brightness_pct: 100
          color_name: plum
      - service: light.turn_on
        entity_id: light.outdoor_spot_2
        data:
          transition: 5
          brightness_pct: 100
          color_name: magenta
      - service: light.turn_on
        entity_id: light.outdoor_spot_4
        data:
          transition: 5
          brightness_pct: 100
          color_name: pink
      - service: light.turn_on
        entity_id: light.outdoor_spot_7
        data:
          transition: 5
          brightness_pct: 100
          color_name: turquoise
        ##########################################################
        ## Default Lighting
        ##########################################################

  - alias: Outdoor Theme - Default On

    trigger:
      - platform: sun
        event: 'sunset'
        offset: '-00:15:00'
  
    condition:
      - condition: state
        entity_id: input_select.outdoor_theme
        state: 'Default'

    action:
      - service: light.turn_on
        entity_id: light.front_door
        data:
          transition: 5
          brightness_pct: 50
          kelvin: 2700
      - service: light.turn_on
        entity_id: light.garage_1
        data:
          transition: 5
          brightness_pct: 100
          kelvin: 2700
      - service: light.turn_on
        entity_id: light.garage_2
        data:
          transition: 5
          brightness_pct: 100
          kelvin: 2700


        ##########################################################
        ## Christmas Lighting
        ##########################################################		  


  - alias: Outdoor Theme - Christmas On

    trigger:
      - platform: sun
        event: 'sunset'
        offset: '-00:15:00'

    condition:
      - condition: state
        entity_id: input_select.outdoor_theme
        state: 'Christmas'

    action:
      - service: light.turn_on
        entity_id: light.front_door
        data:
          transition: 5
          brightness_pct: 50
          color_name: green
      - service: light.turn_on
        entity_id: light.garage_1
        data:
          transition: 5
          brightness_pct: 100
          color_name: green
      - service: light.turn_on
        entity_id: light.garage_2
        data:
          transition: 5
          brightness_pct: 100
          color_name: red
      - service: light.turn_on
        entity_id: light.garage_3
        data:
          transition: 5
          brightness_pct: 100
          color_name: green

Et une carte entité toute simple.

type: entities
entities:
  - entity: input_select.outdoor_theme

ambiance

1 J'aime

Merci du partage :+1:

Est-ce que tu as regardé l’utilisation des scènes ?

1 J'aime

Non pas encore.
Je sais qu’on peut créer des scènes comme avec l’application. là c’est juste un besoin rapide pour des évènements précis traités de façon plus simple je trouve.

Oui Tu peux directement reprendre une scene que tu as dans ton application Hue.

script:
  hallowen_on:
    sequence:
      - service: hue.hue_activate_scene
        data:
          group_name: "Extérieur" 
          scene_name: "Halloween"

Par exemple à ajuster selon le group de tes lampes que tu as et le nom de la scène.