Making a door sensor with NodeRED

My door 433MHz door sensor finally arrived and I’ve already set it up and receiving the messages from it with my RF receiver connected on a ESP8266 NodeMCU which is running OpenMQTTGateway and it runs awesome! My problem now is that, the sensor only sends a message when the door opens, and that’s it, not when it closes again… So I’m not really sure how to display it on Homeassitant, soI’m looking for a way to setup a sensor on Hass that has a ON/Off state or another frontend device that shows time since last time the door opened. Also from NodeRed I’m able to call services, and send payloads using the RESTfull api.

What are the best options for this?