Kid "in bed" or "up" status with Mi wireless switch

Hi everyone,

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?

Thanks in advance for your help

The Mi switch won’t tell you if it’s “up” or “in bed”, so I would create a toggle helper.

An automation to put the switch on using single touch and off double touch.

Then make your door sensor automation based on the helper

1 Like

Hi Romain, welcome to the forum!

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.

1 Like

Hi Walberjunior and Nick,

Thanks a lot for your answers.

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.

Thank you once more for your help.

Good that it works!

Now, before you go… please take the time to mark that as the answer, you do that by selecting the three dots under the post:

image

Then select the check box:

image

Don’t forget too while you’re down there to click the heart to like the post, as a way of saying thank you.

1 Like