Arrgh - I just want a toggle that turns on a Dimmer to 25%

I think my issue is there are so many ways to do a thing, and I just can’t figure out a simple thing.

I have a Multiple Entities Card, with several Lights, you can either toggle them on, or slide the dimmer. Now I just want a Toggle, that will turn on the dimmer to 25%.

But I can’t figure out what I need.

 - entity: light.studio_studio_light
    name: Studio Light Power
  - type: custom:slider-entity-row
    entity: light.studio_studio_light
  - type: custom:slider-entity-row
    entity: light.sittingroom_light
  - type: section
    label: Entry
  - type: custom:slider-entity-row
    entity: light.hallway_main_lights
    name: Hallway Light
  - type: custom:slider-entity-row
    entity: light.frontroom_light

I just would like it, so that when I toggle this on, studio light turns on 25% brightness:

image

Can someone just point me in the right direction, I feel like I am overthinking this, or not googling the correct words.

Thank You

An idea: create a helper (toggle) and use it to trigger an automation. Based on the helper (on or off) create action:


service: light.turn_on
target:
  entity_id: light.YOU_LIGHT_HERE
data:
  brightness: 40

Here is a more complete example:


description: ""
mode: single
trigger:
  - platform: state
    entity_id:
      - input_boolean.YOUR_HELPER
condition: []
action:
  - if:
      - condition: state
        entity_id: input_boolean.YOUR_HELPER
        state: "on"
    then:
      - service: light.turn_on
        target:
          entity_id: light.YOUR_LIGHT
        data:
          brightness_pct: 40
    else:
      - service: light.turn_off
        target:
          entity_id: light.YOUR_LIGHT
        data: {}
1 Like

The issue is that it isn’t a “simple thing”, you just likely haven’t considered the questions and edge cases that “toggle to turn light to 25%” creates. Toggles have a state that needs to be considered. What should the toggle’s state be if the lights are on, but at a brightness other than 25%? Then apply the same type of consideration to the “off” state as well as the events of turning off and turning on.

The easiest way to avoid all of this is to use a button card to effect an action.

show_name: true
show_icon: true
type: button
tap_action:
  action: call-service
  service: light.turn_on
  data:
    brightness_pct: 25
  target:
    entity_id: light.studio_studio_light
entity: light.studio_studio_light
name: Studio Light 25%

Or, if you want to limit it to something that is usable directly in an Entities card as suggested by your example you can use either a Scene or an automation triggered by an Input Button helper. Scenes and Input Buttons are both effectively stateless, so (like the button card) you do not need to worry about defining state-related behavior.

2 Likes

Other option: create a template switch;
“On” turns on and set brightness to 25
“Off” turns off.

2 Likes