Thank you, I made progress in the evening, currently
the sensor turns the pump off, after switching on it does not turn it on
this is ok
I currently don’t know how to disable turning on the switch when the sensor is off. the sensor sends me ON/OFF states in the log, I tried ON/OFF, 0/1, true/false in the code. fails, I’m still missing something or have the syntax wrong. I looked at the manuals, but I still can’t figure it out.
I currently have it in a working condition as far as the hardware is concerned, but I still don’t know why after a low level (sensor false) and when the switch is turned on, the switch lights up on the panel, even when the hardware is turned off, as I expect. As if the status was not updated.
Show my ignorance but I think reading the document, automation goes under sensor/ binary sensors and not a switch component ( which is an output and not an input component).
Edit: I read docs and this is correct. I also have to write automation for my pump based on water level. I will look at this tomorrow