Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

Fibaro Dimmer: Dim lights depending on time


eureka
 Share

Question

Hi all,

 

I have an issue with a script I am making.

 

What I want to do:

I have hallway lights which I want to be full on during the day if I click on one of the dimmers. But at night time I want them to automatically go to a dimmed mode.

 

Issue

I made a script which I think is almost there. It activates on whether de device is triggered. However, if I change the state of the dimmer, it retriggers the scene..

 

I thought of using fibaro:getSourcetrigger but that doesn't work as it can see whether it was triggered by pressing the dimmer or if it was triggered by a scene. Anybody an idea on how to solve this?

 

The Script

Please login or register to see this code.

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 1

Please login or register to see this link.

 or  

Please login or register to see this link.

Edited by 10der
Link to comment
Share on other sites

  • 0
  • Inquirer
  • I tried sceneActivation as well. The issue is that sceneActivation stores the last sceneActivation (even after the scene ended). So if I have 3 dimmers, and I press 1. It will only give a sceneactivation value '16' to that one device. If I then press the second dimmer, this dimmer will get a value of '16', but the first one also still has a value of 16, while it has not been pressed (it remembered the value from previous press)..Is there a way to reset the SceneActivation parameter?

    Link to comment
    Share on other sites

    • 0

    The only solution that I know of, is changing a parameter. Dimmer 2 has a parameter "dimming level at turn on". On dimmer 1 it is a bit different. I have a script that sets this parameter on dimmer 1. It is unsupported code. Sorry for the lack of details, I am not at home

     

    I think you know how to change a parameter... I once posted a script in one of your topics :)

     

     

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • @petergebruers in this case that wouldn't work for what I'm trying to do.

     

    However I did find a solution to the issue. If i use the value of the dimmers as the source trigger then all devices where value change will retrigger the event. However, this will not happen with sceneactivation as trigger.

     

    So I now use sceneactivation as trigger and use getsourcetrigger to get the actual triggered device. please find example below:

     

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    • 0
    38 minutes ago, eureka said:

    in this case that wouldn't work for what I'm trying to do.

     

    Are you sure? I think I tried your solution years ago, and I seems to remember it had another drawback... If I remember well, if a user presses the button, first the light goes to the last set value of the dimmer. Then your script runs and corrects it.

     

    Maybe you want a combination of both... I have computer now so I can give a little more detail (my previous post was typed on a phone).

     

    Parameter 19, I quote: "19. Forced switch on brightness level

    If the parameter is active, switching on the Dimmer 2 (S1 single click) will always set this brightness level."

     

    By default, p 19 = 0 so the dimmer turns on at last set level. If this was 10%, then it turns on at 10%. But if someone dimmed up to 99 then it will turn on at 99 (next time). You script will catch that and correct this situation, but I think you will see a "blink". I am not sure, I cannot try it here, I have no Z-Wave!

     

    So You could set p 19 to 8 at night. If the user clicks S1 or you send "255" the dimmer should go to 8, whatever the previous dimming level was. Then set it to 99

     

    BTW no big deal but dimming levels go from 0-99 and then there is 255, other values are "reserved" by Z-Wave. You write 100 in your script but actually that value does not exist. I know, it works, but it is incorrect. 0 means of, 1 means lowest dimming level and 99 = fully on. And 255 means "turn on" with no level set.

     

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • yeah true! I see a blink. Good thought on running it through the parameter instead of adjusting. Will have a look at it!

    Link to comment
    Share on other sites

    • 0
    19 minutes ago, eureka said:

    yeah true! I see a blink.

     

    Thank you for reporting back... I wasn't sure, now I am! ;-)

     

    Link to comment
    Share on other sites

    • 0

    Uhm hi!

     

    I am a bit late here but maybe someone can share the new code where you use the parameter instead of adjusting? I don't know how to replace the

     

    Please login or register to see this code.

    with a parameter call.

     

    Tjanks

    Edited by klumpo
    removed text formatting
    Link to comment
    Share on other sites

    • 0
    13 hours ago, klumpo said:

    new code where you use the parameter instead of adjusting?

     

    Three years ago I had this code on my HC2 to change the start up level on Dimmer 1. It did work at the time!  

     

    I do not have a running HC2 anymore, so I cannot help you any more than by posting a link to the code. Here it is:

     

    Have fun with automation!

    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

     Share

    ×
    ×
    • Create New...