HomeGenie Forum

General Category => General Discussion => Topic started by: Deggle on March 18, 2016, 08:38:30 PM

Title: Access a parameter via API
Post by: Deggle on March 18, 2016, 08:38:30 PM
I'm sure there must be a way to do this, but if not perhaps it needs to be down as a feature request.

I'm aware all the module data can be pulled via the API using: /api/HomeAutomation.HomeGenie/Config/Modules.List

However, is there a way to just pull a single parameter, such as Sensor.Temperature for a specific (address known) module?

Thanks in advance,

Tim
Title: Re: Access a parameter via API
Post by: Gene on March 19, 2016, 01:08:16 PM
You can either use /api/HomeAutomation.HomeGenie/Config/Modules.ParameterGet to get a single module parameter or /api/HomeAutomation.HomeGenie/Config/Modules.Get to get the whole module object.

https://github.com/genielabs/HomeGenie/blob/master/HomeGenie/Service/Handlers/Config.cs#L441

Cheers,
g.
Title: Re: Access a parameter via API
Post by: Deggle on April 10, 2016, 07:48:53 PM

I know it's been a while - but thanks for this, it's just what I need to pull out single values via AJAX to my simplified (family and guest) interface/front end.

Cheers,
T