CoRE and Piston Rules Engine, first design steps

so why is my rule constantly re-evaluating as well as rescheduling the timer then?

312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:20 PM: trace ╔═══ Event processing took 117ms
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:20 PM: trace ╚═══ Processing event power for device Livingroom - TV Outlet with id 769ce4ca-c15d-4022-a482-0f2d17c5507b, value 117.4, generated on Fri May 20 20:49:20 UTC 2016, about 494ms ago
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:20 PM: trace ╔═══ Task processing took 146ms
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:20 PM: trace ║░░░ Removing any existing ST safety nets
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:20 PM: trace ║░░░ Installing ST safety net
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:20 PM: trace ║░░░ Rescheduling time triggers
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:20 PM: trace ╚═══ Processing tasks
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:20 PM: trace ╔═══ Event processing took 114ms
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:20 PM: trace ╚═══ Processing event power for device Livingroom - TV Outlet with id 769ce4ca-c15d-4022-a482-0f2d17c5507b, value 117.4, generated on Fri May 20 20:49:20 UTC 2016, about 495ms ago
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:18 PM: trace ╔═══ Task processing took 147ms
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:18 PM: trace ║░░░ Removing any existing ST safety nets
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:18 PM: trace ║░░░ Installing ST safety net
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:18 PM: trace ║░░░ Rescheduling time triggers
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:18 PM: trace ╚═══ Processing tasks
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:18 PM: trace ╔═══ Event processing took 105ms
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:18 PM: trace ╚═══ Processing event power for device Livingroom - TV Outlet with id 769ce4ca-c15d-4022-a482-0f2d17c5507b, value 115.2, generated on Fri May 20 20:49:17 UTC 2016, about 1024ms ago
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:18 PM: trace ╔═══ Task processing took 148ms
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:18 PM: trace ║░░░ Removing any existing ST safety nets
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:18 PM: trace ║░░░ Installing ST safety net
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:18 PM: trace ║░░░ Rescheduling time triggers
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:18 PM: trace ╚═══ Processing tasks
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:18 PM: trace ╔═══ Event processing took 126ms
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:18 PM: trace ╚═══ Processing event power for device Livingroom - TV Outlet with id 769ce4ca-c15d-4022-a482-0f2d17c5507b, value 115.2, generated on Fri May 20 20:49:17 UTC 2016, about 501ms ago
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:17 PM: trace ╔═══ Task processing took 171ms
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:17 PM: trace ║░░░ Removing any existing ST safety nets
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:17 PM: trace ║░░░ Installing ST safety net
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:17 PM: trace ║░░░ Rescheduling time triggers
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:17 PM: trace ╚═══ Processing tasks
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:17 PM: trace ╔═══ Event processing took 110ms
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:16 PM: trace ╚═══ Processing event power for device Livingroom - TV Outlet with id 769ce4ca-c15d-4022-a482-0f2d17c5507b, value 116, generated on Fri May 20 20:49:16 UTC 2016, about 503ms ago
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:17 PM: trace ╔═══ Task processing took 144ms
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:17 PM: trace ║░░░ Removing any existing ST safety nets
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:17 PM: trace ║░░░ Installing ST safety net
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:16 PM: trace ║░░░ Rescheduling time triggers
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:16 PM: trace ╚═══ Processing tasks
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:16 PM: trace ╔═══ Event processing took 100ms
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:16 PM: trace ╚═══ Processing event power for device Livingroom - TV Outlet with id 769ce4ca-c15d-4022-a482-0f2d17c5507b, value 116, generated on Fri May 20 20:49:16 UTC 2016, about 493ms ago
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:16 PM: trace ╔═══ Task processing took 151ms
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:16 PM: trace ║░░░ Removing any existing ST safety nets
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:16 PM: trace ║░░░ Installing ST safety net
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:16 PM: trace ║░░░ Rescheduling time triggers
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:16 PM: trace ╚═══ Processing tasks
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:16 PM: trace ╔═══ Event processing took 106ms
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:15 PM: trace ╚═══ Processing event power for device Livingroom - TV Outlet with id 769ce4ca-c15d-4022-a482-0f2d17c5507b, value 114.1, generated on Fri May 20 20:49:15 UTC 2016, about 732ms ago
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:16 PM: trace ╔═══ Task processing took 131ms
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:16 PM: trace ║░░░ Removing any existing ST safety nets
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:16 PM: trace ║░░░ Installing ST safety net
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:16 PM: trace ║░░░ Rescheduling time triggers
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:16 PM: trace ╚═══ Processing tasks
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:16 PM: trace ╔═══ Event processing took 110ms
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:15 PM: trace ╚═══ Processing event power for device Livingroom - TV Outlet with id 769ce4ca-c15d-4022-a482-0f2d17c5507b, value 114.1, generated on Fri May 20 20:49:15 UTC 2016, about 732ms ago
61f78345-2058-49b0-b63d-f7c850f576f9 9:49:15 PM: debug Poll is calling refresh
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:15 PM: trace ╔═══ Task processing took 509ms
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:15 PM: trace ║░░░ Removing any existing ST safety nets
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:14 PM: info ║░░░ Executing: [Livingroom - vSwitch].on()
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:14 PM: info ║░░░ Executing: [Livingroom - Floor Lamp Bulb].on()
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:14 PM: info ║░░░ Executing with parameters: [Livingroom - Floor Lamp Bulb].setLevel([25])
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:14 PM: info ║░░░ Executing with parameters: [Livingroom - Floor Lamp Bulb].setSaturation([80])
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:14 PM: info ║░░░ Executing with parameters: [Livingroom - Floor Lamp Bulb].setHue([20])
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:14 PM: trace ║░░░ Installing ST safety net
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:14 PM: trace ║░░░ Rescheduling time triggers
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:14 PM: trace ╚═══ Processing tasks
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:14 PM: trace ╔═══ Event processing took 116ms
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:14 PM: trace ╚═══ Processing event power for device Livingroom - TV Outlet with id 769ce4ca-c15d-4022-a482-0f2d17c5507b, value 114.8, generated on Fri May 20 20:49:13 UTC 2016, about 487ms ago
9c41aad9-2aa4-45cc-8c2e-15a19ce2c5ae 9:49:14 PM: trace setHue(20)
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:13 PM: trace ╔═══ Task processing took 503ms
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:13 PM: trace ║░░░ Removing any existing ST safety nets
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:13 PM: info ║░░░ Executing: [Livingroom - vSwitch].on()
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:13 PM: info ║░░░ Executing: [Livingroom - Floor Lamp Bulb].on()
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:13 PM: info ║░░░ Executing with parameters: [Livingroom - Floor Lamp Bulb].setLevel([25])
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:13 PM: info ║░░░ Executing with parameters: [Livingroom - Floor Lamp Bulb].setSaturation([80])
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:13 PM: info ║░░░ Executing with parameters: [Livingroom - Floor Lamp Bulb].setHue([20])
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:13 PM: trace ║░░░ Installing ST safety net
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:13 PM: trace ║░░░ Rescheduling time triggers
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:13 PM: trace ╚═══ Processing tasks
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:13 PM: trace ╔═══ Event processing took 134ms
312e63ba-bf10-4dd6-907c-d403c3617a6b 9:49:13 PM: trace ╚═══ Processing event power for device Livingroom - TV Outlet with id 769ce4ca-c15d-4022-a482-0f2d17c5507b, value 115.5, generated on Fri May 20 20:49:12 UTC 2016, about 488ms ago
9c41aad9-2aa4-45cc-8c2e-15a19ce2c5ae 9:49:13 PM: trace setSaturation(80)
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:13 PM: trace ╔═══ Task processing took 158ms
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:13 PM: trace ║░░░ Removing any existing ST safety nets
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:13 PM: trace ║░░░ Installing ST safety net
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:13 PM: trace ║░░░ Rescheduling time triggers
5adc2549-f02a-4157-80c0-5244c02a12fc 9:49:13 PM: trace ╚═══ Processing tasks



