HomeGenie Forum

Automation Program Plugins and Wizard Scripting => Help => Topic started by: maxflax on January 02, 2015, 07:03:31 PM

Title: Add property to sensor.
Post by: maxflax on January 02, 2015, 07:03:31 PM
Hi,

I am expanding your Security System program and I'm adding some features to the doorwindow sensor so I can see directly on the sensor if it's armed or disarmed with a icon which is red for disarmed and green for armed. I have different modes for the alarm (Away, Home, Off). For this to work I need a property to use on the sensor module to hold my value indicating the armed state. Thought I might use the Sensor.Generic but I don't know if thats for others stuff which I might break then. Haven't really looked into what the generic is for either.

Is there a better way doing this or is it possible to add a new property Sensor.Armed or something?

Title: Re: Add property to sensor.
Post by: Gene on January 02, 2015, 09:00:11 PM
You can add any custom property to a module.

Code: [Select]
module.Parameter("Sensor.MyParameter").Value = "whatever";

Title: Re: Add property to sensor.
Post by: maxflax on January 02, 2015, 09:16:18 PM
Cool, and reading that is with the same way as  the others.. HG.WebApp.Utility.GetModulePropertyByName?
Will adding and changing a custom parameter trigger a UI update?

Been trying to figure out how to trigger a refresh of the control in the GUI but with no luck.
Title: Re: Add property to sensor.
Post by: maxflax on January 03, 2015, 03:20:22 PM

ProgramHelper RaiseEvent   (   ModuleHelper    module,
string    parameter,
string    value,
string    description
)      

Did the trick, would like to be able to suppress the popup thou. A bool which is default true to show but when set to false will suppress the notification popup.
Title: Re: Add property to sensor.
Post by: enterprised on January 05, 2015, 02:36:20 AM
"Did the trick, would like to be able to suppress the popup thou. A bool which is default true to show but when set to false will suppress the notification popup."

I motion that.
Title: Re: Add property to sensor.
Post by: Gene on January 05, 2015, 02:43:56 AM
This is already among feature requests:

https://github.com/genielabs/HomeGenie/issues/46

g.