RGB LED notification


#1

1) Give a description of the problem
2 issues 1) I would like the light to turn off after 1230, which is does, but if the door is unlocked OR garage door open I would like those alerts to show.

  1. I am trying to get the bulb to be 2000k, a warm typical incandescent bulb look, but it is always a white light

2) What is the expected behaviour?
I have 2 other separate pistons that determine if one of the garage doors are open, and if the front door is unlocked. These piston works great and I can use the variables. This is background info.

In this piston if the time is after 730 (I live north so in the winter sunset is sometimes 530 and summer it can be 930) or after sunset the light turns on. This is a hallway lamp. If the front door is unlocked (using the variable) the light is a golden yellow color. This works. If the garage is open then it is a pink. This works. If both are closed/locked then the light is normal (see problem #2). The light turns off at 1230 every night in another piston. I want to delete that piston and make this piston do everything. I would however like these two “notifications” to be on until sunrise but not the lamp if both are locked/closed. The reason if I’m up late watching a movie it would be good to know the status. (problem #1)

3) What is happening/not happening?
see above

**4) Post a Green Snapshot of the piston![image|45x37]


#2

Issue 2) could be caused by your adjusting levels and colour temperatures ‘by’ an amount instead of ‘to’ an amount.


#3

You have them stacked back to back…

Keeping in mind that each trigger runs thru the entire code, top to bottom…
Let’s say 7:30 comes around, and this piston starts execution…

  • RGB3 comes on (no matter what)
  • If FrontDoor is unlocked, then Set RGB3 color to orange
    … one millisecond later…
  • If GarageDoor is open, then Set RGB3 color to crimson
    … one millisecond later…
  • If FrontDoor is locked AND GarageDoor is closed, then set RGB3 color to 9,5,100

With your current wording, if the first two are true, you will only see orange for a split second before it jumps to crimson.

I would likely nest these a bit, and only send the commands to RGB3 once all the data has been analyzed.

Maybe something like this:

IF FrontDoor is locked
Then
    IF GarageDoor is closed
    Then
        Set RGB3 color to 9,5,100  (all is good)
    ELSE 
        Set RGB3 color to crimson  (Garage is the offender)
    END IF
ELSE
    IF GarageDoor is closed
    Then
        Set RGB3 color to orange   (FrontDoor is the offender)
    ELSE
        Set RGB3 color to BRICK    (BOTH are the offenders)
END IF

Please be careful with the nested IFs and ELSE blocks…
(I do not usually recommend them to new users)

This method will only send ONE command to the RGB3…
(depending on the status of your two doors)


#4

Thanks for your reply, I think the colors work fine as the garage is a bigger security issue than the door unlocked. I think you give a good suggestion to have a 4th option where both are offenders.

I still want the ability to see the notification after 1230am but if both the garage doors and front door are closed and locked the light will be off. Perhaps I can have a second If/then for after 1230.

Thanks again!


#5

For this portion, I would add a new block to the bottom. Something like this:

Every day at 12:30am
Do
    IF Garage door is closed
       and
       FrontDoor is locked
    Then
       Turn off light
    ELSE
       Turn light to red
   END IF
END IF

This simple block will turn the light red if either device is unsafe…