Why wont this automation run?

If anyone has any ideas that would be very helpful

- alias: "7pm Dim House"
  trigger:
- platform: time
  at: '19:00:00'
  action:
- service: light.turn_on
  data:
    entity_id:
      - light.livingroom
      - brightness_pct: 60
      - light.yeelight_strip_7c49ebaee4a7
      - brightness_pct: 60
      - light.top_of_stairs
      - brightness_pct: 10
      - light.hall_light_stairs
      - brightness_pct: 5
      - light.bathroom
      - brightness_pct: 30
      - light.bedroom
      - brightness_pct: 40

Do you see any errors in the log as that code does not look formatted correctly?

1 Like

Invalid service data for light.turn_on: Entity ID ordereddict([('brightness_pct', 10)]) is an invalid entity id for dictionary value @ data['entity_id']. Got ['light.bedroom', OrderedDict([('brightness_pct', 10)]), 'light.top_of_stairs', OrderedDict([('brightness_pct', 10)])]

There you go.

Based on your config example, you are listing out brightness_pct as entities. Those are not entities. Those are attributes for entities.

I would work on fixing your YAML. :wink:

1 Like

Right! I see that now! so in what way would i implement custom brightness without listing them as entities?

- service: light.turn_on
  data_template:
    entity_id: light.zw_uplight_dimmer_level
    brightness_pct: >-
      {%- if states.sensor.dark_sky_cloud_coverage.state | int >= 80 %}
        75
      {%- elif states.sensor.dark_sky_cloud_coverage.state | int >= 60 %}
        50
      {%- elif states.sensor.dark_sky_cloud_coverage.state | int >= 40 %}
        30
      {%- endif %}
1 Like

A brightness isn’t an entity. It is an attribute.

light.livingroom is an entity

Please read this as it has your answer

1 Like
# Example configuration.yaml entry
automation:
- id: one
  alias: Turn on light when motion is detected
  trigger:
    - platform: state
      entity_id: binary_sensor.motion_1
      to: 'on'
  action:
    - service: light.turn_on
      data:
        entity_id: light.living_room
        brightness: 255
        kelvin: 2700

Thank you for your help it was really appreciated. After looking into using a scene to fix this i think there is limitations that i wouldn’t be able to set this many lights in the 1 automation i think.

You can do all this in an automation.

I will send you money via PP if you can help point me in the direction for my solution. I just can’t seem to find the answer with trial and error and looking through the entities and attributes. I’m sorry to be annoying

The spacing may be incorrect, double check it first.

- alias: "7pm Dim House"
  trigger:
- platform: time
  at: '19:00:00'
  action:
- service: light.turn_on
  data:
    - entity_id:
      light.livingroom
      brightness_pct: 60
    - entity_id:
      light.yeelight_strip_7c49ebaee4a7
      brightness_pct: 60
    - entity_id:
      light.top_of_stairs
      brightness_pct: 10
    - entity_id:
      light.hall_light_stairs
      brightness_pct: 5
    - entity_id:
      light.bathroom
      brightness_pct: 30
    - entity_id:
      light.bedroom
      brightness_pct: 40

I don’t know what planet everyone is on today, but…

Problem number 1 - you are declaring it as 3 automations, one with an alias and an empty trigger key, one with only an action that has trigger keys in it, and one that is listing like a million entity_id’s all over the place.

It’s so bad I don’t even have the mental strength to go through it and fix all the errors.

Read the automation docs and try again.

1 Like

spacing is all off:

- alias: "7pm Dim House"
  trigger:
    - platform: time
      at: '19:00:00'
  action:
    - service: light.turn_on
      data:
        entity_id: light.livingroom
        brightness_pct: 60
    - service: light.turn_on
      data:
        entity_id: light.yeelight_strip_7c49ebaee4a7
        brightness_pct: 60
    - service: light.turn_on
      data:
        entity_id: light.top_of_stairs
        brightness_pct: 10
    - service: light.turn_on
      data:
        entity_id: light.hall_light_stairs
        brightness_pct: 5
    - service: light.turn_on
      data:
        entity_id: light.bathroom
        brightness_pct: 30
    - service: light.turn_on
      data:
        entity_id: light.bedroom
        brightness_pct: 40
2 Likes

@petro has my share of mental strength today :arrow_heading_up:

1 Like

Thank you for spending time to help fix this issue. I have learned from this and will improve.

1 Like