Linking both input and output at the same time

If it’s possible to get data and also feedback some command through 1 product. Like I want to check light intensity in my room, if light is less I’ll turn on the led


While you add a product u are only provided with either the input or the out value but u can’t use both at the same time.but I guess u can use both the input and output function through a python code in your digital ocean or virtual box

Can you please share an example code