I suppose it’s doing its own escaping. And of course if you literally have the input field empty you get the default UNDEF I suppose?
Distinguishing empty string from real null is always a pain.
Circumvent by expiring to"BANANAS" or “idle” or something, and adjust your rules?
Will have to get my mind around modifying text: =items[props.alarmFeedback].state to only work if items[props.alarmFeedback].state != "CLEAR"
Will do some research
Appreciate the assistance.
A thought though - you might find you can directly edit the Item’s expire metadata for the empty string “”
This is not the case, by the way. createTimer() does what it says - creates an free-standing Timer for later execution and then immediately moves on to the next line in the “parent” rule.
So there would be no real advantage to using EXPIRE in this case? It would be more portable to have the rule clear the state for my use case - if there is no real advantage to using EXPIRE in this case?
Well, expire is (usually!) simpler to use.
It’s deliberately unsophisticated - but it does do more than your rule.
This rule blindly sets “” after 5 secs.
But expire will reset its timer every time the Item is updated (to something other than “”). That’s to say, if you post a second message within the 5 secs, it does get not blotted out by the timer from the previous message.
You can modify your rule to offer the same effect, of course, see “motion timer” examples.
Nested mappings are not allowed in compact mappings at line 108, column 15:
text: =(items[props.alarmFeedback].state === "ON") ? 'f7:lightbulb_fill…
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^…
Think I copied /pasted the incorrect error on my last try, so here for clarity (example direct from docs (used my Props):
Nested mappings are not allowed in compact mappings at line 108, column 15:
text: =(items[props.alarmFeedback].state === 'ON') ? 'f7:lightbulb_fill…
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^…
Nested mappings are not allowed in compact mappings at line 108, column 15:
text: = (items[props.alarmFeedback].state === '-') ? '' : (items[props…
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^…
Nested mappings are not allowed in compact mappings at line 108, column 15:
text: = (items[props.alarmFeedback].state === "-") ? '' : (items[props…
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^…
Nested mappings are not allowed in compact mappings at line 108, column 15:
text: =(items[props.alarmFeedback].state === "-") ? "" : (items[props.…
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^…
I realise this has become an interesting trail to follow now … but did you try directly editing Item’s expire metadata with empty string “” (not blank)? Set up an expire for “-” or whatever from UI, then you have a pattern to edit.
All collection items must start at the same column at line 108, column 9:
text: '=(items[props.alarmFeedback].state === "-") ? "" : (items[props…
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^…