Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 107829

How to use IF in blueprints

$
0
0

I would like todo an IF formula based on my select options (jc_control:)
Cant figure it out. thanks for the help

blueprint:
  name: ScriptLightON live
  
  description: Turn on lights Living
  domain: script
  author: JC Dreyfus
  #icon: mdi:lightbulb
  input:
    light_target:
      name: Light #!input light_target
      selector:
        entity:
          domain:
            - light

    jc_control:
      name: Use The Light Control Options
      description: Light Control Options
      default: []
      selector:
        select:
          multiple: false
          options:
            - label: Use Only Brightness
              value: use_brightness
            - label: Use Color Temperature Kelvin
              value: use_color_tempetature  
            - label: Use Color Name
              value: use_color_name
            - label: Use Color RGB
              value: use_color_rgb  
            - label: Use Color HS
              value: use_color_hs

    light_brightness:
      name: Brightness
      description: The brightness setting for the lights when they are turned ON.
      default: 35
      selector:
        number:
          min: 1
          max: 100
          mode: box
          step: 1
          unit_of_measurement: '%'

    light_color_kelvin:
      name: Color Temperature 
      description: in Kelvin
      default: 4600
      selector:
        number:
          min: 2000
          max: 8000
          mode: box
          step: 100
          unit_of_measurement: 'kelvin'

    light_color:
      name: Color Name
      description: The Color Name
      default: 
      selector:
        text:

    light_color_rgb:
      name: Color RGB
      description: The colour temperature setting for the lights when they are turned ON.
      default: 
      selector:
        color_rgb:

    light_color_hs:
      name: Color HS
      description: The colour temperature setting for the lights when they are turned ON.
      default: 
      selector:
        object:

#variables:
#  light_target: !input light_target
#  use_brightness: !input use_brightness



alias: "Lights On"
sequence: 

  - if:
      - condition: state
        entity_id: !input jc_control
        state: use_brightness
    then:
      - data:
          brightness_pct: !input light_brightness
          color_temp: !input light_color_kelvin
        continue_on_error: true
        target:
          entity_id: !input light_target
        action: light.turn_on

  
mode: restart
max_exceeded: silent
icon: mdi:lightbulb

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 107829


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>