Creating shortcuts with physical switches

Hello,
I’d like to say a huge thankyou to everyone on this forum for their ideas and projects which has inspired me to start building my own automation system.

The problem
I’ve currently got a few Sonoffs flashed with Tasmota as ceiling light switches which work very well, my problem was that I wanted my two bedside lamps (Also sonoffs running tasmota) controllable by the same lightswitch, I could have replaced the fascia and pulled through more cable to achieve this but was more effort than it would have been worth so I started to look at the software side.

The Solution
I wanted to be able to turn the switch on and turn it off quickly to turn the lamps on. So I used the timeout function to abort the automation if the lightswitch hasn’t been turned off within the 2 second limit, this works perfectly!

  - timeout: 00:00:2
    wait_template: '{{ states.light.master_bedroom_light.state == ''off'' }}'
  - data:
      entity_id:
      - light.bedside_lamp_1
      - light.bedside_lamp_2
    service: light.toggle
  alias: Lighting (Master bedroom shortcut)
  condition: []
  id: '1512042817409'
  trigger:
  - entity_id: light.master_bedroom_light
    from: 'off'
    platform: state
    to: 'on'

I know it’s only small but I thought I’d give something back to the community.

1 Like

I dont get this. Can you explain?

1 Like

I have a normal one gang lightswitch connected to a sonoff (GPIO14 and GND), by using this code you can start automations by double clicking the light switch. I will post a video later that better explains it.

Why not create a group with both bedside lamps and then control the group?

Thank you very much for this info! I was looking for a way to do this and it works perfectly :grin: