N00b question regarding Raspberry PI as a LAN Connected Device


#1

Good Morning,
So I feel like I must be a complete idiot here because I have read like 35 different posts and keep getting what I see as contradictory advice.

Net/Net - I have a Raspberry PI that is hooked up to my HAM Radio and receives / decodes data automatically from the audio input and some HAM Radio software (Direwolf)

The data originates at a remote location where I have a beacon that is transmitting data.

Goal:
Based on the receipt of this data, I am trying to get SmartThings to see a “Motion Sensor” and a “Contact Sensor” which I can use to trigger other events.

I have my C/Python/Perl code all working to receive from Direwolf the event, I saw the rpi_garage_smartthings.py code and I think I get it, but I cannot figure out how to have a motion sensor vs a contact sensor.

Once I get the events into SmartThings I am confident I can use my other examples to subscribe to the events and take the actions I am looking for it to take, but I am challenged to get the events into SmartThings.

Does anyone have a clean example of how to setup a SSDP / UPNP Server from the PI for a Motion and Contact Sensor?

thanks,
Adam


#2

I’m a little confused. What is the source of the data for the contact sensor and motion sensor? Where is that data coming from? Are you trying to trigger it just when data is received? It might be easier to set the status of the data from WebCore. You could trigger a simple webcall from your Pi to a WebWook setup in WebCore. WebCore could then set the status of a virtual contact sensor created in your ST system through the IDE (the DTH are already built into ST). This might be slightly easier than having the Pi set the status of the device you are trying to create.


#3

I have a ham radio that listens on specific frequencies.
The audio tones it picks up go to a microphone input (usb sound card) on pi.

There is software that decodes these tones into data.

I have some relays it triggers local on the PI and local processing done, and now have a desire for the SmartThings to see it as a motion sensor and a contact sensor respectively.

I am far more comfortable coding the groovy stuff once I have a new virtual sensor in the dashboard and prefer not to do any web hooks or deal with any oauth stuff.


#4

In your code from the Raspberry Pi can you change the state of the GPIO pins? You could then use a dry contact sensor to seed into SmartThings. I’ve never gotten my Pi to report back directly into ST the way you are asking either.


(Simon) #5

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.


#6

I was never able to get that working on my RPi. I don’t know if it was because of running Stretch or what but if you can’t get it working, you’re not alone on that one.