alias: Brightness Master Bath Sync
trigger:
  - platform: state
    entity_id: light.master_bath_1
  - platform: state
    entity_id: light.master_bath_2
  - platform: state
    entity_id: light.master_bath_3
condition:
  condition: and
  conditions:
    - condition: state
      entity_id: light.master_bath_1
      state: 'on'
    - condition: state
      entity_id: light.master_bath_2
      state: 'on'
    - condition: state
      entity_id: light.master_bath_3
      state: 'on'
action:
  service: input_number.set_value
  data_template:
    entity_id: input_number.brightness_master_bath
    value: '{{ trigger.to_state.attributes.brightness|float }}'
