Blueprint Free@Home - light switch to non-Free@Home (Hue, ...)

Hello everyone,

i am using the awesome integration from jheling to connect my Busch & Jäger/ABB Free@Home-System to home assistant. I am currently struggeling to create a blueprint to connect a light switch to my hue lightbar.
Could anybody help me? I can’t find the error!

The first set for me is to fix the blueprint only for color temperature. Later I want to add features like RGB colors or time related settings!

Thanks!

Code:

blueprint:
  name: Free@Home button/switch to light - KELVIN only
  description: Connect Free@Home switch to non Free@Home light
  domain: automation
  input:
    freeathome_sensor:
      name: Free@Home Senor
      selector:
        entity:
          integration: freeathome
          domain: binary_sensor
    light_target:
      name: Light
      description: Light which will be controlled with this automation.
      selector:
        target:
          entity:
          - domain:
            - light
    light_color_temperature:
      name: Color Temperature
      description: The color temperature setting for the lights when they are turned
        ON.
      default: 3000
      selector:
        number:
          min: 2000.0
          max: 8000.0
          mode: slider
          step: 100.0
          unit_of_measurement: kelvin
    light_brightness:
      name: Brightness
      description: The brightness setting for the lights when they are turned ON.
      default: 50
      selector:
        number:
          min: 1.0
          max: 100.0
          mode: slider
          step: 1.0
          unit_of_measurement: '%'
    light_transition_on:
      name: Transition - ON
      description: The transition setting for the lights when they are turned ON.
      default: 1
      selector:
        number:
          min: 0.0
          max: 5
          mode: slider
          step: 0.2
          unit_of_measurement: seconds
    light_transition_off:
      name: Transition - OFF
      description: The transition setting for the lights when they are turned OFF.
      default: 5
      selector:
        number:
          min: 0.0
          max: 60.0
          mode: slider
          step: 1.0
          unit_of_measurement: seconds

mode: single
max_exceeded: silent

trigger:
  - platform: state
    entity_id: !input freeathome_sensor
    from: "off"
    to: "on"
  - platform: state
    entity_id: !input freeathome_sensor
    from: "on"
    to: "off"

action:
  - choose:
      - conditions:
          - condition: state
            entity_id: !input freeathome_sensor
            state: "on"
            sequence:
              - service: light.turn_on
                data:
                  color_temp: !input light_color_temperature
                  transition: !input light_transition_on
                  brightness: !input light_brightness
                entity_id: !input light_target
    default:
      - service: light.turn_off
        data:
          transition: !input light_transition_off
        target: !input light_target

You should always write an automation (or script) that does what you want before you write a Blueprint. What you are trying to do there would take just a few minutes using the Automation UI editor.

Besides that I would avoid target selectors unless you know how they work. I don’t use them.

The target selector is a rather special selector, allowing the user to select targeted entities, devices or areas for service calls. The value of the input will contain a special target format, that is accepted by service calls.

1 Like

Thanks for the hint!
I created an automation. I am not sure if I should convert it to an blueprint. I will need this a couple of times!
Do you know if I could avoid the helpers in the automation?

alias: Wohnzimmer Hue Lightbars - 2 Modes
description: Free@Home Taster
trigger:
  - platform: state
    entity_id:
      - binary_sensor.wohnen_2_tur_rt_wohnzimmer
    id: Taste oben
  - platform: state
    entity_id:
      - binary_sensor.wohnen_2_tur_rb_wohnzimmer
    id: Taste unten
condition: []
action:
  - choose:
      - conditions:
          - condition: and
            conditions:
              - condition: trigger
                id:
                  - Taste oben
              - condition: state
                entity_id: input_boolean.helper_wohnzimer_huelight_mode_1
                state: "off"
        sequence:
          - service: light.turn_on
            data:
              transition: 1
              color_temp: 445
              brightness_pct: 100
            target:
              entity_id: light.lightbars_wohnzimmer
          - service: input_boolean.turn_on
            data: {}
            target:
              entity_id: input_boolean.helper_wohnzimer_huelight_mode_1
          - service: input_boolean.turn_off
            data: {}
            target:
              entity_id: input_boolean.helper_wohnzimer_huelight_mode_2
      - conditions:
          - condition: and
            conditions:
              - condition: trigger
                id:
                  - Taste unten
              - condition: state
                entity_id: input_boolean.helper_wohnzimer_huelight_mode_2
                state: "off"
        sequence:
          - service: light.turn_on
            data:
              transition: 1
              brightness_pct: 100
              color_name: darkviolet
            target:
              entity_id: light.lightbars_wohnzimmer
          - service: input_boolean.turn_on
            data: {}
            target:
              entity_id: input_boolean.helper_wohnzimer_huelight_mode_2
          - service: input_boolean.turn_off
            data: {}
            target:
              entity_id: input_boolean.helper_wohnzimer_huelight_mode_1
      - conditions:
          - condition: or
            conditions:
              - condition: and
                conditions:
                  - condition: trigger
                    id:
                      - Taste oben
                  - condition: state
                    entity_id: input_boolean.helper_wohnzimer_huelight_mode_1
                    state: "on"
              - condition: and
                conditions:
                  - condition: trigger
                    id:
                      - Taste unten
                  - condition: state
                    entity_id: input_boolean.helper_wohnzimer_huelight_mode_2
                    state: "on"
        sequence:
          - service: light.turn_off
            data: {}
            target:
              entity_id: light.lightbars_wohnzimmer
          - service: input_boolean.turn_off
            data: {}
            target:
              entity_id:
                - input_boolean.helper_wohnzimer_huelight_mode_1
                - input_boolean.helper_wohnzimer_huelight_mode_2
    default: []
mode: single

They look pretty irreplaceable to me.

2 Likes