Dome Motion Sensor Lux in CoRE Piston


#1

1) Give a description of the problem
I’m trying to control a GE Zwave plus toggel switch using the Dome Motion sensor. I can trigger the switch with motion using either a CoRE (ady624/CoRE (master)) piston or a custom device handler DTH ( * Dome Motion Sensor v1.2.1

  • (Model: DMMS1)) smartapp. The custom DTH apparently doesn’t make use of the lux level provided by the Dome sensor. The CoRE piston apparently should but doesn’t.

2) What is the expected behavior?
I want the switch to get turned on only when the room is relatively dark and motion is sensed.

3) What is happening/not happening?
The motion sensor triggers the switch regardless of the light level.

**4) Post a Green Snapshot of the piston![image|45x37]

5) Attach any logs (From ST IDE and by turning logging level to Full)

Date Source Type Name Value User Displayed Text
2018-12-10 2:33:10.569 PM EST DEVICE motion inactive Foyer Motion motion is inactive
8 minutes ago
2018-12-10 2:32:39.424 PM EST DEVICE motion active Foyer Motion motion is active
9 minutes ago
2018-12-10 2:31:25.751 PM EST DEVICE illuminance 25 Foyer Motion illuminance is 25 lx
10 minutes ago
2018-12-10 2:28:25.205 PM EST DEVICE motion inactive Foyer Motion motion is inactive
13 minutes ago
2018-12-10 2:27:51.507 PM EST DEVICE illuminance 62 Foyer Motion illuminance is 62 lx
14 minutes ago
2018-12-10 2:27:36.216 PM EST DEVICE illuminance 86 Foyer Motion illuminance is 86 lx
14 minutes ago
2018-12-10 2:27:36.078 PM EST DEVICE motion active Foyer Motion motion is active
14 minutes ago
2018-12-10 2:24:46.872 PM EST DEVICE illuminance 32 Foyer Motion illuminance is 32 lx
17 minutes ago
2018-12-10 1:30:33.850 PM EST DEVICE motion inactive Foyer Motion motion is inactive
1 hour ago
2018-12-10 1:29:46.121 PM EST DEVICE illuminance 14 Foyer Motion illuminance is 14 lx
1 hour ago
2018-12-10 1:29:37.444 PM EST DEVICE illuminance 447 Foyer Motion illuminance is 447 lx
1 hour ago
2018-12-10 1:29:27.877 PM EST DEVICE illuminance 34 Foyer Motion illuminance is 34 lx

REMOVE BELOW AFTER READING


#2

If anyone is looking at this, you’ll see that the topic was related to CoRE as opposed to WebCoRE. The manufacturer directed me to CoRE and when I had problems I was then directed to the WebCoRE community for help. After submitting my topic I did more looking into WebCoRE and subsequently found how to install the components and start using it. I’ve subsequently created the same piston with WebCoRE and will be testing it out. I’ll report back if I still have problems.


#3

It would be better if you share your Webcore piston here (if you still need help with it)
And I never used Core so I don’t know anything about it but I highly recommend stop, pause, delete how ever you do it in Core while testing in Webcore. One source of code is always better.


#4

OK, I’ve edited my original topic submission above to show the piston and the logs. It seems clear from the logs that the Dome motion/illuminance sensor is seeing motion and illuminance. The light is being triggered when the lux level is above my attempted set point of 10. Hopefully this is now enough info to figure out what I’m doing wrong. I’ve checked both the sensor and switch “In Use By” entries and they show:

  • [Amazon Alexa]
  • [webCoRE / webCoRE ](webCoRE Storage)
  • [webCoRE / webCoRE DomeLux ](webCoRE Piston)

#5

Do I need to somehow use the illuminance variable from the DTH in the WebCoRE piston? Is my problem that the piston doesn’t know the illuminance value from the sensor?


#6

This is probably the log you need. Note that to test the device I had to change the illuminance comparison value to 3 (it is 10 in the piston above). So, something is still turning the light on even though it doesn’t show up in the log below. It looks like the piston might be working correctly but something else I’ve done is turning the light on. From the log below, it’s not clear to me that the piston knows about the status of the switch.

12/10/2018, 3:42:17 PM +724ms
+1ms ╔Received event [Foyer Motion].motion = inactive with a delay of 304ms
+72ms ║RunTime Analysis CS > 12ms > PS > 43ms > PE > 16ms > CE
+74ms ║Runtime (37229 bytes) successfully initialized in 43ms (v0.3.109.20181207) (72ms)
+76ms ║╔Execution stage started
+86ms ║║Comparison (enum) inactive changes = true (1ms)
+88ms ║║Condition #2 evaluated true (5ms)
+100ms ║║Comparison (integer) 6 is_less_than (integer) 3 = false (3ms)
+102ms ║║Condition #3 evaluated false (12ms)
+103ms ║║Condition group #1 evaluated false (state did not change) (21ms)
+108ms ║║Cancelling statement #8’s schedules…
+115ms ║║Skipped execution of physical command [Foyer Light].off([]) because it would make no change to the device. (3ms)
+117ms ║║Executed [Foyer Light].off (5ms)
+119ms ║╚Execution stage complete. (44ms)
+121ms ╚Event processed successfully (121ms)


#7

