Can it be done HA change State of pin from physical Momentary Switch?

we have to pass on the template {{trigger.entity_id}} which gives the entity_id of the device that has triggered the automation. This is then found in the string we set and replaced with a dummy and the rest of the string is passed on as entity if for the service automation.turn_off
But for some reason trigger.entity_id as a template was not being accepted inside the find operation so I set a variable with the name box and gave it the value of trigger.entity_id and then passed the box into the find template to find and replace the string.

Hope that worked.

We change try that but first make sure that the automation woks. For this just use this custom card.

My water pump operations are done with a tank sensor so i only use it once a day to fill the tanks and it switches the pumps of after that.

I have this error

ERROR (MainThread) [root] Uncaught exception
RuntimeError: module compiled against API version 0xe but this version of numpy is 0x

and I am not sure what it is about. Can someone please help? thanks

@sheminasalam sorry delay i had family issues and then i had to delay with alot of crap… so i forgot about things as the pump was working great… and forgot to come on here
and i now having issues with my main HA with the fancy display nvme broke and my backups werent backing up i found out… vdisk lost its partition and i cant retrevie it
so i just getting back to things recently… i did some updates of HA too so i been outta date lol. found some issues with custom cards too they change it…
but now i gotta see if i can get the main HA fixed if possible

@bachoo786 i not sure what were you doing at the time to get that error?