CoRE - Get peer assistance here with setting up Pistons

Hey guys - I am trying to get CoRE working with my Enerwave 7 Button Light Scene controller (ZWN-SC7 Enerwave 7 Button Scene Controller). I’ve created a basic piston that should flip a Virtual Switch ON when button 7 is pressed. However when I press button 7 nothing happens and the virtual switch is not turned on. As a test, just to make sure this wasn’t an issue with the virtual switch, I also tried making a piston so that when button 7 is pressed it would send an SMS, however that does not trigger either. I am using the very latest version of CoRE and the latest DTH of the Enerwave device.

There is a Smart App for this Enerwave device - and that is working just fine when I press the button. However I of course want to get this working with CoRE since it is a lot more robust and gives me a lot of flexibility for more complex rules/conditions.

Can someone please tell me what they think the issue is and how I can troubleshoot this? These are the steps I use to create the piston:
Add a Basic Piston
Click IF, choose Add A Condition, click Capability, choose Button, hit Done, click Button List, select ZWN-SC7 Enerwave 7 Button Scene Controller and click done, click Button(s), unselect button #1 and click #7 and hit done (BTW using #1 doesn’t work either), click Comparison, click IS and done, click Value and click Pushed, click the main Done twice, click THEN, click Add an Action, click Control lights…, click Select lights…, click my Enerwave Button Large virtual switch and click done, click Done, click Add a task, click Turn On, click Done, click Done, click Done. Then I’m back at the main screen as pictured below. Click Done, get green status bar message saying Piston is now running. Click Done, now I’m back at the list of Smart Apps. If I click button 7 on the lighting controller, nothing happens.

Thank you in advance for helping me troubleshoot this!

Use Changes to Pushed:

Thank you Michael. When I saw your message I thought β€œah ha! that has to be it.” but unfortunately it makes no difference. Same issue as before. As a side note, the Enerwave device itself in the Things summary list does show a 7 next to it when I press that button, so we know that SmartThings is recognizing the button as being pressed and that part of it is working. The question is why CoRE is either not seeing it, or seeing it but not taking action. What troubleshooting steps can be taken?

Also as a side question - with β€œChanges to” how does that work for toggling. I want to press button 7 to turn it on and button 7 again to turn it off. If its already on 7 when turned on, and still on 7 when I go to turn it off, would that second press on 7 (when its already on 7) count as Changes To?

There is a toggle action when you select the device to actuate.

I’d kill the piston and rebuild it, mirror what I posted and it should work. I don’t think I had to do anything else to get mine going. The device does work with other smart apps right? Like button controller or smart lighting?

So I have this piston almost right with the help of you guys here! and I am learning a lot as I go along. However, my hall light always comes on with motion now all the time. As per Michael I added the OR Motion is active to keep the light on when still in the hall. But I think it is just triggering the light on all the time. What have I done wrong?

Hum, that looks like it should work correctly…What’s the lux sensor reading? I find that to be the most difficult variable to work with, log what’s happening when it turns on when it shouldn’t, see if that’s reporting less than, maybe.

Lux is 2500. I enabled the logging in CoRE but where do I find the log?

I found this in the ST Developer Live logging:

	b67d25bd-f027-4b71-883a-6548ac5e1567

1:04:01 PM:
trace
╔═══ Piston done in 1471ms


	b67d25bd-f027-4b71-883a-6548ac5e1567

1:04:01 PM:
trace
║╔══ Task processing took 1112ms


	b67d25bd-f027-4b71-883a-6548ac5e1567

1:04:01 PM:
trace
β•‘β•‘β–‘β–‘ Removing any existing ST safety nets


	b67d25bd-f027-4b71-883a-6548ac5e1567

1:04:01 PM:
info
β•‘β•‘β–‘β–‘ Executing virtual command fadeLevel (43ms)


	b67d25bd-f027-4b71-883a-6548ac5e1567

1:04:01 PM:
trace
β•‘β•‘β–‘β–‘ Installing ST safety net


	b67d25bd-f027-4b71-883a-6548ac5e1567

