We have moved at community.getvera.com

Author Topic: Guidance for nest plugin?  (Read 26922 times)

Offline RichardTSchaefer

  • Community Beta
  • Master Member
  • ******
  • Posts: 10091
  • Karma: +764/-143
Re: Guidance for nest plugin?
« Reply #15 on: December 04, 2012, 02:04:01 pm »
You have limited access to the information from LUUP code.
You might analyze the JSON data from:

http://ipaddress:3480/data_request?id=user_data2&output_format=json

Offline watou

  • Moderator
  • Hero Member
  • *****
  • Posts: 889
  • Karma: +44/-12
Re: Guidance for nest plugin?
« Reply #16 on: December 04, 2012, 03:00:52 pm »
Thank you, Richard; that's a very helpful URL. 

I still can't see why this device will not appear in the UI.   When I compare it to its parent device which shows perfectly fine, there seems to be nothing special about it.  It has "id_parent" : 32, which is in fact the parent device.  It uses a different device_type/device_file/impl_file than its parent, but they are all minimal boilerplate.

Does anyone have any other ideas to investigate into why this device, despite existing and being findable and update-able by my polling code, will not show in the UI?

Thanks! watou

Offline watou

  • Moderator
  • Hero Member
  • *****
  • Posts: 889
  • Karma: +44/-12
Re: Guidance for nest plugin?
« Reply #17 on: December 04, 2012, 03:23:41 pm »
OK, it was a bad serviceId in my D_ file.  Oy. 

Offline garrettwp

  • Master Member
  • *******
  • Posts: 6371
  • Karma: +227/-128
  • Vera 3, Lite, ISY994
Re: Guidance for nest plugin?
« Reply #18 on: December 04, 2012, 04:12:15 pm »
Got to love those little bugs! They cause so much head ache, yet it always ends up as a stupid simple mistake.

- Garrett


Offline watou

  • Moderator
  • Hero Member
  • *****
  • Posts: 889
  • Karma: +44/-12
Re: Guidance for nest plugin?
« Reply #19 on: December 05, 2012, 06:19:42 pm »
Is there a way to arrange a JSON file for a device type that has both "iconText":"1" (large text for the current temperature) *and* different state icons based on a different variable?  I want to show the current temp like the D_HVAC_ZoneThermostat1.json does, but I also want to show the current running mode (off/heat/cool/auto) by changing the icon.

Are there any examples out there for this, or is it just not possible?  Thanks.

Offline watou

  • Moderator
  • Hero Member
  • *****
  • Posts: 889
  • Karma: +44/-12
Re: Guidance for nest plugin?
« Reply #20 on: December 05, 2012, 11:02:39 pm »
I'm closing in on this thing, but from the attached screenshot, you can see a couple issues:
  • Why do I have a % instead of (degrees)F above my icon?  What hint does Vera need to know we're talking about temperature?
  • I don't know how to set separate heat and cool setpoints to the Nest, so I might have to have a single setpoint for whatever mode we're in.  Problem?
  • Would love to know how to have a variable icon to show you whether heat is on, A/C is on, or nothing is on. I think ModeStatus in HVAC_UserOperatingMode1 can do this, but I don't yet know how to SetModeTarget to a Nest, so I would like to remove the buttons and just change the icon, if it's possible.
  • The device also implements HumiditySensor1, but I'm trying to figure out where to show it.

Offline watou

  • Moderator
  • Hero Member
  • *****
  • Posts: 889
  • Karma: +44/-12
Re: Guidance for nest plugin?
« Reply #21 on: December 05, 2012, 11:32:14 pm »
Talking to myself here, but on #4 above, I think the right way to go is to create a separate humidistat device alongside each thermostat.  It may not do anything for many users, but all Nests at least have a humidity sensor, and it's a good place to put all humidity-related information and settings.

Offline garrettwp

  • Master Member
  • *******
  • Posts: 6371
  • Karma: +227/-128
  • Vera 3, Lite, ISY994
Re: Guidance for nest plugin?
« Reply #22 on: December 06, 2012, 12:49:26 am »
I'm closing in on this thing, but from the attached screenshot, you can see a couple issues:
  • Why do I have a % instead of (degrees)F above my icon?  What hint does Vera need to know we're talking about temperature?
  • I don't know how to set separate heat and cool setpoints to the Nest, so I might have to have a single setpoint for whatever mode we're in.  Problem?
  • Would love to know how to have a variable icon to show you whether heat is on, A/C is on, or nothing is on. I think ModeStatus in HVAC_UserOperatingMode1 can do this, but I don't yet know how to SetModeTarget to a Nest, so I would like to remove the buttons and just change the icon, if it's possible.
  • The device also implements HumiditySensor1, but I'm trying to figure out where to show it.

