Switch state change

In HA, you can create auxiliary elements, such as a switch. I read the state of the switch through “current state”. And how to manage it?

Welcome to the forum @kvs

Few here use HA, so you might be better asking on an HA forum.