IR control light system

I want to connect a IR control light system that gives real time data of the light. Example:how much time the light is glowing… Can someone help me in the code

so I think I got your problem statement as you want real-time data of light glowing you can use the LDR instead of IR which will give you more intensity in your results in

and use this code to get the real-time data stored in your cloud server {plotChart(“time_stamp”,"your_variable_name "); } hope this will solve your problem