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


Recommended Posts

Posted (edited)

First things first - I'm not an expert, but I know my way around coding to have a nice set of features and functionality going on in my Home-automation-setup.

 

I think we are all caught up in the same situation about not sharing our scenes, because it ends up being to customised for individual needs, and it takes to much work to make it generic for everyone to use it out of the box.

 

Of course, a lot of my code and ideas is copied from very skillful guys in this forum and other places, and even though I have tailored it for my needs and based it on my fundamental setup, I hope that someone will be able to benefit from the attached files.

 

Just to give you an idea of what you can expect to find:

 

CreateGV.lua - is a scene that creates a devicetable as a globalvariable to hold a reference to all devices in my setup. The basic idea was inspired by @AutoFrank and tailored for my needs. The idea is to reference the individual devices without using the deviceID in the code. It enables you to uninstall/reinstall or replace an existing device without having to alter every reference in the code to make it work again. I changed it to be grouped by device type (instead of by room) to be able to loop through all devices by type, and added an extra layer to the structure to hold device specific properties (instead of just the ID). I have attached a copy of the devicetable (DeviceTable.json) structure to give you an idea of my use.

 

AutoLysNiveau.lua - is a calculator for a general lux-level in your house, based on several lux-devices paired to near by light-source that is taken into account in the calculation to generate a lux-level without fluctuation for handling lux-driven auto light on/off

 

LuxLightAuto.lua - is the activator for lux-driven auto light, which can be based on lux-devices or the above mentioned AutoLysNiveau.lua

 

MotionLightAuto.lua - is a event-/motion-driven auto light ON/OFF-handler with a lot of features - originally based on @10der's work

 

HouseModeChanged.lua - handler for every change to my HouseMode-globalvariable to distinguish between HOME/AWAY/NIGHT/VACATION - use this general VD_HouseMode.vfib to change housemode

 

AutoGeolocation.lua - handler for mobile geofence and automatic change of housemode when multible mobile devices exits and arrives at home

 

Last but not least I have a setup of 6 different make/model of IP-cams that is handled by my QNAP-NAS (with QVR PRO, could as well be Synology alike-setup) the QVR PRO is calling VD_Cam.vfib (handle unlimited number of cams) on detected movement and makes a callback if the current IP-cam is "armed", to start recording. Furthermore the movement is passed on (regardless of armed-state) to CamMotion.luaCamMotionLight.lua which handles auto light from cam-motion.

 

Enjoy ?

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

Edited by Bimmer
  • Thanks 2

Join the conversation

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

Guest
Reply to this topic...

×   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...