Lights not changing brightness during set times


#1

1) Give a description of the problem
Unclear on how to make lights set to 30% between set time & set time, then have them set to 100% between set time and set time.

2) What is the expected behaviour?
If you turn on any or all of the 5 lights in the kitchen between 1159 pm and 0600 am light sets to 30% brightness. If you turn any or all of the 5 lights in the kitchen between 0601 am pm and 1155 pm light sets to 100% brightness

3) What is happening/not happening?
I tested it with just the 30% change and worked fine, went back put in the 100% part but lights always staying at 30%. Only wrote few pistons, sure this is stupid easy, I just could not figure it out. Thanks for any help.

**4) Post a Green Snapshot of the piston!

5) Attach logs after turning logging level to Full
Sorry not logs


#2

I would highly encourage turning OFF the option:
Show when true/false actions

pic

99% of pistons can be created with only the two check marks I have displayed above.
(the other options will likely confuse, more than help)


The normal layout for a piston does not use “when true” at all.

IF something happen                   <-- Trigger
Then
    IF Time is between 12:01am & 6am  <--Condition
    Then
        Set level to 30%
    Else
        Set level to 100%
    END IF
END IF

In other words, I would re-structure lines 19-37 and lines 41-56.


Pro Tip:

Also note that both of the times are on the same day, and does not span midnight


#3

Ok so I re-did the piston but now what is happening is if I tell google to turn off the lights between midnight and 7 the lights turn off, then turn right back on? Sme thing if I use the ST app.


#4

My apologies… I should have elaborated on the trigger in my last post…

The lightning bolts in the left margin are the events that will execute the piston…

This means any change in any of your 5 switches (either turning on or off) will run thru the entire code, top to bottom.

I usually use precise triggers, instead of vague conditions. Maybe something like:

IF any of Dimmer 3 or 4's switch CHANGES TO on  <-- Precise trigger
Then
    IF Time is between 12am and 7am             <-- Vague condition
    Then
        Set level to 30%
    Else
        Set level to 100%
    END IF
END IF

I placed the entire piston inside the “IF switch” block, and indented the “IF Time” block…
(which lets us use that Else block to reduce code)

Note:

Any of the five bulbs turning on or off will still execute this piston…
… but the only time action will take place is when one of them turns on.


Pro Tip:

Instead of having 5 triggers in a single piston, I would usually designate one of those bulbs to be the “master” bulb. Same basic code, but only one bulb as the trigger. (The other 4 bulbs can mirror that one)

Otherwise, a single event can easily cause the piston to run 5 times, back to back.

Just my two cents.


#5

Where you are putting:
Then
Set level to 30%

How are you doing that? I can get it in there but I have to put with kitchen 1 before I can get the Do line

Hope that makes sense. I have no logical thinking / code writing skills
I really want to understand this but obviously it is beyond my grasp. Grrrr.


#6

Again, my apologies…
All commands need to be inside some kind of container… IE:

Set level to 30%, should really be:
With Dimmer 3, Set level to 30%

(I tend to streamline my examples to emphasize the basic structure)


Here is my suggestion, ready for import:

Note, I adjusted one of the times 12 hours to match your original request.


#7

Thanks- Best communication style for me on this stuff is “Barney Style” I am getting a bit smarter though, I have been able to write few with no issues! Thanks again for your help.


#8

I just updated my last post with an improved piston (with a few notes to help in the future)