watou,

It would help if you posted your D_xxx.json file to see what you have and help you solve your gui problems.

1. See comment above.

2. You can probably remove one of the controls and have the one for setting the set point for the current mode you are in.

3. Not sure if this is doable with the thermostat device. As for the off, heat, cool and auto. I would keep these and have it show which mode it is in. Are you able to set the off, heat and cool modes for the nest via the lua code? If you can do that, it should be pretty simple to provide that control via the UI.

4. I would make this a separate humidity child device.

- Garrett

Offline watou

  • Moderator
  • Hero Member
  • *****
  • Posts: 889
  • Karma: +44/-12
Re: Guidance for nest plugin?
« Reply #23 on: December 06, 2012, 05:41:11 pm »
Thank you, Garrett.

I've attached the current thermostat JSON file, and a screenshot that shows the % when it ought to be degrees F, and the new Humidistat device (which at the moment is merely a humidity sensor, but the more recent Nest model can control humidifiers and dehumidifiers based on humidity setpoints, so it's only a matter of time).

The thermostat's setpoint is red, which is irritating and unexplained, but I suppose it's livable, unlike the % sign.

Please let me know if you find anything stupid in the JSON file.  Thank you very much!

- watou

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
Re: Guidance for nest plugin?
« Reply #24 on: December 06, 2012, 05:52:34 pm »
Why do I have a % instead of (degrees)F above my icon?  What hint does Vera need to know we're talking about temperature?

Oh, this is brilliant, here's the JavaScript from UI5:

Code: [Select]
    var device_type = o.device_type.split(":")[o.device_type.split(":").length-2];
...
                try{
                        if (device_type == "HVAC_ZoneThermostat" || device_type == "Heater") {
                                this.find('.value').append(clone_value_temp);
                        } else if (parseInt(jsonp.get_device_definition(o.device_type).iconText)==1) {
                                this.find('.value').append(clone_value_cent);
                        }                           

You HAVE to call your device type mumble:something:HVAC_ZoneThermostat:blah to get the degree sign.


Offline guessed

  • Community Beta
  • Master Member
  • ******
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Guidance for nest plugin?
« Reply #25 on: December 06, 2012, 06:15:29 pm »
Quote
You HAVE to call your device type mumble:something:HVAC_ZoneThermostat:blah to get the degree sign.
LOL, Quality!   I needed a good laugh today.

Offline watou

  • Moderator
  • Hero Member
  • *****
  • Posts: 889
  • Karma: +44/-12
Re: Guidance for nest plugin?
« Reply #26 on: December 06, 2012, 06:49:22 pm »
Fascinating.  Thank you.

I also now see in animatie.js why the choice of vertical slider color is either red or blue.  I'll live with red.

So, off to rename my device type.  Thanks for tracking this down.  I don't understand why this other thermostat (http://code.mios.com/trac/mios_wifi-thermostat) doesn't seem to have the problem, but I know nothing of what the code looked like at the time or what it was running on when it was screen-grabbed.

Thanks again, watou

Offline watou

  • Moderator
  • Hero Member
  • *****
  • Posts: 889
  • Karma: +44/-12
Re: Guidance for nest plugin?
« Reply #27 on: December 08, 2012, 02:21:18 pm »
How does the user get the feedback "Transmit was ok." green status line at the bottom of Z-Wave devices?  I would like to implement similar feedback for commands to the Nest thermostat but I don't see what facility provides this.  Thanks for any pointers.

Offline guessed

  • Community Beta
  • Master Member
  • ******
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Guidance for nest plugin?
« Reply #28 on: December 08, 2012, 03:22:26 pm »
You dont get exactly that, but you get something fairly close in luup.task

I put in a standard(ish) set of functions at the top of my newer plugins that wrap logging, and task output.  I then call these at various spots to give user feedback (the task ones, that is)

Here are the ones I have in the DSC codebase:
    http://code.mios.com/trac/mios_dscalarmpanel/browser/trunk/I_DSCAlarmPanel1.xml#L36

and an example usage:
    http://code.mios.com/trac/mios_dscalarmpanel/browser/trunk/I_DSCAlarmPanel1.xml#L354

Offline watou

  • Moderator
  • Hero Member
  • *****
  • Posts: 889
  • Karma: +44/-12
Re: Guidance for nest plugin?
« Reply #29 on: December 10, 2012, 12:42:39 am »
guessed, thanks for the examples on how to use luup.task.  I will add something like that.

How cool to be able to speak "set ground floor heat to 68" into my Android tablet and it sets the Nest thermostat just like that.  Thanks garretwp for the cool app!

I've straightened out the set point issues, so now there are just a few minor issues and then to package up a beta version of the plugin.