this would be the same for LUX as it changes I would think

@r4nd0m Because it’s doing exactly what it’s supposed to do. However, I’ve never seen such a chatty power outlet. Did you configure it to report every 1 second?! Check the configuration of your outlet and see if you can make it report less often. The piston correctly re-evaluates on each power value change, as it is supposed to do things when that power level reaches certain targets…

Make it report once a minute or so?

Its the default ST outlet - doesnt seem to have particular settings you could alter …

Mine doesn’t do that… hold on… mine only reports one every 10 minutes. Are you using a custom DTH? If you go to settings, do you have options for reporting interval? Or reporting on % change?

nothing at all here mate

it announces any change and that is the same for the lux sensor unless I trim down the report interval …

Energy (in kwh’s) reports less than Power (in watts) as Power changes more often. Energy is cumulative, Power is realtime draw.

@JDRoberts, @slagle, anyone else, any idea what’s going on with @r4nd0m’s stock ST power outlet? It’s reporting power changes every one second - is that intended?

@michaelahess I modified my outlet code to calculate energy - it does not do so by default. Ignore the energy, power is still reported as an average, every 10 minutes. It may be that when power fluctuates a lot, it reports more often, but every one second seems a bit … extreme. What I do in the DTH is I keep track of last report time, I figure out how much time passed, apply the average power to it and add it to my energy counter. But again, stock DTH does not do energy. And @r4nd0m’s does not. Note: both mine and @r4nd0m’s device is the ST stock outlet - the one ST sells.

