How to set the Temperature in Luup for a WDTC-20 Thermostat (was: n00b help)

I am trying to make a scene that simply sets my WDTC-20 to a particular temperature. (the goal being with a couple scenes I can schedule my thermostat).

I came up with this:

luup.call_action(“urn:schemas-upnp-org:device:HVAC_ZoneThermostat:1”,“CurrentSetpoint”,{ SetCurrentSetpoint=“68” },5)

which doesn’t get an error (in the UI) but it doesn’t seem to work either. I have no clue what I am doing, I just cobbled this together from an hour in the wiki.

can anyone give me a CLUE?

Thanks,

jv

jv, I dont have one of these, but given the doco, I’d guess it would be more like the following (but I’m willing to be shot down in flames for being incorrect).

You’re probably looking to call this action (declared in the Luup Plugin code [tt]S_TemperatureSetpoint1.xml[/tt]):

<action> <name>SetCurrentSetpoint</name> <argumentList> <argument> <name>NewCurrentSetpoint</name> <direction>in</direction> <relatedStateVariable>CurrentSetpoint</relatedStateVariable> </argument> </argumentList> </action>

For your call to http://wiki.micasaverde.com/index.php/Luup_Lua_extensions#function:_call_action , the parameters would be as follows:

the “action” would be [tt]“SetCurrentSetpoint”[/tt]
the “argument” would be [tt]“NewCurrentSetpoint”[/tt]

Now I have no idea what Device# you’re trying this on, but I’d be surprised if it’s “[tt]5[/tt]” (as the examples show). You’ll need to look this up in the Devices list of your Vera to find the real number to use here.

Ultimately, it might look something more like:

luup.call_action("urn:schemas-upnp-org:device:HVAC_ZoneThermostat:1","SetCurrentSetpoint",{ NewCurrentSetpoint="68" },7)

where “[tt]7[/tt]” is whatever you find is your Device# for the Zwave-based Thermo.

The difference here btw, is that you’re calling the Set Method to change the value, not setting one of the State Variables directly (that track the outcome of the method).

Either way, let us know if it works, or not. I’m going purely on API descriptions, without a way to check it. I suspect there’ll be other postings, but collectively we can update the wiki with the outcome:

http://wiki.micasaverde.com/index.php/Luup_Scenes_Events

Some additional information is available in these threads:

http://forum.micasaverde.com/index.php?topic=1978.0
http://forum.micasaverde.com/index.php?topic=2130.msg9304#msg9304

The relevant services seem to be:
urn:upnp-org:serviceId:TemperatureSetpoint1_Cool
urn:upnp-org:serviceId:TemperatureSetpoint1_Heat

@Ap15e, from within Luup, you should be able to use the [tt]luup.call_action[/tt] stuff to invoke the method. This will avoid the overheads of going through [tt]luup.inet.wget[/tt].

The URL-based stuff should only be needed it you’re “outside Vera”, like the Control Points area (web Interface, iPhone Native, Crackberry and Air4Vera etc). Did you have trouble getting the direct [tt]call_action[/tt] interface working?

You’re correct about the Service name stuff also, that likely should be changed in the call (although I suspect the Vera impl is just ignoring it and building a dynamic Lua method call behind the scenes)

@guessed:

Agreed: Use Luup Lua extensions if possible (and if Lua portability isn’t needed …).

The only reason for my suggestion on using luup.inet.wget instead of luup.call_action was that I don’t have access to US thermostats and therefore I can’t test my tentative translation from ‘http style’ to ‘Luup style’. :slight_smile:

thanks for the tips. it is coming a little cleared but I still don’t have it working.

my current incarnation is:

 luup.call_action("urn:schemas-upnp-org:device:HVAC_ZoneThermostat:1","SetCurrentSetpoint",{ NewCurrentSetpoint="68" },19)

What is the device number? I have a Device 19, ID 8 and catagroy 5. I have tried all the numbers but no joy.

Not being familiar with any of this I am sure it is something real simple at this point.

Thanks,

jv

just tweaked the title so that others can find this, since similar threads are popping up elsewhere for similar stuff.

Try

luup.call_action(“urn:upnp-org:serviceId:TemperatureSetpoint1_Cool”,“SetCurrentSetpoint”,{ NewCurrentSetpoint=“68” },19)

or

luup.call_action(“urn:upnp-org:serviceId:TemperatureSetpoint1_Heat”,“SetCurrentSetpoint”,{ NewCurrentSetpoint=“68” },19)

Woot! it worked. Thanks for the CLUE.

Now to make HOT, WARM, COOL scenes with appropriate schedules…

I’ve added these to the Scene events wiki page so folks can find them easier in the future.

     http://wiki.micasaverde.com/index.php/Luup_Scenes_Events