Not possible of course which is hopefully why you are using Node-RED.
I do this with lots of switches many of which don't give any feedback so I have to maintain state within Node-RED (or in MQTT).
I did have a TP-Link switch but I think that the relay has gone. I'll take it apart one day to find out (took nearly 6 months for someone on Amazon to actually send me the appropriate bits to unscrew its security bolts).
For that switch, I used the tp-link node and whenever I received a notification about switch change, I would add some extra data and send out to MQTT. The extra data was to add
offTime timestamp values. The data was also stored in a retained Node-RED variable so that when the switch goes on, I can work out the time difference between when it was switched off and now. And the other way around for when it switches off (now - onTime). For convenience, I also add those elapsed times to the output as well.
You don't need to use MQTT to do all of this but if you don't, you will need to drive any downstream flow from the input node since updating Node-RED variables sadly doesn't trigger an event right now. One day I'm going to write something that does trigger an event on update if someone doesn't beat me to it.