Siemens/Vanderbilt SPC Alarm?

Yes, I finally got it up and running, and it works great. I can link events like a motion detection by the PIR to turning on ZWave lights, and also zone open events send push notifications to my cell phone.

It took quite a few tries, and a lot of tweaking and testing, and a number of wipe and re-installs, but I got there in the end!

Awesome - where is the tricky part? Installing the mqtt or get the com from the SPS up and running? Or?

Installing MQTT is simple enough, as far as I remember. The key part was getting the node-spc-mqtt.js script running (I still have to manually start it after a reboot).

For reference, I have openhab2, mosquitto, the SPC web service and node-spc-mqtt.js all running on the same machine, an Intel NUC running Ubuntu server.

Here are some of my settings:







Note that the value for gateway_id must be the same as the id in the Alarm system (you must log in as Engineer to access and set this, but it’s all documented in the web gateway software), ans should also be a bit more varied than 888888…

items/alarm.items (selection):

String  Alarm_MQTT              "Alarm [%s]"            <alarm>        {mqtt="<[mqtt:/SPC/G_SPC_AREA_MODE_1:state:JSONPATH(status)]"}
String  iFront_Door_MQTT        "Front Door Input [%s]"       <door>   {mqtt="<[mqtt:/SPC/G_SPC_ZONE_INPUT_1:state:JSONPATH(status)]"}
String  sFront_Door_MQTT        "Front Door Status [%s]"       <door>  {mqtt="<[mqtt:/SPC/G_SPC_ZONE_STATUS_1:state:JSONPATH(status)]"}


sitemap alarm   label="Alarm" {

        Text item=Alarm_MQTT                    icon="alarm"

        Frame label="Zones" {
                Text item=iFront_Door_MQTT      icon="door"
                Text item=iBeam_Hall_MQTT       icon="motion"
                Text item=iFront_Windows_MQTT   icon="window"
                Text item=iBack_Area_MQTT       icon="window"
                Text item=iUpstairs_MQTT        icon="window"
                Text item=iPanic_Buttons_MQTT   icon="contact"
                Text item=iGuest_WC_MQTT        icon="window"
        Frame label="Zone Status" {
                Text item=sFront_Door_MQTT       icon="door"
                Text item=sBeam_Hall_MQTT        icon="motion"
                Text item=sFront_Windows_MQTT    icon="window"
                Text item=sBack_Area_MQTT        icon="window"
                Text item=sUpstairs_MQTT         icon="window"
                Text item=sPanic_Buttons_MQTT    icon="window"
                Text item=sGuest_WC_MQTT         icon="window"

If you need any other info, let me know.

I’ve been playing around with my SPC 4320 and I have written a few lines of C# code that handles some of the EDP protocol. And I have spent a few hours trying to figure out how the SPC works but now I have run out of time and energy so I leave it to the community to pick it up.

For anyone interested in writing something to OpenHab in pure Java you will find my code here.

I think it’s easier to use the software from Lundix and then simpy use MQTT as communication between Lundix software and Openhab

I got it working and openhab2 now displaying the motion as open/closed.
But what I dont get working is a rule to tell a lamp to turn on when a motion is detected.
The String item seems not enough to tell openhab that the motion is done or something.

Do you @roryd have any Rule example on how you got it working so that a motion from a spc detector can
trigger a light to go on??
Maybe I need to do another form of item to get what I want? Like Contact item? Any idea on this would be so helpful for me.

Im new to Linux and Raspberry PI´s but Im proud of my self that I got this working and even with username and password on my mosquitto server! :slight_smile:

Hi Marcus,

Here’s the rule I have. It senses a trigger for either the motion detector in the hall or the front door being opened and, if the sun is below the horizon, it turns on the Ikea Tradfri light in the hall for 60 seconds. If the light is already on, and there’s another trigger, it extends it by another 60 seconds.

If you need anything else, let me know.

var Timer myTimer = null

rule "PIR and Front Door toggle"
        Item iBeam_Hall_MQTT changed from closed to open or Item iFront_Door_MQTT changed from closed to open
if      (Elevation.state < 0) {
        if (myTimer===null) {
                logInfo("halllight.rules","Sun below horizon ("+Elevation.state+"), turning lights on")
                myTimer = createTimer(now.plusSeconds(60)) [|
                        logInfo("halllight.rules","Turning lights off")
                        myTimer = null ]
        } else {
                logInfo("halllight.rules", "We already have a timer - rescheduling")
} else

Thank you for your reply @roryd!
I will try this rule with just the “when” command and “then” “**.sendCommand(ON)” just to see that the lamp triggers right.
But Im also curios about your “Sun below horizon…” , you dont use the Astro binding or do you?
Because later on when I got the motion to turn on lights I also whould like to mix with daylight time and stuff so the light only turn on when its dark and maybe keep it on for a specifik time.

Yes, I’m using the Astro binding to track the elevation of the sun.

Thanks very much @roryd!! The rule works fine for me now and turn on the light when motion is detected.
Now I just have to figure out the Astro binding :slight_smile: will look at your example some more and adjust after my needs :smiley:

1 Like

@roryd another question. Did you get the node-spc-mqtt.js to autostart after reboot?
And if you did, how did you do? Tried a lot off things now on that but cant get it to work. :frowning:

Forget it! Found pm2 and that was really easy to get it to autostart after reboot! :smiley:

Hi Marcus,

How did you manage that? I’ve never been able to get it to auto start and I have to remember to manually start it after every reboot!

Found that pm2 and got it working! Thanks for the tip :slight_smile:

1 Like

Hi Rory!

I Found this PM2 (Process Manager 2) on Github
Exelant program. Just remember to run the command $ pm2 startup
That command will generate a command line that you copy/paste and press enter.
That will do so pm2 autostarts and the other commands to start node-spc-mqtt.js you have on the link above. really easy to use and you can use it for several more you want to autostart :slight_smile:

1 Like

how do you configer the spc panel, i can’t find the EDP settings in the web interface.

found it, hidden in the communication module.