Need help with scenes using HSM100 sensor.

Hi all,

I need help with setting up scenes on the HSM100 motion sensor.
I would like the sensor to trigger on these events.

  1. Lights turn on after detecting low amount of natural light in the room, I would like it to define it this way, when the natural lights are 50% less in the room, the light bulbs turn up on and up by 30% only, by the time the natural lights are 25% low late evening, the lights go up 75% and when its already dark/night the lights turn 100% up. Again, after 10.00 pm the lights go down to 30% automatically.
    Ofcourse, most importantly this automation shud only be triggered when the sensor detects people/motion in the room.

  2. Lights turn on 100% when entering the room, but again only when the natural lights in the room are below 50%. I dont want it to be turning on in the broad daylight. :slight_smile:

  3. Lights shud turn off if there is no motion in the room for 20 mins.

  4. Climate control, setting up thermostat.

For now, this works. :slight_smile:

Can the guru’s in here help me add this to my sensor??

Well, did i put this in the wrong section here? Should i post this post in the development thread?

I think i am jumping the bandwagon too soon with complicated scenes.

Ok, lets begin with the basics… can someone guide me on this simple scene.
Lights turn on when entering the room?

Let me take one step at a time. :slight_smile: First goes the most basic scene. I have not been able to get even this scene in place yet. :frowning:

On the top right there is a search function ;D

Maybe this helps:,10199.msg69694.html#msg69694

So for a simple scene which turns on the light:

  • Go to “Automation” on the UI5 of your Vera
  • Click “New Scene”
  • Enter a Name for the Scene
  • Click the ON-Button of the device/light you want to turn on.
  • Go to “Triggers” and add your Motion Sensor as a trigger (If a Motion Sensor is triggered)
  • Confirm Changes to Scene
  • Click the red SAVE button

For more advanced scenes read this:

Thanks for your help mate. I must agree with the other poster, members of this forum are very helpful.

Trust me, i have been scratching my heads off to the last bits of hair since last two days, there is tons of unorganized information accross all the mios and wiki pages you mentioned, but its getting really hard to consolidate to one point where an amateur customer can pick up and start working on the scenes.

One of the link you mentioned is good for setting up scenes on the dimmer level, but i am looking into scenes that can be triggered through the sensor.
Any kind of help is appreciated. I am hoping for generous response from the members on this forum. :-\

Possibly the examples on this wiki page are useful (e.g. #6)?

This is something i was looking for. Thanks oTi@. Now comes the big task… :smiley:
How to setup the scripts with my vera. I just need a beginning where to start, once i get few tips, and examples on how to proceed, i will pickup on my own, and might even get into scripting as well.

Can you/someone help me setup example #5 for the start.
Although i was able to activate the lights with the motion sensor without the script, but the lights would never shutdown when no motion in is detected, plus the lights wud turn on even during broad daylight when motion is detected. Hence to take one step at a time, i would like to implement example #5 script, where lights shut off when no motion is detected.

I tried entering this script in the luup code section of a new scene, but nothing happened. :smiley:

1. Create a scene to turn on the light when a sensor is tripped. 2. Add this code in the Luup code section: local sensorDeviceNo = 16 -- Motion Sensor device number local lightDeviceNo = 13 -- Light device number local period = 10 -- Seconds

local SS_SID = “urn:micasaverde-com:serviceId:SecuritySensor1” – Security Sensor Service ID
local SP_SID = “urn:upnp-org:serviceId:SwitchPower1” – Switch Power Service ID

function checkLastTrip()
local lastTrip = luup.variable_get (SS_SID, “LastTrip”, sensorDeviceNo) or os.time()
if (os.difftime (os.time(), tonumber (lastTrip)) >= period) then
luup.call_action (SP_SID, “SetTarget”, {[“newTargetValue”] = 0}, lightDeviceNo) – Turn off the light.
luup.call_delay (“checkLastTrip”, period) – Check when the sensor was last tripped every seconds.

luup.call_delay (“checkLastTrip”, period)

return true

Here’s what i did.
Automation > New Scene >
Triggers > Add triggers > Device : Motion Sensor
What kind of event is triggered : A sensor door/window/motion is tripped
Name : something
Device is tripped
Luup > added the script there.
Confirm Changes > Save.

Waited, waited, waited… without no motion in the room, and even after 15 mins lights are still on. :smiley:
Turned of the lights, kept jumping in front of the Sensor… the leds on the sensor keep blinking nothing happens. :-X

Ok… now here is the question… did i miss some step in between??

Am i supposed to edit this script above, with device numbers?? I.e. I believe each zwave device has a device number, am i supposed to find that from each device and edit the script… an example in the script above.

local sensorDeviceNo = 16 – Motion Sensor device number
local lightDeviceNo = 13 – Light device number
local period = 10 – Seconds

Or i just dont need to do any of the steps above, just directly go to luup section and paste the script?? i tried couple of dumb things, nothing happens. :frowning:

You must edit the code with your device numbers. You can find the device # in the settings tab of each device.

The device ID you have to adjust in the script can be found in each device’s Advance tab.

Also, use the following link to see your vera’s log, when you run the scene you can then see what was successful and what errors appeared:

One way to do that is to have the sensor do as much of the work as possible.

HSM100 > Wrench > [tt]Device Options[/tt]: set parameters 2 ([tt]On time[/tt]) and 4 ([tt]Light Threshold[/tt]) to the desired values (see example screenshot).

As an example, assume you configured the [tt]On time[/tt] to be 5 minutes; then:

  • When the sensor sees motion, it will tell Vera. You can create a scene to turn on the light, based on the event [tt]An armed sensor is tripped[/tt] + [tt]Device armed is tripped[/tt].
  • When the sensor hasn’t seen motion for 5 minutes, it will tell Vera. You can create a second scene to turn off the light, based on the event [tt]An armed sensor is tripped[/tt] + [tt]Device armed is not tripped[/tt].

You can experiment with the light threshold. The 100% reference level is set when you press the blue button.

This is a no-code way of getting things going. If you want to go beyond that, you could play with the code examples (and set the light threshold to 100%, depending on usage).