Input_select and input_number

hi all

I have a input_number for brightness, it works fine when I use it with a single light bulb entity.

but what i want to try to do is, to have a input_select for all my bulbs, and use one input_number to control the brightness of the bulbs individually.

yaml is

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

input_select:
  list_of_bulbs:
    name: List of Bulbs
    options:
      - light.sofa
      - light.table_lamp
      - light.landing_light
      - light.guest_room_light
      - None
    initial: None
    icon: mdi:lightbulb-outline

my automation

  - alias: "Change Brightness - select"
    trigger:
      - platform: state
        entity_id: input_number.lamp_bright
    action:
      - service: light.turn_on
        data_template:
          entity_id: '{{ states.input_select.list_of_bulbs.state | int }}'
          brightness: '{{ states.input_number.lamp_bright.state | int }}'

but the automation is not triggering when i select the bulb and then change the brightness.

any suggestions
thanking you in advance

Remove the | int from entity_id.

@Capn_jimbo

Try using the service: homeassistant.turn_on

I had trouble using

action:

  • service: light.turn_on

so I made the switch to

  action:
    service: homeassistant.turn_on

PS: Everything else looks good to me? However @pnbruckner may be right about the | int as well?

I mostly write to modbus and use

  action:
    service: modbus.write_register
    data_template:
      hub: hub3
      unit: 3
      address: 3074
      value: "{{ states.input_number.slider1.state|int }}"
1 Like