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
Can anyone help me understand why this does not work?
- type: custom:button-card icon: mdi:calendar-alert-outline show_icon: false name: Create Event lock: enabled: > [[[ if (input_text.event_title.state == "") return "true"; else return "false"; ]]]
Strangely, when I save it the "enabled: >" becomes "enabled: |"
The Create Event button does not even show up unless I put the [[[...]]] in quotes (which doesn't make it work either)
I've also tried: lock: enabled: "[[[ return input_text.event_title.state === ''; ]]]"
(that is === then 2 single quotes) ,and a variety of slightly different versions...
The Create Event button does not even show up unless I put the [[[...]]] in quotes (which doesn't make it work either)
Basically, I want the lock to be on until the event title is not blank.
Thanks,
Matthew
EDIT:
Oh, I got it (Ok, Gemini got it). The below worked: - type: custom:button-card name: Create Event lock: enabled: | [[[ return states['input_text.event_title'].state === ''; ]]]
I don't know why the > becomes a |, but it works like that. I also thought I'd tried every combination, including this, but there you go...
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Can anyone help me understand why this does not work?
- type: custom:button-card icon: mdi:calendar-alert-outline show_icon: false name: Create Event lock: enabled: > [[[ if (input_text.event_title.state == "") return "true"; else return "false"; ]]]
Strangely, when I save it the "enabled: >" becomes "enabled: |"
The Create Event button does not even show up unless I put the [[[...]]] in quotes (which doesn't make it work either)
I've also tried:
lock: enabled: "[[[ return input_text.event_title.state === ''; ]]]"
(that is === then 2 single quotes) ,and a variety of slightly different versions...
The Create Event button does not even show up unless I put the [[[...]]] in quotes (which doesn't make it work either)
Basically, I want the lock to be on until the event title is not blank.
Thanks,
Matthew
EDIT:
Oh, I got it (Ok, Gemini got it). The below worked:
- type: custom:button-card name: Create Event lock: enabled: | [[[ return states['input_text.event_title'].state === ''; ]]]
I don't know why the > becomes a |, but it works like that. I also thought I'd tried every combination, including this, but there you go...
Beta Was this translation helpful? Give feedback.
All reactions