home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.38k stars 30.64k forks source link

`zwave_js.multicast_set_value` throws error with label as a target #115131

Open bachya opened 7 months ago

bachya commented 7 months ago

The problem

I cannot call this service with a label as a target, even though the UI allows for labels as targets. This action:

service: zwave_js.multicast_set_value
data:
  command_class: "112"
  property: "18"
  value: 15
enabled: true
target:
  label_id: dimmable_lights

CleanShot 2024-04-07 at 10 33 12

...shows the error below.

Note that this alteration:

service: zwave_js.multicast_set_value
data:
  command_class: "112"
  property: "18"
  value: 15
enabled: true
target:
  entity_id: "{{ label_entities('dimmable_lights') }}"

...does work as expected.

What version of Home Assistant Core has the issue?

core-2024.4.1

What was the last working version of Home Assistant Core?

N/A

What type of installation are you running?

Home Assistant OS

Integration causing the issue

zwave_js

Link to integration documentation on our website

https://www.home-assistant.io/integrations/zwave_js/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.script.good_morning_mode
Source: helpers/script.py:1855
integration: Script (documentation, issues)
First occurred: 10:36:30 AM (4 occurrences)
Last logged: 10:37:17 AM

Modes: Good Morning Mode: Parallel action at step 1: parallel 1: Error executing script. Invalid data for call_service at pos 1: extra keys not allowed @ data['label_id']
Modes: Good Morning Mode: Error executing script. Invalid data for parallel at pos 1: extra keys not allowed @ data['label_id']

Additional information

No response

home-assistant[bot] commented 7 months ago

Hey there @home-assistant/z-wave, mind taking a look at this issue as it has been labeled with an integration (zwave_js) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `zwave_js` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign zwave_js` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


zwave_js documentation zwave_js source (message by IssueLinks)

issue-triage-workflows[bot] commented 4 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

bachya commented 4 months ago

Still open.

alexschneider commented 3 months ago

+1. Ran into this issue myself.

alexschneider commented 3 months ago

The "ugly hack" that I used, in case anyone else runs into this issue in the future before it gets fixed, is to add all the entities I want to control to a group, and then use templates to extract the entity IDs from that group.

service: zwave_js.multicast_set_value
metadata: {}
data:
  command_class: "38"
  endpoint: "0"
  property: Down
  value: true
target:
  entity_id: >-
    {{ expand(state_attr('light.shades',
    'entity_id'))|map(attribute='entity_id')|list }}

I'm sure it's possible to do it more elegantly by writing a template based on the label but this works for me.