N00b question regarding Raspberry PI as a LAN Connected Device

I had something like this working using WebIOPI and the PI relay controller on here. Your PI would sense a contact change and then the ST device would change accordingly.