Motorbike alarm

Hello HA users,

Newbie in home alarm and i want to make my first complicating board with wemos d1 mini.
I want to make a motorbike alarm with spring sensor switch that bought from aliexpress.
My idea
the below code will be on motorbike wemos

  1. when motorbike will shaked a little buzzer that will on wemos d1 on motorbike will buzzer for 1min
  2. a software switch will disable the buzzer when i go to ride it , and enable it when i park it
  3. when wifi signal lost and alarm is active, buzzer alarm for 1min , but when is disable not alarm

then i put a second wemos on home that will make automatations
if software switch on wemos motorbike is enable then

  1. when motorbike buzzer ring then ring wemos house buzzer for 1min
  2. when wemos motorbike signal loss then ring wemos house buzzer for 1 min
    if disable not alarm

Right now i make this one spring switch works , buzzer NOT and i dont know how and combine all together

Example configuration entry

switch:

  • platform: gpio
    name: “Enable Alarm Buzzer”
    pin: D7

binary_sensor:

  • platform: gpio
    name: “Alarm reed sensor”
    pin:
    number: D1

inverted: true

  mode: INPUT_PULLUP