You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I'm trying to buildd a row of buttons for an irrigation system. One of this buttons is a toggle (play/stop) button. I can make the button show a different icon and style according to state (playing/stopped), but I need to make a different service call according to the state:
Start irrigation:
action: call-serviceservice: irrigation_unlimited.manual_runservice_data:
entity_id: binary_sensor.irrigation_unlimited_c1_z1time: 00:01:00 #<--- I don't need this param for pausing
If I use templates (i.e: putting this card inside a button-card card) I get an error when stopping irrigation because of the extra time field.
Describe the solution you'd like
For my use case, if a value of none makes the time params not being sent in the service call would work for me.
I think a better solution would be to follow the style of state_styles, state_icons and state_text by providing an state_actions that allows you to perform different actions according to the state of the entity.
Describe alternatives you've considered
Putting this card inside a button-card to template the service_data param, but I haven't been able to return a dict that is taken by this card.
Using lovelace-gen seem too much for me just for this card.
Additional context
No response
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I'm trying to buildd a row of buttons for an irrigation system. One of this buttons is a toggle (play/stop) button. I can make the button show a different icon and style according to state (playing/stopped), but I need to make a different service call according to the state:
Start irrigation:
Stop irrigation:
If I use templates (i.e: putting this card inside a
button-card
card) I get an error when stopping irrigation because of the extratime
field.Describe the solution you'd like
For my use case, if a value of
none
makes thetime
params not being sent in the service call would work for me.I think a better solution would be to follow the style of
state_styles
,state_icons
andstate_text
by providing anstate_actions
that allows you to perform different actions according to the state of the entity.Describe alternatives you've considered
Putting this card inside a
button-card
to template theservice_data
param, but I haven't been able to return a dict that is taken by this card.Using lovelace-gen seem too much for me just for this card.
Additional context
No response
The text was updated successfully, but these errors were encountered: