Not so smart proximity and door contacts

Not so smart Alarm proximity and door contacts.
I am hoping someone can steer me in the right direction.
I have an alarm system that uses 315 Mhz wireless devices. I have successfully put together an Arduino and RF-link receiver to capture the “Opened” state transmission (each device produces a unique seven digit number). Unfortunately, this system does not transmit a “closed” state. The same with the proximity sensors, they only transmit one number at the initial movement. Turns out this non-intelligent alarm system never actually knows whether the door is opened or closed when armed. It will allow the system to be ARMED with all the doors opened, only triggering when the sensor passes by the magnet.
So where I am having my problem is, … How do I create an automation that, starting from a “Closed” position, when the door is first opened, HA automatically records the door as opened, then once the door contact is closed (or the sensor no longer sees movement) , HA can resets the sensors AS CLOSED, so the automation can run again. Currently, once the door is opened, the only to reset to “Closed” is to reset the sensor manually or restart HA.

I guess I am not grasping the differences between Service, script, automation, and scene
The line in question is how do I reset the proxy sensor?

  • alias: Turn on Ceiling Fan Light when there is movement
    trigger:
    • platform: state
      entity_id: binary_sensor.prox_sensor_1
      to: ‘on’
      action:
      service: script.turn_on
      entity_id: script.office_timed_lamp

sequence:

Cancel ev. old timers

  • event: LOGBOOK_ENTRY
  • service: homeassistant.turn_off
    data:
    entity_id: script.office_timer_off
  • service: homeassistant.turn_on
    data:
    entity_id: group.office_fan_lights
  • service: homeassistant.turn_off
    data:
    entity_id: binary_sensor.prox_sensor_1

Set new timer

  • service: homeassistant.turn_on
    data:
    entity_id: script.office_timer_off

alias: “Turn office light off after 10 minutes”
sequence:

  • event: LOGBOOK_ENTRY
  • delay:
    minutes: 10
  • service: homeassistant.turn_off
    data:
    entity_id: group.office_fan_lights

Thank You for any assistant
Dave L.

when i understand right, there is never a signal that the door is closed.
so HA can never know that the door is closed.

i think that the only way to accomplish what you want is to make another sensor which registrates that the door is closed or opened.

if you can pick up the armed state, you could create an assume that the door is closed after a short period of time.

it then would be:

state ==> armed
delay a short while
assume door is closed.
set door closed in HA.

Sorry for taking so long to reply back, Life got in the way of getting back to the hobby!

Having a delay and automatically resetting the sensor to closed and/or no movement is the idea. But how do I RESET a mqtt binary sensor in HA? I have tried Homeassistant.off, switch.off, and script.off.
Is there a sensor.off command in HA?
I can get the sensors to reset if I manually change the sensor state to off OR if I completely restart HA.

i dont think there is yet a way to set a sensorvalue manually.
but there is a way to create a script that sets a sensor value from outside HA.

i think here is spoken from a simular thing:

https://github.com/home-assistant/home-assistant/issues/1279