I am new in this forum, and I’ve tried to find an aswer to my “problem” without success…
I would like to install a Mi wireless switch outside my kid’s bedroom so that after I put my kid in bed, I can change a status from “up” to “in bed” by pressing this button. And then use this status for automation (e.g. door sensor activated only when the kid is supposed to be in bed so I know when he is going out of his bedroom).
I have already the Mi wireless switch connected on HA via a ZHA bridge.
I think I should create a binary sensor and a template, but beside this I have no idea how to proceed.
Could you please tell me if a topic already exist? If not how should I proceed?
On top of the solution of walberjunior I have a tip for you: if you have a light that’s controlled by HA in the area where you plan to put the wireless switch, you can also flash this light with different patterns to know if the toggle helper is on or off.
That way you don’t have to check any screen to be sure what the current state is.
The toggle helper is exactly what I was looking for! It works perfectly.
So now after putting the kid in bed, we close the door and activate the “in bed” mode via the zigbee button at the door. A notification is sent to our smartphones on HA (. After 1 minute it becomes really “active”. When the kid gets up and open his door, we receive another notification and can check if he has a problem.