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

Question
speedy 64
Hi.
I have gotten so much help from this forum and fibaro in learning LUA.
So i though i would give something back that might help others.
I have made a virtual device that stores all states in a room from all Fibaro devices in that room.
And then when you press the "Scene" button their states are restored.
You can also dim all the devices in the room simultaniuisly with 1 common slider.
It perfect for ex a motion sensor scene that you want to change "on the fly"
Just call the "Scene" button in the virtual device instead of having to go in to the HC2 to change the scene.
Or if you are like me and want to change scenes from day to day, just use your phone so save the state you want.
It works with Fibaro relays, Dimmers and RGBW devices.
It stores states and the current color of the LED stripe.
To get it working
1. Create global variables and change the virtual device according to that variable.
Remember to change the names in all the buttons and the slider.
2. Enter the Room ID you will use in the virtual device in the TCP port field.
-Enter a "room" in your hc2 with your browser and you see the ID in the link
3. Add your user and password in HC2:setBasicAuthentication("admin", "admin") in the "Save" button4. Save your virtual device after all the changes
5. Set your room to that perfect state
6. Press "Save"
7. Done.
If you add or remove devices from that room you need to press Save again to store the current devices.
It´s only tested with 4.056 due to new Json answers so it will NOT work with 3.6 or lower.
Hope you like it!
Edit* New version with more presets.
This is a "test" version for upcoming new version of VD.
Current VD device settings:
TCP port = Your room ID
3 variables required: (change as you like in code)
LightScene2
LightScene2a
LightScene2b
Please login or register to see this link.
Picture
Please login or register to see this attachment.
*Future:
A new version of this VD is under development
That VD will be able to.
1. Get the room ID its in.
2. Auto create specific variables based on room ID
3. Auto store presets from all devices.
4. Option to exclude devices from the VD.
Will post it here when its done..
10 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.