1:04:01 PM:
info
β•‘β•‘β–‘β–‘ Scheduling ST job to run in 19620.0s, at Fri, Sep 30 2016 @ 6:31 PM EDT


	b67d25bd-f027-4b71-883a-6548ac5e1567

1:04:00 PM:
trace
β•‘β•‘β–‘β–‘ Rescheduling time triggers


	b67d25bd-f027-4b71-883a-6548ac5e1567

1:04:00 PM:
trace
β•‘β•šβ•β• Processing tasks (v0.2.14c.20160908)


	b67d25bd-f027-4b71-883a-6548ac5e1567

1:04:00 PM:
trace
β•šβ•β•β• Received a time event


	b67d25bd-f027-4b71-883a-6548ac5e1567

1:01:58 PM:
trace
╔═══ Piston done in 801ms


	b67d25bd-f027-4b71-883a-6548ac5e1567

1:01:58 PM:
trace
║╔══ Task processing took 180ms


	b67d25bd-f027-4b71-883a-6548ac5e1567

1:01:58 PM:
trace
β•‘β•‘β–‘β–‘ Removing any existing ST safety nets


	b67d25bd-f027-4b71-883a-6548ac5e1567

1:01:58 PM:
info
β•‘β•‘β–‘β–‘ Scheduling ST job to run in 120.0s, at Fri, Sep 30 2016 @ 1:03 PM EDT


	b67d25bd-f027-4b71-883a-6548ac5e1567

1:01:58 PM:
trace
β•‘β•‘β–‘β–‘ Rescheduling time triggers


	b67d25bd-f027-4b71-883a-6548ac5e1567

1:01:58 PM:
trace
β•‘β•šβ•β• Processing tasks (v0.2.14c.20160908)


	b67d25bd-f027-4b71-883a-6548ac5e1567

1:01:58 PM:
trace
║╔══ Event processing took 428ms


	b67d25bd-f027-4b71-883a-6548ac5e1567

1:01:57 PM:
info
β•‘β•‘β–‘β–‘ ♦ Latching Piston changed state to false ♦


	b67d25bd-f027-4b71-883a-6548ac5e1567

1:01:57 PM:
trace
β•‘β•šβ•β• Processing event motion for device Hall Motion 

Sensor with id b5776031-d76b-4fdf-932c-cae2c809ea68, value inactive,
generated on Fri Sep 30 17:01:56 UTC 2016, about 697ms ago
(v0.2.14c.20160908)

	b67d25bd-f027-4b71-883a-6548ac5e1567

1:01:57 PM:
trace
β•šβ•β•β• Received a dual block device event


	b67d25bd-f027-4b71-883a-6548ac5e1567

1:01:23 PM:
trace
║╔══ Task processing took 492ms


	b67d25bd-f027-4b71-883a-6548ac5e1567

1:01:23 PM:
info
β•‘β•‘β–‘β–‘ Executing command: [Hall Light].setLevel([100]) (86ms)


	b67d25bd-f027-4b71-883a-6548ac5e1567

1:01:23 PM:
trace
╔═══ Piston done in 829ms


	b67d25bd-f027-4b71-883a-6548ac5e1567

1:01:23 PM:
info
β•‘β•‘β–‘β–‘ Executing command: [Hall Light].on() (101ms)


	b67d25bd-f027-4b71-883a-6548ac5e1567

1:01:23 PM:
trace
β•‘β•‘β–‘β–‘ Removing any existing ST safety nets


	b67d25bd-f027-4b71-883a-6548ac5e1567

1:01:22 PM:
info
β•‘β•‘β–‘β–‘ Scheduling ST job to run in 19778.0s, at Fri, Sep 30 2016 @ 6:31 PM EDT


	b67d25bd-f027-4b71-883a-6548ac5e1567

1:01:22 PM:
trace
β•‘β•‘β–‘β–‘ Installing ST safety net


	b67d25bd-f027-4b71-883a-6548ac5e1567