My ST outlet does same

I also believe this doesnt really contribute to the hubs performance if I constantly evaluate and push messages … I was hoping the information goes into a buffer and only when the buffer threshold level is reached it would evaluate but obviously this is not the case …

< sarcasm >
Naaaaahhhh, it won’t harm the ST cloud at all :slight_smile: :slight_smile: :slight_smile:
</ sarcasm >

I would assume your zigbee mesh network is pretty busy then?

1 Like

That usually represents a configuration fail at the time of pairing of the device. Usually just removing and repairing it again will fix it. It’s unfortunately pretty common. I know Mike Maxwell has run into it with a brand-new device.

If it’s a real report because a variable load, there are some device handler changes you can make so you can parameterize the reporting interval:

I think somebody was going to submit that as a pull request for the official device handler. @tgauchat might know if that was actually done.

well I got 5 devices and all do this - to me this looks more like works as designed …

If the load is actually changing, then yes, it’s as designed. But it’s a parameter that you can set in the device if you don’t want reports that often. See the thread linked to in the post just above.

1 Like

should that option be available after the correct sync/pair or with the custom code only?

It’s only available if the DTH code itself provides a configure() method. Such a DTH may or may not present options as preferences for users to set. The link @JDRoberts provided hints in the right direction. I don’t think there is any real world need to have the power info thrown at the hub every 1 second. ST should probably not set that to such a low minimum interval, unless they’re trying to stress-test the ST cloud. There is a limit on the number of executions per minute for a SmartApp so if you add all 5 devices to monitor them, you’re guaranteed to exceed that limit. What’s worse, you wouldn’t even know it. Nor need it.

1 Like

My own feeling is that choice is good: I would like to see officially-supported devices have handlers that expose changeable parameters, and then leave it up to the account holder to choose what works best for them. :sunglasses:

As it is, though, we just have to look at each device and each handler to see what’s possible.

3 Likes

well - I have just tried it - to be fair same results - its a LED TV connected to that outlet while the nephew is currently enjoying FIFA different colors etc cause the power consumption to change - so even with the code from the other post I get plenty of reports back … I guess this is indeed as designed …

Every time I mention this on the dev slack channel, all of the ST folk go mute…
I have also yet to find a device, zigbee or zwave that isn’t capable of having it’s reporting parameters changed…

3 Likes

it depends - if I want it to be accurate - it does make sense to do it this way - my use-case, if I watch tv and lux is < value I want to turn off the main lights and switch to the background lights - once I turn off the tv I want the regular motion etc to kick back in - the more I extend the reporting time the longer it takes for the switch back and forth or the more inaccurate this steering will be … unfortunately neither a vswitch works as the evaluation for the vswitch creates the same noise …

probably the system is just not fit for such purposes - same as for security …