Automation GPIO Switch

Just generic sensor component documentation:

I cant pick solution for you, I think it should be clearly related to the first post and title.