Struggling to get a gentle fade


#1

1) Give a description of the problem
I’m trying to get the lights in my bedroom to gently fade in when I call a routine from Alexa, as well as turn the lights on downstairs for when I get down there. I tried using the fade command but the lights just turned straight on at 70%. I then tried to implement a manual fade by working out the time in between increases in the level and setting a repeat function. Now nothing turns on when I issue the voice command, not even the lights elsewhere in the house!

2) What is the expected behaviour?
Bedroom lights turn on at 1% brightness and increase by 1% every 18 seconds over a half hour period.
Lights elsewhere in the house turn on.

3) What is happening/not happening?
Nothing!

4) Post a Green Snapshot of the piston


5) Attach logs after turning logging level to Full
1/19/2022, 10:01:15 AM +148ms
+1ms ╔Received event [My home].test = 1642586475148 with a delay of 0ms
+72ms ║RunTime Analysis CS > 20ms > PS > 6ms > PE > 46ms > CE
+75ms ║Runtime (48673 bytes) successfully initialized in 6ms (v0.3.113.20210203) (73ms)
+76ms ║╔Execution stage started
+94ms ║║Comparison (enum) off is (string) on = false (1ms)
+96ms ║║Cancelling condition #22’s schedules…
+97ms ║║Condition #22 evaluated false (16ms)
+98ms ║║Condition group #1 evaluated false (state did not change) (17ms)
+112ms ║║Comparison (time) 36075249 is_between (time) 23400000 … (time) 32400000 = false (9ms)
+114ms ║║Condition #8 evaluated false (12ms)
+115ms ║║Condition group #7 evaluated false (state did not change) (14ms)
+158ms ║║Comparison (time) 36075266 is_between (time) 32400000 … (time) 1642609860000 = true (10ms)
+159ms ║║Time restriction check passed
+161ms ║║Cancelling condition #33’s schedules…
+162ms ║║Condition #33 evaluated true (45ms)
+175ms ║║Comparison (enum) off is (string) on = false (2ms)
+177ms ║║Cancelling condition #34’s schedules…
+178ms ║║Condition #34 evaluated false (14ms)
+179ms ║║Condition group #32 evaluated false (state did not change) (62ms)
+184ms ║║Comparison (time) 36075330 happens_daily_at (time) 77400000 = false (1ms)
+185ms ║║Condition #39 evaluated false (4ms)
+189ms ║║Cancelling statement #39’s schedules…
+192ms ║║Requesting time schedule wake up at Wed, Jan 19 2022 @ 9:30:00 PM GMT
+197ms ║║Condition group #38 evaluated false (state did not change) (15ms)
+214ms ║╚Execution stage complete. (138ms)
+217ms ║Setting up scheduled job for Wed, Jan 19 2022 @ 9:30:00 PM GMT (in 41324s)
+228ms ╚Event processed successfully (227ms)
1/18/2022, 9:30:00 PM +998ms
+10089ms ║Piston waited at a semaphore for 10013ms
1/18/2022, 9:29:59 PM +924ms
+10166ms ║Piston waited at a semaphore for 10099msPreformatted text

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

This is definitely the first issue to attack.


As far as fades go, I highly encourage users (both new and old) to avoid them.

For all practical purposes, once a bulb start fading, it is forced to continue the fade for the entire duration… (IE: if a light is manually turned off, then within 18 seconds, the light pops back on, and the fade resumes)

In your case, it basically “locks” your bulbs for a half hour.


#3

I’m not actually sure that anything triggered when I issued the command through Alexa. The logs suggest nothing happened at 6.45am even though “she” spoke to me. I’ll have to try and play again later on.


#4

Normally, if we want Alexa to force a fade in webCoRE, then we want Alexa to actually flip a SimSwitch (IE: “Morning Fade”)… This way, webCoRE can react to that switch turning on. Something like:

IF Morning Fade turns on
Then 
   IF Time is between 6-9
   Then
      Do cool stuff
   END IF
   Turn off Morning Fade (to reset for the next cycle)
END IF

This way, your verbal command can be natural:
Alexa, turn on Morning Fade


#5

Thats what I went for. I made a simulated alexa switch and then stuck it as an action for when I said good morning. Then as you say, it turns on, does cool stuff, and then resets itself for tomorrow. Except I said it, and the log doesn’t look like it didn’t anything. I’m going to have to rebuild it this evening.


#6

You piston is fired automatically in response to three things.

  • One is the switch state change. That is presumably your Alexa switch so that is fine. However bear in mind that the piston fires regardless of whether the switch reports on or off and runs the code from the top every time so make sure nothing unwanted happens. Also note that the business end of your code only happens in response to the switch changing to on, so using the Test button won’t do a lot. If you have pressed the Test button then the switch hasn’t changed to on.
  • The second one is changes in the dimmer level for your two white bulbs. Every time there is a change in the level of either of those bulbs your piston is going to be called. That will get messy quickly. I suspect you really want ‘greater than’ not ‘rises above’ to terminate your loop.
  • There is a timer event at 9:30pm. That’s fine but just check nothing else will happen in your piston when it runs at that time.