Controlling brightness with a text input - Message malformed: expected float

Hi! I’m trying to set up an automation to control lights on multiple devices (Tuya led strips) with a single input_number gauge.

Here’s the yaml of the automation I try to create:

alias: Brightness Control
description: ""
trigger:
  - platform: state
    entity_id:
      - input_number.room_brightness_control
condition: []
action:
  - type: turn_on
    device_id: dc1b033*********
    entity_id: 3973f4b7*********
    domain: light
    brightness_pct: '{{ states("input_number.room_brightness_control") | float }}'

    
mode: single

And the error I’m getting is Message malformed: expected float for dictionary value @ data['brightness_pct']

If I put just an integer in the brightness_pct field everything works, so figuring out how to use value from the input_number seems to be the only problem

Thanks!

Device actions do not support templates.

Use the light turn on service call.

Some advice: What happens if I have to replace a device - #2 by tom_l

Thanks! Totally worked!!!

1 Like