Skip to content

Is it possible to apply set_state to multiple entities at once? #24

@szawadski

Description

@szawadski

I would like to have a list of entities to which I would like to apply a new state.
Currently, I am trying the following but it does not work.

action:
    - service: python_script.set_state
      data:
        entity_id:
          - sensor.edisio_2677633030_4cmd
          - sensor.edisio_2677633030_6cmd
          - sensor.edisio_60190726_1cmd
          - sensor.edisio_60190726_3cmd
          - sensor.edisio_60190726_5cmd
          - sensor.edisio_60190726_7cmd
          - sensor.edisio_60190726_8cmd
        state: "OFF"

Should it work or the code of the python script does not take lists into account. I don't understand its logic so I can't check myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions