more G-Labs products

Author Topic: Access a parameter via API  (Read 1036 times)

March 18, 2016, 08:38:30 PM
Read 1036 times

Deggle

  • *
  • Information
  • Newbie
  • Posts: 11
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

March 19, 2016, 01:08:16 PM
Reply #1

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
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.

April 10, 2016, 07:48:53 PM
Reply #2

Deggle

  • *
  • Information
  • Newbie
  • Posts: 11

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