Creating a Custom Remote for Home Assistant with ESPHome

This remote was a fun little project to put together without having to spend lots of time or money.

Creating a Custom Remote for Home Assistant with ESPHome

I had some free time one afternoon so I decided that I wanted to make something new that I could use my ESP8266 for without a lot of programing envolved. What I came up with is a simple remote with two toggle switches and an internal tilt sensor inside.

ESPHome

Using ESPHome I was able to quickly program the board for the toggle and tilt sensor inputs

binary_sensor:
  - platform: gpio
    pin: 
      number: 0
      inverted: true
      mode:
          input: true
          pullup: true
    name: "Toggle 1"

  - platform: gpio
    pin: 
      number: 2
      inverted: true
      mode:
          input: true
          pullup: true
    name: "Toggle 2"
  
  - platform: gpio
    device_class: motion
    pin: 
      number: 5
      inverted: false
      mode:
          input: true
          pullup: true
    name: "Tilt"
    filters:
      - delayed_on: 300ms
      - delayed_off: 300ms
    

After programming the the ESP8266 I attached the sensors to it and then found a case online made for the board that I could 3d print. I modified the case by drilling two holes in it for the toggle switches and put it all together.


Home Assistant

After getting the board setup in ESPHome you just need to create some automations for the remote.

Currently I have it next to my bed with the toggle switches setup to enable and disable alerts I have configured in Home Assistant for my home alarm and for my toddlers bedroom door.

I haven't set an automation up for the tilt sensor yet but I am sure I will come up with a use for it.

Conclusion

This remote was a fun little project to put together without having to spend lots of time or money. The only downside to it currently is that it needs to be plugged into power all the time. Maybe in the future I will find a way to battery power it.