Hi i’m having a some issues with a piston i’m trying out, i’m still learning so I may be miles off, but any help suggestions would be appreciated. I was planning on having one piston per light (I’m assuming that’s what i need to do?) at the moment i have 3 pistons per light and it works but thought this would be better to have one. I have just turned off command optimisation to try and improve it but what’s happening is when the lights are off they sometimes don’t turn back off and when they are on the sometimes don’t change.
Changing the temperature of the lights depending on the mode
most of the times one piston per light or lights is optimum.
just looking at the following part of the piston, please share what is the expected behavior here.
Hi @bangali,
Because ZigBee devices don’t change there setting unless there on. So the plan is during the day when the mode changes to a day mode, if a light is already on then just set the brightness to 100% and set the colour to daylight white (6500k). But if the light is off then turn the light on, then send the 2 settings then turn back off, the reason for the wait was to try and help it turn off. I thought that if I paused for a second or two it might have more of a chance of turning back off, but it doesn’t seem to work. Then the same for when it changes to evening and night. It’s because I just have programmed toggleswitchs on the wall so when they change their state, they eather send a on or a off depending on what state the switch of the light is.
I have been having some issues with these lately aswell and turning command optimization off hasn’t improved it. They seem to forget what state they are in and I have to toggle the switch off, on, then off again for the light to turn off. I’ll share that after we fix this one.
I have also been trying to get the lights, the switches, the level and temperature to be variables so that if a lamp goes down I only have to change the variable bit haven’t managed to get this working aswell.
thank you. when the with block at line 37 executes, rgb bulb 11 could be on or off. however, line 40 only turns on the light only when the mode is work @ home or home. then line 41 sets the color temp but only if it is evening.
so, line 40 and 41 will never execute in sequence, even though they should execute in sequence when rgb 11 bulb is off. since, as you point out, zigbee bulbs settings cant be set when they are off.
this and similar with blocks in the rest of the piston might be most of the whats going on here.
Thanks, don’t know how I missed that, I checked it a few times!
OK, so that will help, I have updated it now.
Don’t think the full piston was there before so this is the whole lot can you tell me what else Im doing wrong?
Sorry @bangali I might have misunderstood before, so are you saying that my initial IF the light is on would work to trigger the then only if the light is on. But but the else may still trigger because there is no condition that says only do this if the light is off?
My very little understanding, was that if the 1st instances wasn’t true then it will fall to false and trigger the else as the light can only be on or off. Is this wrong?
is this more like what you were thinking?
I’m bogged down right now getting my house ready for tenants so haven’t got time to take a good look at this… maybe one of the other @webCoRE_Minions could chip in…
No worries, you also got a spaceship to build thanks. Brilliant is webCoRE_Minions the link to use when we need help?
Only minions can use that particular @mention right now I’m afraid… I’ll call a minion meeting to discuss opening it to all.
maybe a @mention for the minions but another for the wider helpers . Then you guys doing get bogged down with the more trivial help questions like mine
For the @webCoRE_Minions what i have below is, is what i have done sofar, it works a bit, if the light is on it seems to work perfectly now, its if the light is off that it doesn’t seem to work now
I would maybe recomend to clean up a bit to make debug a bit more easy.
If you look for change in location mode, example Night.
You dont need to do a “only while night” on all the actions.
It is already covered that it is night me thinks.
Saves a lot of evaluating in the first place.
Do some more testing an maby look at the logs to se if you get a hint.
Hi @einars i did try that the reason i put them in was to try and force them to take the right route, i’ll take them back out though as i don’t think it made a difference like you said.
I tend to build mine in steps.
Keep em simple and bulid upon them.
Somethimes it is a bit tricky to adjust for further functions, but you get a hang of it.
Once you got a pice working, you could copy it, duplicate it and so on.
Once you have cleaned it down to you minimum, if it still dosent do what you want it to.
Post it here and I will have a look at it.
Or some fellow minion, user, helper or something
Soon watching GOT last epiosde here.
That was the plan i thought i had it working with 3 different pistons so tried to clean up and make it too one, because i thought it was working as the 3. Turns out its not working very well as 3 eather, may have to start again .
may have got it working/ ish let me test for a bit more
Can you please check the logs box underneath the piston code? Do you get any warnings saying the execution of such and such tasks was skipped because it would not change anything? Try setting the log level to Full temporarily. If you do get the “skipped” messages, click on the piston name in the editor, go to the advanced options (cog button) and disable command optimizations.
because i have toggle switches that just turn the lights on / off, i want the lights to change their mode then if there already off turn back off so then when the switch is toggled they come on at the right level and temperature. I did originally have a script per switch that depending on the time of day it turned them on at different levels but i had endless issue with this as it would take time to fire or wouldn’t and the wife got fed up.
this is working better i think it takes a while to change the temperature so it was missing the OFF message. The last issue now is sometimes when i go to night it goes to evening or home level?
Hi @ady624 i have the log on full for a bit to try and help find it, it looks ok but then i don’t know what i looking for.
28/08/2017, 21:43:56 +104ms
+0ms ╔Received event [Home].time = 1503953037661 with a delay of -1558ms
+296ms ║RunTime Analysis CS > 18ms > PS > 66ms > PE > 212ms > CE
+310ms ║Runtime (45876 bytes) successfully initialized in 66ms (v0.2.0e5.20170812) (308ms)
+311ms ║╔Execution stage started
+367ms ║║Executed physical command [Hallway].off() (25ms)
+368ms ║║Executed [Hallway].off (27ms)
+370ms ║║Condition #69 evaluated true (38ms)
+372ms ║║Condition group #68 evaluated true (state did not change) (39ms)
+381ms ║║Comparison (string) :aedfd61dabbaf2b5c3fc647f35488f2d: changes_to (string) :aedfd61dabbaf2b5c3fc647f35488f2d: = false (1ms)
+383ms ║║Cancelling condition #36’s schedules…
+384ms ║║Condition #36 evaluated false (8ms)
+386ms ║║Cancelling condition #26’s schedules…
+387ms ║║Condition group #26 evaluated false (state changed) (10ms)
+398ms ║║Comparison (enum) on is (string) off = false (2ms)
+400ms ║║Condition #71 evaluated false (12ms)
+401ms ║║Condition group #70 evaluated false (state did not change) (14ms)
+410ms ║║Comparison (string) :aedfd61dabbaf2b5c3fc647f35488f2d: changes_to (string) :964d0cd483c8df461f20eef29b039dab: = false (1ms)
+413ms ║║Condition #48 evaluated false (6ms)
+414ms ║║Condition group #38 evaluated false (state did not change) (9ms)
+425ms ║║Comparison (enum) on is (string) off = false (2ms)
+427ms ║║Cancelling condition #73’s schedules…
+428ms ║║Condition #73 evaluated false (12ms)
+429ms ║║Cancelling condition #72’s schedules…
+430ms ║║Condition group #72 evaluated false (state changed) (15ms)
+435ms ║╚Execution stage complete. (124ms)
+444ms ╚Event processed successfully (445ms)
28/08/2017, 21:43:51 +771ms
+1ms ╔Received event [Home].mode = Evening with a delay of 311ms
+437ms ║RunTime Analysis CS > 31ms > PS > 91ms > PE > 316ms > CE
+697ms ║Runtime (45865 bytes) successfully initialized in 91ms (v0.2.0e5.20170812) (696ms)
+699ms ║╔Execution stage started
+724ms ║║Comparison (enum) on is (string) on = true (4ms)
+728ms ║║Condition #19 evaluated true (17ms)
+730ms ║║Condition group #null evaluated true (state did not change) (20ms)
+748ms ║║Comparison (string) :aedfd61dabbaf2b5c3fc647f35488f2d: changes_to_any_of (string) :11caac43340ed2b1de78f41f4f00219f:,:00a05f15f14bac7fcf8b8b721fbdb88b: = false (6ms)
+751ms ║║Condition #16 evaluated false (15ms)
+753ms ║║Condition group #1 evaluated false (state did not change) (18ms)
+770ms ║║Comparison (enum) off is (string) off = true (3ms)
+777ms ║║Cancelling statement #20’s schedules…
+813ms ║║Executed physical command [Hallway].on() (31ms)
+814ms ║║Executed [Hallway].on (34ms)
+839ms ║║Executed physical command [Hallway].setColorTemperature([6500]) (20ms)
+841ms ║║Executed [Hallway].setColorTemperature (22ms)
+880ms ║║Executed physical command [Hallway].setLevel([100]) (31ms)
+881ms ║║Executed [Hallway].setLevel (34ms)
+887ms ║║Executed virtual command [Hallway].wait (1ms)
+889ms ║║Requesting a wake up for Mon, Aug 28 2017 @ 9:43:57 PM BST (in 5.0s)
+895ms ║║Condition #69 evaluated true (139ms)
+897ms ║║Condition group #68 evaluated true (state did not change) (142ms)
+911ms ║║Comparison (string) :aedfd61dabbaf2b5c3fc647f35488f2d: changes_to (string) :aedfd61dabbaf2b5c3fc647f35488f2d: = true (1ms)
+914ms ║║Cancelling condition #36’s schedules…
+915ms ║║Condition #36 evaluated true (11ms)
+917ms ║║Cancelling condition #26’s schedules…
+918ms ║║Condition group #26 evaluated true (state changed) (15ms)
+934ms ║║Comparison (enum) off is (string) on = false (3ms)
+937ms ║║Condition #64 evaluated false (13ms)
+939ms ║║Condition group #33 evaluated false (state did not change) (15ms)
+951ms ║║Comparison (string) :aedfd61dabbaf2b5c3fc647f35488f2d: changes_to (string) :964d0cd483c8df461f20eef29b039dab: = false (1ms)
+954ms ║║Condition #48 evaluated false (8ms)
+956ms ║║Condition group #38 evaluated false (state did not change) (10ms)
+968ms ║║Comparison (enum) off is (string) off = true (3ms)
+971ms ║║Cancelling condition #73’s schedules…
+975ms ║║Cancelling statement #39’s schedules…
+1001ms ║║Executed physical command [Hallway].on() (23ms)
+1003ms ║║Executed [Hallway].on (24ms)
+1029ms ║║Executed physical command [Hallway].setColorTemperature([2700]) (20ms)
+1030ms ║║Executed [Hallway].setColorTemperature (22ms)
+1060ms ║║Executed physical command [Hallway].setLevel([20]) (24ms)
+1061ms ║║Executed [Hallway].setLevel (26ms)
+1066ms ║║Executed virtual command [Hallway].wait (0ms)
+1067ms ║║Requesting a wake up for Mon, Aug 28 2017 @ 9:43:57 PM BST (in 5.0s)
+1074ms ║║Condition #73 evaluated true (116ms)
+1075ms ║║Cancelling condition #72’s schedules…
+1076ms ║║Condition group #72 evaluated true (state changed) (119ms)
+1081ms ║╚Execution stage complete. (383ms)
+1085ms ║Setting up scheduled job for Mon, Aug 28 2017 @ 9:43:57 PM BST (in 4.807s), with 1 more job pending
+1121ms ╚Event processed successfully (1121ms)