Input Slider for Color/temp & brightness sliders for Hue bulb?

If a bulb has like Philips Hue that you can change colors/temperature and brightness, you need to push on the bulb icon to get to the slider for the color/temp and brightness. I wine is it possible to have the sliders directly on the first page under or above the on/off switch? So that I don’t need to access some kind of sub menu.

I have seen that it’s possible to use Input Slider to do that, but I can’t get it to work, this is what I have put in my configuration.yaml file (see below), the light bulb is called “light.ikea_light_2”
Can anyone here help me with what’s wrong.

input_slider:
ikea_brightness:
name: Brightness
initial: 254
min: 0
max: 254
step: 1

automation:

  • alias: IKEA Light - Adjust Brightness
    trigger:
    platform: state
    entity_id: input_slider.ikea_brightness
    action:
    • service: light.turn_on

data_template:
entity_id: light.ikea_light_2
brightness: ‘{{ trigger.to_state.state | int }}’

When pasting your code use the preformatted text option (< / > icon at the top of the editor). This keeps your formatting and will make it easier to determine things like spacing issues.

Do you see any errors in the home-assistant.log? This log file should be in the same folder as your config.yaml or if you click on the circled “i” in the dev tools section you can see the log there.

With some additional info I’m confident someone here can help out.

name your stuff as you would like

your automation should look like

- alias: Change Brightness
  trigger:
    platform: state
    entity_id: input_slider.lamp_bright
  action:
    - service: light.turn_on
      data_template:
        entity_id: light.your_light_here
        brightness: '{{ states.input_slider.lamp_bright.state | int }}'

with your input_slider as so

lamp_bright:
  name: Lamp Brightness
  initial: 0 
  min: 0 
  max: 255
  step: 10 (adjust to how fast you want it to get bright. step 10 assumes ~ 25 steps over full range)
1 Like

As I’m new to HASS I need to ask,

In top of the automation, do I need to have
automation:

And in top of the slider do I need to have
input_slider:

and both config blocks goes into the configuration.yaml?

if they are in the configuration.yaml then they need to have the automation: and input_slider: entry. Just remember to put in proper spacing and you’ll be fine.

I’m not home so that I can ser the bulb, but it looks tight in the webui.

Is it possible to also have a slider for the color temperature, for the Philips Hue white ambiance and IKES Trådfri bulb?

Should be completely doable.

You’d need to create a slider for the color temp. set the min and max to the appropriate values, then create an automation to change. Essentially create everything you did with the brightness( name your slider and automation something different) but instead of

        brightness: '{{ states.input_slider.lamp_temp.state | int }}'

you’d use

        color_temp: '{{ states.input_slider.lamp_temp.state | int }}'   

or

        white_value: '{{ states.input_slider.lamp_temp.state | int }}'

depending on what the device uses

Unfortunately none of the two did change the temp och the white.

When I mouse click on the bulb at the first (home) window, the value I would like to change has the subject “Color Temperature”. Bellow is the code I did try. I used both color_temp and white_temp to see if any of these 2 is working

automation:
- alias: Change Brightness
  trigger:
    platform: state
    entity_id: input_slider.lamp_bright
  action:
    - service: light.turn_on
      data_template:
        entity_id: light.ikea_light_2
        brightness: '{{ states.input_slider.lamp_bright.state | int }}'

- alias: Change Temp
  trigger:
    platform: state
    entity_id: input_slider.lamp_temp
  action:
    - service: light.turn_on
      data_template:
        entity_id: light.ikea_light_2
        color_temp: '{{ states.input_slider.lamp_temp.state | int }}'

- alias: Change White 
  trigger: 
    platform: state 
    entity_id: input_slider.lamp_white 
  action: 
    - service: light.turn_on 
      data_template: 
        entity_id: light.ikea_light_2 
        white_value: '{{ states.input_slider.lamp_white.state | int }}' 

input_slider:
   lamp_bright:
    name: Lamp Brightness
    initial: 0
    min: 0
    max: 255
    step: 10

   lamp_temp:
    name: Lamp Temp
    initial: 0
    min: 0
    max: 255
    step: 10

   lamp_white: 
    name: Lamp white 
    initial: 0 
    min: 0 
    max: 255 
    step: 10 

Could that be helpful to know what value it should be as the color_temp or white_value didn’t help.

ok… i tried it and here’s whatcha need.

color temp uses a value outside of 255
color_temp Color temperature for the light in mireds (154-500) 250

here’s a working automation. you can simplify it all into 1 for a light. I’m sure there’s a way to do an all encompassing but I’m still working on that…

- alias: Change Brightness
  trigger:
    - platform: state
      entity_id: input_slider.lamp_bright
    - platform: state
      entity_id: input_slider.lamp_temp
  action:
    - service: light.turn_on
      data_template:
        entity_id: light.livingroom_1
        brightness: '{{ states.input_slider.lamp_bright.state | int }}'
    - service: light.turn_on
      data_template:
        entity_id: light.livingroom_1
        color_temp: '{{ states.input_slider.lamp_temp.state | int }}'

here’s the working input_slider

lamp_bright:
  name: Lamp Brightness
  initial: 0
  min: 0
  max: 255
  step: 10
lamp_temp:
  name: Lamp Temp
  initial: 300
  min: 154
  max: 500
  step: 10

I just tried this out and it works. Sorry for the confusion

2 Likes

yes! now it’s working.

thank you so much for your help forsquirel

Do you have a screenshot of how this looks in the view? How did you configure it in groups.yaml?

Don’t know if people are still interested in this, but here’s something I got working. The code from @forsquirel didn’t do the trick for me btw.

configuration.yaml


tv_meubel_brigtness:
  name: Brightness lamp 1
  initial: 254
  min: 0
  max: 254
  step: 1
booglamp_brigtness:
  name: Brightness lamp 2
  initial: 254
  min: 0
  max: 254
  step: 1

Next in automations.yaml

- alias: TV Meubel - sterkte
  trigger:
    platform: state
    entity_id: input_number.tv_meubel_brigtness
  action:
    - service: light.turn_on
      data_template:
        entity_id: light.tradfri_tv.meubel
        brightness: "{{ trigger.to_state.state | int }}"
- alias: Booglamp - sterkte
  trigger:
    platform: state
    entity_id: input_number.booglamp_brigtness
  action:
    - service: light.turn_on
      data_template:
        entity_id: light.tradfri_booglamp
        brightness: "{{ trigger.to_state.state | int }}"

Is does the trick by adjust the brightness via the slider, but it doesn’t monitor the current state. So the value starts @ max al the time. Not ideal

30

You put in as initial (starting) value 254. So yes it is starting at max value. Set the initail value to some smaller number and it won’t start at max :wink:

This worked great, thanks alot, but i did one misstake that took me a while to sort out.

if you have version 0.55 or later, imput_slider is renamed to imput_number