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

Controlling several devices: Scene or virtual device?


knuth

Question

A simple, rather basic question: I would like to control several devices through one control. The control could be on/off or "set to chosen common value"/off. "Set to common value" could be a dim level for dimmers, or a temperature for thermostats, where the value is not preset but determined as the control is used. I see several ways to do this, each with its own advantages and disadvantages:

1. Make two separate scenes, one to turn the device set on and one to turn them off. 

Advantage: Very simple to implement for on/off control. Activated only when needed.

Disadvantage: Clutters the system with too many scenes. Tricky to achieve value control (but can be done by setting a global variable)

 

2. Make one scene which performs both desired actions. To dictate whether to turn on or off, either check the current status of the unit or have a global variable which toggles between On and Off each time the scene is run.

Advantage: Fewer scenes than option 1. Activated only when needed.

Disadvantage: Still messy to perform value control

 

3. Make a virtual device, with push buttons for on/off or a slider for value control. 

Advantage: Very intuitive and simple interface

Disadvantage: The VD is run every 3 seconds, which is unnecessary as there is no data harvesting involved. 

 

I lean towards doing this as a VD, and could include a long fibaro:sleep command in the LUA code to avoid the code (which would essentially be empty) being run every three seconds. Question: Will a sleeping VD respond immediately to buttons or sliders being used, or only after the sleep period ends? 

 

Or more generally: How do you prefer to manually control a set of devices, through scenes or VDs?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi @knuth ,

 

First of all I do prefer everything to act automatically as much as possible with as less as possible of my and my family members involvement.

 

Still, there will be always some actions that will require to be manually activated. As you already pointed out there are several ways how to do activation but it does not depends only on type of code but also the way you want to use it.

 

So, how do you want to activate action? Is it with mobile app or it is with some remote device or scene activation that can be achieved with for example Fibaro dimmer 2 scene activation?

 

If both ways are acceptable then I will definitely use one scene that is triggered by remote or dimmer scene activation and one VD with buttons ON/OFF.

If you don't need status of the controlled device then you can leave VD main loop empty and not worry too much about it. I have plenty VD's with main loop filled with code and HC2 is still working nicely and CPU utilization is relaxed.

 

 

Link to comment
Share on other sites

  • 0
  • Inquirer
  • Hi @Sankotronic

    My question was related to manual control directly from an app, either as a stand-alone action or as an override of automated controls. Here are two examples:
    1. I have three fans, all of which are controlled through scenes based on temperature, humidity, and time. Some times I would like to override these settings, by turning all three fans "on" (too stuffy in here...) or "off" (too noisy to have the fans on right now...) by the push of a virtual button. Two scenes, for "on" and "off" respectively would do the trick, but to me a VD with two buttons seems more relevant. 

     

    2. My lights are mostly controlled manually, except for "leaving home" and "good night" scenes which turn most lights off and leave a few on. At times I would like to turn a certain set of lights (living room + dining room, say) on at a dim level which I decide at the time, using an app or GUI. This requires a way to input values (a slider or a typed in number), which requires a VD. 

     

    Based on your comments, I think a VD is the best option in both these cases. They could both have an empty main loop, as you suggest, or one with only a fibaro:sleep command. Which brings me back to my previous question:

    On 9/29/2019 at 4:30 PM, knuth said:

    Question: Will a sleeping VD respond immediately to buttons or sliders being used, or only after the sleep period ends? 

    Out of interest, does anyone know the answer to this one? And does it make sense to have a VD sleep if its main loop is empty? 

    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.

    ×
    ×
    • Create New...