Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
szawadski opened this issue Apr 28, 2024 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@szawadski
Copy link

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.

@rodpayne rodpayne added the enhancement New feature or request label Apr 29, 2024
@rodpayne
Copy link
Owner

No, as it stands right now, you would need to repeat the service call instead.

action:
    - service: python_script.set_state
      data:
        entity_id:
          - sensor.edisio_2677633030_4cmd
        state: "OFF"
    - service: python_script.set_state
      data:
        entity_id:
          - sensor.edisio_2677633030_6cmd
        state: "OFF"

This might be a good enhancement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants