How to setup Contact Sensor to push "open" or "closed" to Apache server?

Hello, I’m a web developer currently working on this:

At my company, we have a contact sensor for a door. We have an internal website for our employees to check if the door is “open” or “closed”.

My problem is: our website is hosted at our company’s own Apache server. I don’t know even know how to start coding an API that checks the device status! All the documentation I’ve read is about mobile apps, but I don’t need a mobile app. I just need a simple PHP or JS file with code that pulls the state of the device every 5 minutes so I can display it on our website.

This is probably a good start. See the SmartThings API - specifically the part that retrieves device status…

SmartThings API (samsung.com)](SmartThings API)

If you install and use HousePanel you can make a rule that send a POST to any web url when things happen. Check it out at

https://housepanel.net

Or search this forum for HousePanel

1 Like

Just to make sure we’re all talking about the same thing…

This forum is for people who are using the Samsung SmartThings ™ Home automation platform, so all of the questions and answers are assumed to be in that context. That is, people are going to assume that you are using a contact sensor that reports to a Samsung SmartThings hub, and then everything follows on from there.

From your post, I couldn’t tell if that was your operating environment or not. This is a very active forum, so it often comes up near the top of general Google automation searches, but it is not a general forum.

If you are using a SmartThings hub, great, you can work with what you’ve already been given.

If not, I suggest you try the Reddit home automation subforum, which is brand agnostic. People there will need to know the brand and model of the contact sensor you are working with, though.

Many solutions start with the first rule of home automation: “the model number matters.“ :wink:

Hey @JDRoberts have you noticed that the forum has sort of died off lately? What’s up with that

This forum?

Yes - this forum. Not very active lately

I don’t know. A lot of the more active developers are holding back until we’re further along in the transition, I don’t know if that has anything to do with it. :thinking: