Sistema allarme home assistant integrato co esp8266

Hi everyone, I am creating an alarm with home assistant using esp8266 programmed with esphome, I have an old wired alarm and I integrated it using the magnetic and volumetric contacts with the esp8266 also the external siren. The latter I used a relay controlled with a command that turns on the relay when the trigger is triggered, what I can’t do is that when I deactivate the alarm does not go off. Come I can do!

English only please.