1:01:22 PM:
trace
β•‘β•šβ•β• Processing tasks (v0.2.14c.20160908)


	b67d25bd-f027-4b71-883a-6548ac5e1567

1:01:22 PM:
trace
β•‘β•‘β–‘β–‘ Rescheduling time triggers


	b67d25bd-f027-4b71-883a-6548ac5e1567

1:01:22 PM:
info
β•‘β•‘β–‘β–‘ ♦ Latching Piston changed state to true ♦


	b67d25bd-f027-4b71-883a-6548ac5e1567

1:01:22 PM:
trace
║╔══ Event processing took 178ms


	b67d25bd-f027-4b71-883a-6548ac5e1567

1:01:22 PM:
trace
β•‘β•šβ•β• Processing event motion for device Hall Motion 

Sensor with id b5776031-d76b-4fdf-932c-cae2c809ea68, value active,
generated on Fri Sep 30 17:01:21 UTC 2016, about 694ms ago
(v0.2.14c.20160908)

	b67d25bd-f027-4b71-883a-6548ac5e1567

1:01:22 PM:
trace
β•šβ•β•β• Received a dual block device event

Thanks. I killed the PIston and rebuilt it, but it still does not work. See below for what I have currently.

Same problem as before - CoRE does not take any action. Yes the device works fine with other smart app, including toggling the light when button #7 is pressed.

What steps are recommended from here? How can I troubleshoot this further? Thanks!

Please enable logs and post logs here… please

Sure. Do I enable logs by going to the first page of the piston and then going to Advanced Options and enabling debugging and then selecting the Log aaaa messages for each toggle? Where does it then put the logs - in Live Logging in the ST dashboard?

I think your When True statement is in the wrong place. By that current logic your hallway light will always come on when motion is detected. You need to put the When True statement outside that entire group.

====================

Time is between 30 minutes before sunset and 11:00
OR
Time is between 6 and sunrise
OR
Weather is less than 1000lux

AND
Hall motion is active

====================
When True
Turn on Hall Light

Yeah this is what I was thinking but Michael said to add the OR Motion is Active after that part so that when someone remains in the hall the light will stay on until they leave.

Actually it is like that already but there is the added OR Motion is Active after that whole group.

That is what your THEN statement is doing; after two minutes of inactivity then your light will turn off.

Below is a screenshot of the live logging with debugging enabled. Clearly the issue is this: Function eval_trg_changes_to for ZWN-SC7 Enerwave 7 Button Scene Controller’s button [button 7] changes to β€˜pushed’ returned false .When I ran this test, I purposely had button 2 active, so that when I pressed button 7 it would (should have) been detected as being β€œchanged to” button 7. Note that when I change the Piston from Changes To to β€œIs” it doesn’t work either (that is how I had it originally prior to Michael recommending I try Changes To instead of IS. Please let me know your thoughts and how we can troubleshoot this further. Thank you!!

Problem is in the DTH - it’s sending the wrong value for the event.

Fixed in https://github.com/ady624/ZWN-SC7-Enerwave-7-Button-Scene-Controller/blob/master/ZWN-SC7.DeviceType.groovy

Use this DTH and see how that works.

Hi All,

CoRE looks great, thank you! I need some advice on how to getting something working correctly, My current Pistons have some bugs and I think I’m missing something.

At Sunrise I should have Piston that changes the Mode:

this then triggers a second Piston based on what the mode changed to:

The problem is all six Pistons related to Mode change appear to execute and the correct one appears to trigger four or five times.

Is there an easy way to see what the execution path was, and maybe would be?

Thanks

Am I using the variable correctly? It’s not displaying the value.

But I think the light was turning off and then on again when someone remains in the hall.

Ahh, in that case then you most likely need to add a β€œCancel on piston state change” on your THEN statement; which basically cancels your THEN actions if motion is still detected. You can find that in the Task cancellation policy at the bottom of the THEN group.

OK I will try that! Thanks!