Smart Lighting - dim bulb before turning it on

smartlighting

(Bubba) #1

I have a lifex bulb and an Iris Button. I want to push the button and turn on the iris bulb at 10%. I want to use it in the bedroom in case I have to get up at night and not wake up my wife.

I have already tried using the Smart Lighting smartapp, and a routine, but instead of turning the bulb on at 10%, they both turn on the bulb at 100%, THEN dim it down to 10%. I cannot get it to just come on at only 10%. (i.e. set the brightness to 10%, THEN power on)

I was hoping someone knew of a smartapp I could modify (since Smarthings doesn’t allow access to Smart Lighting app code) that would allow me to change the order commands are given to the bulb to first set the brightness to 10% THEN turn the bulb on.

All in all, I just want to hit a button and have the light come on at 10% brightness.


#2

Webcore can do this.

Here are the installation instructions


(Bubba) #3

What’s the difference between CoRE and webCoRE? I have CoRE smartapp installed, but haven’t started using it. Should I use webCoRE instead?


(Bubba) #4

nevermind, I found this:

I’ll take a look at webCoRE


(Dan P Parker) #5

“web”

Thank you, thank you. I’ll be here all week, with 2 shows on Saturday. Try the veal, and don’t forget to tip your server.


(Bubba) #6

Apparently I get the same results when using webcore. It turns on the light (to the last settings) then adjusts the settings, even though Turn On is the last command. Any suggestions?

/**************************************************************/
/* Bedroom Lamp                                               */
/**************************************************************/
/* Author     : Bubba                                        */
/* Created    : 9/12/2017, 5:36:35 PM                         */
/* Modified   : 9/12/2017, 6:16:52 PM                         */
/* Build      : 4                                             */
/* UI version : v0.2.0e7.20170906                             */
/**************************************************************/
 
execute
  if
    Bedroom Button's button #1 gets pushed
  then
    if
      Bedroom Lamp's switch is on
      and
      Bedroom Lamp's level is equal to 10%
      and
      Bedroom Lamp's colorTemperature is equal to 3300°K
    then
      with
        Bedroom Lamp
      do
        Turn off;
      end with;
    else
      with
        Bedroom Lamp
      do
        Set color temperature to 3300°K;
        Set level to 10%;
        Turn on;
      end with;
    end if;
  end if;
end execute;

#7

Instead of “turn off” try “set level to 0”


#8

I don’t have any lifex only Phillips hue. So I can’t say how lifex work, but with the hue I have to put a 3 second wait between changing color and changing levels or it fails to do one or the other. And also I don’t need to use the turn on function, because setting the level or the color turns it on anyway.


(Bubba) #9

because setting the level or the color turns it on anyway

Hmm. you may have something there…

Maybe I need to move
set level to 10%

as my first command, and not the second.


#10

I use CoRE to do something very similar. In my good morning routine, I have certain lights turn on at 10%. When you’re used to pitch black that’s very bright so I use CoRE in a bedroom bulb. It sets the bulb to 1%. Yes 1%. There is not a big difference from 10 to 1 really, it’s still more that bright enough to wake up to and see everything, and i would go lower if I could. My bulbs are Cree not the Lifex brand.


#11

As @Baz2473 mentions, different brands and even different models will handle the commands differently. Some will always turn on to the last setting and then adjust, while others will allow an adjustment first. So specify the brand and model of bulb that you’re working with and ask in the core forums to see if anyone has a piston working with those.


(Bubba) #12

Turns out you were right! I set the level to 10% as the very first command, that way the bulb turns on at 10%.

I think my piston is extremely inefficient, but it’s working. Here’s the pseudocode (for some reason preformatting text isn’t working):
if button is held
set level to 3%
set color temperature to 3500
set saturation to 0
turn on
else
if button is pressed
AND
bulb is on
turn bulb off
else
if button is pressed
set level to 100%
set color temperature to 3500
set saturation to 0


(Bubba) #13

on a side note:
is there any way to use webcore in a text editor? autocomplete would be so much easier than click, click, click, click…


#14

Webcore does have the ability to cut copy and paste. As well as duplicate statement and it also has a built in clipboard for easy storage of complex statements. It becomes very quick and easy to make very long and complex pistons