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

[Scene] Auto-Lighting with FGMS + Hue randomly fails


Question

Posted

Hello everyone!

 

This is my very first post so please excuse any mistake I could make and don't hesitate to tell me.

 

My house features FGMS sensors + Hue bulbs in every room. I implemented an auto-lighting system that works like a charm in every room except one: the guest room which I call "the office".

 

The script is almost the same in every room and I see no error in the debug console. The script appears to be properly executed but sometimes it isn't.

Here is how it works (the actual script is available below):

  • When a motion is detected, the scene is executed
  • It checks whether the Guest Mode is disabled or not (enabled = no action)
  • It checks whether it is day or night mode (DayMode var value: 1 or 8 = night - [2-7] = day)
    • If Day = Turns the light at Full Power
    • If Night = Turns the light at Low Power

 

My problem is: The light always turns on when it should but randomly at Full or Low power regardless of the DayMode.

 

I've tried to delete/recreate my Hue Virtual device (which is the same for every room and works perfectly) => NOK
I've tried to implement a debug message for EVERY line to check that the fibaro:call(XX, "pressButton", XX) calls for the right VD and Button ID. => NOK. The debug displays the right function and parameters but the light state does not always correspond to it.

 

I am quite discouraged and this is why I ask for some help. Maybe someone could help me find out what's wrong in my code?

 

Fell free to ask for clarification,

Thank you very much for your support,

Aslanistic

 

Please login or register to see this code.


 

10 answers to this question

Recommended Posts

  • 0
Posted

The topic has been moved from "

Please login or register to see this link.

" to "

Please login or register to see this link.

".

 

Temat został przeniesiony z "

Please login or register to see this link.

" do "

Please login or register to see this link.

".

  • 0
Posted

Hi @Aslanistic and welcome to Fibaro forum!

 

I see that you are using Philips HUE virtual device with added buttons for full brightness and low brightness. Is that correct? Well, if it is correct then to help you I need to see code that is executed with this buttons.

 

But I don't see any need to make such buttons since you can just use brightness slider to adjust light level and turn on HUE bulb. Check the latest version of Philips HUE virtual device here:

Then you can use following command to turn HUE at predefined light level:

Please login or register to see this code.

Where Remote_ID you know, briSliderID is number of the brightness slider (same as you use for buttons) and dimLevel is brightness level from 1-100.

 

  • 0
  • Inquirer
  • Posted

    Hi @Sankotronic,

     

    Thank you for your reply.

     

    Actually I have very limited needs regarding communications between my Hue Bridge and my HomeCenter2 box so I created a very simple "homemade" Virtual Device which addresses my needs. I am not using the one you are referring to in your post.

    Please find attached the exported Virtual Device for the office. The slider is not used so the script field on this element is empty.

     

    Thank you for your help,

     

    Aslanistic

    Please login or register to see this attachment.

    • 0
    Posted

    Hi, @Aslanistic,

     

    I just tested your HUE VD and it is working OK. As I can see from scene code only DayMode changes light level so did you check its value when light was turned on with wrong level? How are you changing value of DayMode?

     

    Also it is important position of this lamp and distance from HUE bridge. Is it far, or is there some obstacle between them like concrete wall? Is here any other HUE bulbs between them? I ask because I have one HUE lamp outside of main entrance door that is communicating with HUE bridge over other lamps (there is no direct connection due to thick concrete wall between them). This lamp sometimes does not update its status correctly and turns On with brightness level 1.

    • 0
  • Inquirer
  • Posted

    Hi @Sankotronic,

     

    The DayMode value is displayed in debug every single time the scene is executed and it always corresponds to the right value.

    The DayMode value definition is quite complex and goes way beyond the scope of this thread but if you're interested in it, I'd be happy to share my script in another thread or DM.

     

    Your remark is very interesting and might be the actual reason for my problem! I hadn't thought of such situation. Let me explain...

     

    The office bulb is indeed quite far from the bridge and there are 2 other bulbs between the office bulb and the bridge.

    My HomeCenter2 and Hue Bridge being installed at the same location, I noticed that the office FGMS is using the mesh ZWave network and no direct connection to the HC2. I assume that my office Hue bulb on the Zigbee network might be acting the same way since it's as far as the FGMS from the HC2/Bridge. I don't know how I could make sure of this.

     

    I also noticed that my problem occurs mainly after a long idle time (when the house has been empty for a few hours or after the night) with no action at all on the Zigbee network. As you say, the bulb is lit with a brightness level of 1 (which is the same in Night Mode and got me confused!). Once it has been lit with brightness level 1, it works back again at level 254 if I trigger the FGMS a few seconds later...

     

    23 minutes ago, Sankotronic said:

    This lamp sometimes does not update its status correctly and turns On with brightness level 1.

     

    I guess this is the answer to my problem! Thank you so much for this bright explanation!

     

    Now I am wondering if there is a countermeasure to this problem? In my situation, this is pretty annoying because the light is not adjusting properly in a quite frequently used room.

     

    In case there is no easy way to improve the Zigbee mesh network reliability, what do you think of updating my VD with a first HTTP request, then 500ms pause then the same HTTP request?

    I agree that it is not a very "clean" way to do but I have no other idea...

     

    Anyway, thank you very much for sharing your experience, it really helps! I was going mad with this problem being incapable of identifying the root cause!

     

    Aslanistic.

    • 0
    Posted

    @Aslanistic

     

    You can try do add to send two commands in sequence with pause of at least 100 to 200ms just to give enough time to Bridge to establish communication with this lamp. But it is also good to have at least some checks so you can see if there is problem in communication between HUE bridge and the lamp.

     

    So you can add this code and test to see if it will work for you:

    Please login or register to see this code.

    If lamp is reachable then command to turn it on will be sent only once, but if bridge return status that it is not reachable then this script will send command two times with pause of 100ms between forcing bridge to try to establish communication with distant lamp. Hope that this will help.

    • 0
  • Inquirer
  • Posted

    Hi @Sankotronic,

     

    Your idea sounds great! I'll try to implement it and let you know in a few days if it gets better!

     

    Thank you very much for your assistance !

     

    Aslanistic

    • 0
    Posted
    Just now, Aslanistic said:

    Hi @Sankotronic,

     

    Your idea sounds great! I'll try to implement it and let you know in a few days if it gets better!

     

    Thank you very much for your assistance !

     

    Aslanistic

    Yes, please let me know because then I can implement this solution in next version of Philips HUE VD.

    Thank you!

     

    • 0
  • Inquirer
  • Posted

    Hi @Sankotronic,

     

    After a few days, I'm sorry to tell you that your script is working quite erratically.

     

    I changed it to:

    Please login or register to see this code.

    Sending the command twice is not what I would like to see but it appears to be working fine... My lighting problems in the office are gone.

     

    I still need to check whether the issue was due to a too short "sleep" (100ms in your script vs 300 in mine) or a too high latency due to the line:

    Please login or register to see this code.

    Anyway, thank you very much for your help. I see much clearer now in my potential problems with Hue.

     

    Aslanistic

    • 0
    Posted

    Hi, @Aslanistic,

     

    I just hope that you will solve this problem. Maybe one more lamp somewhere in the middle between HUE bridge and this lamp in the office will do the trick. My hue lamp at the entrance door couldn't work at all until I installed two more lamps outside house that have clear communication with the bridge due to big window. Sometimes we just have to install one more device than we initially planned at some specific place just to make wireless network and devices work as they should.

    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.

    ×
    ×
    • Create New...