Jump to content

Circadian Clock Light - or using variable as On levels


boojew

Recommended Posts

Posted

Hey guys - 

 

so, I wanted to emulate the transition style of the philips Hue / circadian alarm clocks by creating a slow transition. I tried doing this but just setting the ramp rate to 8 minutes, but since I only want to dim to 40%, it seems the logic doesnt properly and it instead takes ~2.5 minutes. Not sure why, but anyways, I figured a more controllable way to do this would just be to execute a program on schedule that would just increment the brightness by y% every x seconds; however, from the looks of it, there is no way to either say current onlevel +y% nor is there a way to use a variable as the on target.

 

Any one know any way to accomplish this?

Posted (edited)

Hey guys - 

 

so, I wanted to emulate the transition style of the philips Hue / circadian alarm clocks by creating a slow transition. I tried doing this but just setting the ramp rate to 8 minutes, but since I only want to dim to 40%, it seems the logic doesnt properly and it instead takes ~2.5 minutes. Not sure why, but anyways, I figured a more controllable way to do this would just be to execute a program on schedule that would just increment the brightness by y% every x seconds; however, from the looks of it, there is no way to either say current onlevel +y% nor is there a way to use a variable as the on target.

 

Any one know any way to accomplish this?

With v5.0.10 it is built in and quite easy to save the level and restore it.

 

Here is one light I do a slow fade for a sunset effect. Circadian rhythm colours are easy.  Set your reds and yellows at a fixed level and fade the cold white mix down over time. White LEDs cannot really do proper colour mixes for this with their narrow band blue LEDs.

 

With a percentage level drop your brighter bulbs will catch up with your lower level starting  bulbs  and changes  looks more linear to the eye.

 

The Wait 0 seconds line is because I have about 6 circuits involved in this dimming and they all have separate and different Wait X seconds line so there is no abrupt room level drop and the program load is spread out. (should never be a problem with ISY but maybe with Insteon protocol)

Sunset.fade.chairs - [ID 0114][Parent 00C8]

If
        $sGathRm.mode is $cMODE.SUNSET
    And 'Gathering Room / PotLights over Chairs' Status is not Off
 
Then
        Wait  0 seconds
        $ChairPots.level  = 'Gathering Room / PotLights over Chairs' Status 
        Repeat While $ChairPots.level > 6
           Wait  1 minute 
           $ChairPots.level  = 'Gathering Room / PotLights over Chairs' Status 
           $ChairPots.level *= 0.95
           Set 'Gathering Room / PotLights over Chairs' On '$ChairPots.level %'
        Repeat 1 times
           Set 'Gathering Room / PotLights over Chairs' Off
 
Else
   - No Actions - (To add one, press 'Action')
 


Edited by larryllix
Posted (edited)

Thanks! I upgraded from 4.6.2 to 5.0.10 to give this a shot, but for some reason, it doesnt seem to be working 

 

Test slow fade - [ID 001A][Parent 0001]


If
   - No Conditions - (To add one, press 'Schedule' or 'Condition')


Then
        $fade_counter.level  = 0
        Repeat While $fade_counter.level < 5
           Set '1st Floor / Dining Room / Dining Room Micro' On Level '$fade_counter.level %'
           $[Var 2.4] += 1
           Wait  1 second


Else
   - No Actions - (To add one, press 'Action')

Note, I have just testing with Run Then. My expectation is that the light should be incrementing in 1% intervals to 5%, but it never even turns on :(

 

 

edit: Nevermind... I just realied I used the wrong setting.. should have been 

Test slow fade - [ID 001A][Parent 0001]

If
   - No Conditions - (To add one, press 'Schedule' or 'Condition')
 
Then
        $fade_counter.level  = 1
        Repeat While $fade_counter.level < 40
           Set '1st Floor / Dining Room / Dining Room Micro' On '$fade_counter.level %'
           $fade_counter.level += 1
           Wait  1 second
 
Else
   - No Actions - (To add one, press 'Action')
 


Edited by boojew
  • Like 1
Posted

LOL> Well that would be a ramp up and a quite quick one. Nicely done though!

 

I am surprised you can see see anything until about 10-12% brightness though. I can on my LED strips but they are remotely controlled voltages like a SwitchLinc would do to a connected  LED bulb.

 

I can see you are going to be dangerous with an ISY in your hands! :)

Posted (edited)

Hmm seems 5.0.10 broke something w/ PyISY or the way it is used in Home-Assistant. Hmm.. 

 

