Intelligent HAH

2 replies [Last post]
BodgeIT
Offline
London, United Kingdom
Joined: 10 Jun 2010

Hi Guys,

I've set myself something of a challenge for my LUA programming development and wondered if I can pick your brains.

I want to start building in some 'intelligence' into the HAH, something some of you may have already done.  My plan is to bring 'presence' as a variable that all applets can be made aware of and modify their behaviour accordingly.  I've seen a few scripts around that seem to refer to presence but only as a 'local' condition i.e. for a room.

My understanding is that on LUA variables can they are global by default but that only means within each applet and local variables are local to the function.

My first thought was to try and create a super global 'variable' that all applets could check but I don't think this is possible, certainly not with my current abilities, so then I thought to use xap and filters.

I could easily create my own broadcast class which each applet(if desired) could check against...i.e. home.lr or away.car something like that.

The HAH could then "reconfigure" things depending on what the global state was.  I could then write a couple of applets that update my new schema by monitoring various items around the house, obvious ones are sensor motion inputs from jeenodes but other inputs could also be used like a button pressed on a Joggler or a remote pressed for Squeezebox etc.

Each area or room would have a sentryApplet that monitors devices and updates the class.

I then thought that this state could be further improved by adding in some 'info quality' checks like checking the last update against current time to determine the probable validity of that state.

Point of the post is to see any of you had any thoughts on this topic and if there were any helpful suggestions on my solution?

mark_baldwin
Offline
Blackburn, United Kingdom
Joined: 19 May 2012
Global

I have scripts set up that use presence. One script decides who is present and broadcasts a xap message, other scripts can then use this.

Maybe have a look at the sunrise/sunset sample. One script decides whether it is nighttime or not, other scripts can then use this

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Mark yes indeed.  Check the

Mark yes indeed.  Check the pair of scripts:  automaticLightsApplet.lua and sunForecastApplet.lua

Hardware Info