Issue with a lambda using the value of a select

As my recent pool controller (the Pentair Intelliconnect) which I installed in May of 2020 died, the pool guys’ only suggestion was to upgrade to the more expensive ones and I was not going to shell out 2.3K dollars for something that’s pretty simple, really.

So, with the experience of my previous adventure (see: How I added a Hayward solar pool control to HA via ESPhome) I decided to build one myself.
I’ve so far been able to create a setup that controls the pump, pool solar heating, waterfall and the light. Currently the chlorinator is only partially integrated in where I can power it on/off and it’s still relying on the RS485 connection to the pump to know if there’s flow. I am struggling massively to create the code to fully integrate so I can update the output percentage.

I’m working on a write-up of what I accomplished so far, hoping somebody may be interested in helping out with the chlorinator. Write-up now published New Pentair pool automation setup – full write-up