EDIT: ok, I am downgrading back to 4.6.2 as Home-Assistant support  is broken somewhere :( 

 

Anyone with any ideas on if my request could be accomplished in 4.6.2? Otherwise, I may look at just writing an external script that calls ISY. 

Edited by boojew
Posted (edited)

Hmm seems 5.0.10 broke something w/ PyISY or the way it is used in Home-Assistant. Hmm.. 

 

EDIT: ok, I am downgrading back to 4.6.2 as Home-Assistant support  is broken somewhere :(

 

Anyone with any ideas on if my request could be accomplished in 4.6.2? Otherwise, I may look at just writing an external script that calls ISY. 

The previous technique was to use the Network Resource module to send a level value to the REST interface built in to the ISY, setting a variable. I don't know how you would get a variable back into the device brightness though.

 

Perhaps a bank of programs to do it? You should really only need a binary log progression of settings anyway. 100%, 50%, 25%, 12%, 6% and slow  ramps in the bulbs.

 

I haven't used PyISY for a long time but I thought others have used it with V5.0.10 sucessfully. I only use NodeLink now and it contains all ISY io_guy's past bridging software now, I think.

Edited by larryllix
Posted

Hmm seems 5.0.10 broke something w/ PyISY or the way it is used in Home-Assistant. Hmm..

 

EDIT: ok, I am downgrading back to 4.6.2 as Home-Assistant support is broken somewhere :(

 

Anyone with any ideas on if my request could be accomplished in 4.6.2? Otherwise, I may look at just writing an external script that calls ISY.

The latest version of PyISY works with 5.0.10, but not sure if it was ever released or pulled into home assistant.

 

Sent from my Pixel XL using Tapatalk

Posted

The latest version of PyISY works with 5.0.10, but not sure if it was ever released or pulled into home assistant.

 

Sent from my Pixel XL using Tapatalk

Looks like it was, but their is either a bug or breaking change as home-assistant isnt getting the data it expects from it when querying 5.0.x. 

Posted

Looks like it was, but their is either a bug or breaking change as home-assistant isnt getting the data it expects from it when querying 5.0.x.

It could be unique to a device you have, but we fixed all known issues and it's working for me on 5.0.10, but I don't use home assistant, just PyISY on it's own.

 

Sent from my Pixel XL using Tapatalk

Posted

It could be unique to a device you have, but we fixed all known issues and it's working for me on 5.0.10, but I don't use home assistant, just PyISY on it's own.

 

Sent from my Pixel XL using Tapatalk

Yea, I spent a little time looking at this today, and I think you are correct that pyisy is not the culprit, but rather the output of the REST API is likely different enough that when home-assistant receives it, it doesnt know what to do with 1 or 2 fields. Unfortunately, the home-assistant ISY module is written in a way I find hard to follow and the logging isnt giving me anything useful. If I had 2 ISYs, I would likely try and fix the component, but since I dont, I will likely end up staying on 4.6.2 and working around this by using Home-Assistant to do this for me. It wont be anywhere near as neat, but it will take me 1/2 the time

Posted

I'm not sure this is of any help but thought I would share how I ramp up lights in a program loop with Z-wave and 4.6.2.  The brighten command suits my needs but the percentage could be specified for finer control.

 

Evening Lights 1

If
                 Status  'Sensors / Multisensor Front Porch' < 5 lux (Luminance)
      And From    Sunset  -  1 hour  and 30 minutes
        For      1 hour and 45 minutes
    And Status  'Great Room Ceiling' < 44%
 
Then
        Wait  10 seconds
        Set 'Great Room Ceiling' Brighten
        Run Program 'Evening Lights 1' (If)
 
Else
   - No Actions - (To add one, press 'Action')
 

 

Posted

I'm not sure this is of any help but thought I would share how I ramp up lights in a program loop with Z-wave and 4.6.2.  The brighten command suits my needs but the percentage could be specified for finer control.

 

Evening Lights 1

 

If

                 Status  'Sensors / Multisensor Front Porch' < 5 lux (Luminance)

      And From    Sunset  -  1 hour  and 30 minutes

        For      1 hour and 45 minutes

    And Status  'Great Room Ceiling' < 44%

 

Then

        Wait  10 seconds

        Set 'Great Room Ceiling' Brighten

        Run Program 'Evening Lights 1' (If)

 

Else

   - No Actions - (To add one, press 'Action')

 

 

 

....

........

......... this is perfect! This is super simple, but it had never occurred to me to just have the program call itself! Thanks

Posted

....

........

......... this is perfect! This is super simple, but it had never occurred to me to just have the program call itself! Thanks

The If section logic should see the change and retrigger itself anyway.

 

I think I was confused about PyISY. It is a different product than I was thinking of in NodeLink. My bad there.

 

Thanks to @Jimbo for jumping in and fixing that mistake.

  • Like 1
Guest
This topic is now closed to further replies.

  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

    • There are no registered users currently online
  • Forum Statistics

    • Total Topics
      37.2k
    • Total Posts
      372.5k
×
×
  • Create New...