scheduler-card
scheduler-card copied to clipboard
Improve actions variables
Checklist
- [X] I checked for similar existing requests (both open and closed) before posting.
- [X] My request is generic, other users may benefit from it too.
- [X] I will participate in further discussion about this feature and can test it (if requested) once it's done.
Proposal
I'm using this card for my vacuum programmation. It's a great card ! But I want to select multiple rooms to clean. And currently, it's possible to select only one room.
To address my issue, I thought 2 solutions:
- Allow select multiple options of variable and set it on array
- Or accept int and array in value property to allow this variables configuration :
Additional info
This is an exemple of configuration with int and array :
variables:
params:
name: Rooms
options:
- value: [21,16,18,...]
name: All rooms
- value: 21
name: Bedroom
- value: 16
name: Bathroom
I see this line to change the value type : https://github.com/nielsfaber/scheduler-card/blob/main/src/config-validation.ts#L74
But I don't know if it's work if we only change 'string'
to ['string', 'int', 'array']
For your information, I call my service like this to clean multiple rooms :
service: vacuum.send_command
data:
entity_id: vacuum.patrick
command: app_segment_clean
params:
- 19
- 16
- 21
So have you any solution to allow to do that ?
Thank you !
I'm sorry, but a list can only contain string values. It will not be sufficient to change the config validation file. As a workaround, perhaps you could consider to create a script which you can execute with the name of the room (as variable) you want to clean, and it sends the correct command (with list of numbers) to your vacuum?
Thank you for your reply ! I will use your solution with a script. I can close this issue, thanks !