Ok here is my experience with LUXs

1 - Sensors don’t report them immediately…or even register them immediately…
I worked on a piston where as the outside lux go down and up, lights would go down and up gradually…
it did not work…
Lets say while the outside was 500, the sensor was still reading 2000 (which was true 3 minutes ago)

2 - i have not tested but - If i were your piston, I would turn the lights ON and OFF.
as soon as line 18 trigger becomes false, the piston will cancel everything.
Try NEVER CANCEL under the task cancellation policy (let me know if you don’t know what it is)

3 - Line 28. sensor 1 WAIT 5 minutes, I am not sure if you can stop sensors with WAIT command???

4 - Did you read your sensors lux in ST app???

5 - I would write this piston like this:
IF motion sensor changes to ACTIVE
AND
Motion sensor 1 lux is less than 10
then
With
Light bulb 1
Turn ON

IF motion sensor 1 stays INACTIVE X minutes
then
with
Light bulb 1
turn OFF


#8

Can you verify that the logs I sent and this new one don’t show the switch being turned on?

12/11/2018, 8:38:51 AM +349ms
+1ms ╔Received event [Foyer Motion].motion = inactive with a delay of 158ms
+96ms ║RunTime Analysis CS > 18ms > PS > 58ms > PE > 20ms > CE
+98ms ║Runtime (37159 bytes) successfully initialized in 58ms (v0.3.109.20181207) (96ms)
+99ms ║╔Execution stage started
+108ms ║║Comparison (enum) inactive changes = true (1ms)
+110ms ║║Condition #2 evaluated true (5ms)
+120ms ║║Comparison (integer) 6 is_less_than (integer) 3 = false (2ms)
+122ms ║║Condition #3 evaluated false (11ms)
+123ms ║║Condition group #1 evaluated false (state did not change) (18ms)
+126ms ║║Cancelling statement #8’s schedules…
+150ms ║║Executed physical command [Foyer Light].off() (19ms)
+151ms ║║Executed [Foyer Light].off (21ms)
+154ms ║╚Execution stage complete. (54ms)
+155ms ╚Event processed successfully (155ms)
12/11/2018, 8:38:11 AM +363ms
+2ms ╔Received event [Foyer Motion].motion = active with a delay of 181ms
+95ms ║RunTime Analysis CS > 17ms > PS > 58ms > PE > 20ms > CE
+97ms ║Runtime (37159 bytes) successfully initialized in 58ms (v0.3.109.20181207) (95ms)
+99ms ║╔Execution stage started
+109ms ║║Comparison (enum) active changes = true (1ms)
+111ms ║║Condition #2 evaluated true (5ms)
+122ms ║║Comparison (integer) 6 is_less_than (integer) 3 = false (2ms)
+124ms ║║Condition #3 evaluated false (11ms)
+125ms ║║Condition group #1 evaluated false (state did not change) (20ms)
+129ms ║║Cancelling statement #8’s schedules…
+137ms ║║Skipped execution of physical command [Foyer Light].off([]) because it would make no change to the device. (3ms)
+138ms ║║Executed [Foyer Light].off (6ms)
+141ms ║╚Execution stage complete. (43ms)
+143ms ╚Event processed successfully (142ms)

It seems to me something I set up before and can’t find is still controlling the switch. I’ve deleted my two earlier (non WebCoRE) attempts. The only thing left is the Piston and the DTH. It seems that I need the DTH but I’m not sure.

Regarding your input:

  1. Yes, this one only updates after the lux level change is greater than a user defined delta. The user can also control how frequently the lux level is reported. Those “features” don’t seem to be causing me any major problems.

  2. I’ll look at this and get back to you.

  3. What I’m trying to do here is turn the light off after 5 minutes of inactivity (no motion). This is probably not the right way to do this but it’s my first attempt. This seems to be working OK or at least not causing any apparent problem.

  4. Yes, the Classic App and the IDE seems to be reporting correctly.

  5. I’ll give this a try.

Thanks.


#9

What does your piston look like now? It is still the same as in the first post?


#10

My piston is not the current problem. I just verified my previous suspicion that something I did previously is in control. I removed the “on” command from the pistion and the light still comes on. My IDE only shows “In Use By” WebCoRE (and Amazon Alexa) so I don’t know what script is taking input from the sensor and activating the light.


#11

It will show webcore in the list because you authorized webcore access to it for use in piston. To verify webcore isn’t the one controlling it, go back to the ST app and then go to webcore settings and remove the problem device from webcore’s device list. Note, that this will remove it from any pistons you’ve used it in also.


#12

I found the problem: I still had an automation set up in the new ST App that was working in parallel with the Piston. I had deleted all of the previous automations in the Classic app and hadn’t been thinking anymore about the new app. Once I deleted the automation in the new App my Piston started working as expected. So, the basics now work: The light only comes on when motion is detected and the ambient light level is below my set threshold, and the light turns off 5 minutes after the motion. I haven’t tested to make sure the Piston knows about other motion activity within that 5 minutes and restarts the timer. I suspect my wait step is in the wrong place but unless somebody can verify that one way or the other I’ll just monitor the behaviour and adjust as necessary.
Thanks for the suggestions and I apologize for my own error in not considering what I had done in the new App.