Detecting switch sequence on off on

Hi all,

I have an automation for my girlfriend called Makeup Time so that it will turn on the bathroom lights at full brightness and white for 20 mins so she can do her makeup without having to get an app out. The problem is google home refuses to understand her asking it to turn on, obviously it works fine for me, perhaps its google hinting I need some makeup :crazy_face: :crazy_face:

So my thoughts on a solution would be to have her flick the bathroom light switch on-off-on but I am wondering how to detect this? The switch is a xiaomi door/window sensor hacked to work as a switch which I got from this clever chap xiaomi sensor as light switch

Is this possible and if so anyone got any ideas how I could detect this?

Thanks

Not exactly what you asked for but this will detect if the light switch has turned on then off within one second and apply the bright scene:

trigger:
  platform: state
  entity_id: switch.bathroom
  to: 'on'
action:
  - delay: '00:00:01'
  - condition: state
    entity_id: switch.bathroom
    state: 'off'
  - service: scene.turn_on
    data:
      entity_id: scene.bathroom_makeup
1 Like

Thanks tom will give it a try

I started to implement this then I realised it wont work. I don’t have a switch that is in a known position.
As I have hacked a xiaomi door sensor to act as the switch its now a toggle. Its on or off position bears no relation to the state of the light. it just acts to toggle the light Does that make sense?

Yeah it does make sense. Try this:

trigger:
  platform: state
  entity_id: light.bathroom
  to: 'on'
action:
  - delay: '00:00:01'
  - condition: state
    entity_id: light.bathroom
    state: 'off'
  - service: scene.turn_on
    data:
      entity_id: scene.bathroom_makeup

This assumes the light was toggled on then off again in 1 second. It also assumes HA is relatively fast to react to your switch and light. You might have to increase the delay if you find it does not work.

The other option is to detect 2 or 3 switch events in one second using a counter.

Of course its so simple when pointed out!

Thanks will try it when I get home tonight

Why not just try coming up with a google command she has no trouble saying and then you can use that experience to make sure future additions go without issue.

I’ve found the problem is either they don’t actually say the correct command or acceptable variation thereof, it is too close to something else or it’s their accent on a particular word. Assuming google has something like Alexa’s routines it takes seconds to try many variations without affecting HA in any way.

Whilst thats a good idea @Bobby_Nobble I am trying not to customise anyones google home so that I can replace them when HA’s Ada and Almond become good enough to use.

Google have been pissing me off recently with

  1. Sudden changing of keywords like how lights and lamps are now being treated as the same thing so I cannot differentiate between overhead lights and table lamps
  2. How I cannot get an authentication code to add my google nest smoke alarm to HA all because I migrated my account like they asked me to.
  3. Their customer service is just terrible! Just kinda feel Google don’t care about their customers very much at all

Thanks for the response tho much appreciated

1 Like

Assuming it is a wall switch, convert the switch to a double (or triple) for your girlfriend’s makeup light scene. You’ll need another Zigbee sensor for the second switch.

Obviously won’t work for a ceiling pull cord though.

I have the same exact thing for my wife. What I ended up doing was making it a timed automation (6:05AM - 7:05AM on workdays (using the Workday sensor)) and I also put a single button remote next to the vanity that she can push for times outside of when she is getting ready for work. Not the most elegant, but it works.

1 Like

Found out what the problem was… because in my girlfriends google home app I had not added hassio as I thought adding it to mine would be enough. Google home would work for some things and not for others. But after adding it to google home all things work for her now.

thanks for all the suggestions I might still implement some of them

1 Like