more G-Labs products

Author Topic: Hello and don't scold me! (please)  (Read 1255 times)

January 13, 2016, 05:12:29 AM
Read 1255 times

pr0f

  • *
  • Information
  • Newbie
  • Posts: 4
Hey!  I'm new.  LOVE the platform.

I am a little confused though (trust me, I've spent QUITE some time going around searching, googling, reading docs etc (aside from Forum access which I just got).

I want to extend the functionality and the whole program / module (which I can't seem to add new - is it same as program?) / widget things is confusing me.

I have a cron job (outside of HG right now) that does a curl POST to get honeywell total home comfort stats.  I write that (JSON) to a file, and CURRENTLY I'm using a python program to read and parse that JSON.  I can write the values to the console which I tail (on linux (ubuntu)).  Everything is fine, but I can't find documentation on how to build the widget to display them?  Should the widget PULL the info?  Should the program PUSH the info?

What is a "module" exactly?  I can't seem to build my own (only programs and widgets)??

Can someone please connect the pieces?  I've completed the python functionality to parse the JSON and store the variables and I've seen where you can do
Program.Parameter("temperature").Value = temp;
Program.Parameter("humidity").Value = humid;
Which is fine, but I'm not sure what to do from here (temp and humid are being set by python JSON parse method).

Help?

UPDATE: experienced developer (and mad scientist) with experience in java, JavaScript, PHP, Python, and large continuous amounts of infrastructure architecture.
« Last Edit: January 13, 2016, 05:15:10 AM by pr0f »

January 13, 2016, 04:16:54 PM
Reply #1

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Sounds to me like you need to use a virtual module.  Depending on the language you choose to use, you can either pull the data from the Honeywell page directly or push the data to the module from your external script.  I personally think it's cleaner to do inside HG, but that's a personal preference.

If you parse the data from HG, just assign the value to some parameter value.  If you make the module a sensor type, it will display your data when you add the widget to the interface.

If you parse from outside HG, use the webAPI to push the data to that virtual module.

January 13, 2016, 05:57:37 PM
Reply #2

pr0f

  • *
  • Information
  • Newbie
  • Posts: 4
Thanks!  I looked in the devel docs and user guide - where is some good verbiage on things like virtual modules, modules in general etc.?

Thanks again!

January 13, 2016, 09:38:50 PM
Reply #3

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Your best bet is to search the forum for those key words to see what others have asked related to virtual modules.  I'd look at the APPs that are bundled with HG to see some usage in working code.  I'm not sure off the top of my head which scripts use virtual modules.  Maybe the MQTT one?