I’m fairly new at YAML and LVGL but getting on pretty well… but stuck on this issue.
I have a text sensor that should drive a change to the selected value of a dropdown. I’ve tried a number of variations, but I’m getting similar messages with all of them. I’m clearly missing something…
I added the quotes to try to see if that would get rid of the error. It didn’t make any difference. I’ll remove them before I continue troubleshooting.
INFO ESPHome 2025.6.1
INFO Reading configuration shoptouchpad.yaml...
ERROR Error while reading config: Invalid YAML syntax:
mapping values are not allowed here
in "shoptouchpad.yaml", line 505, column 80
Line 505 is the line with the lambda, column 80 is just after the firsst “?”.
I’ve also simplified the expression by dropping the second condition with the same result (i.e., return either 2 or 0).
Yes, if I can get lambda to work at all, I’ll go there. There are actually 5 cases, so the ternaray operator wasn’t going to hold up. Currently exploring doing the cases in YAML.
Correct. My dropdown list is static, but the selected item change change external to the ESP, so when the text sensor changes, I need to update the dropdown selected item to keep it in sync.
If the text sensor values map one-to-one with the dropdown choices, just update selected_text with the text sensor value. If not, use the mapping component to create a map from the text sensor values either to indices or strings to update the dropdown.