question on http luup interface

Okay… I am trying to understand the format of http calls to vera…

To get current setpoint
http://192.168.1.30:49451/data_request?id=lu_variableget&DeviceNum=4&serviceId=urn:upnp-org:serviceId:TemperatureSetpoint1_Cool&Variable=CurrentSetpoint

To change cooling setpoint to 75 (example stolen from other posts)
http://192.168.1.30:49451/data_request?id=lr_sPhone_action&device=4&service=urn:upnp-org:serviceId:TemperatureSetpoint1_Cool&action=SetCurrentSetpoint&NewCurrentSetpoint=75

Now… can someone explain what “id=” is? I can’t find that documented…
In the first request it obvious that id=lu_variableget means I am getting a variable.
In the second request this is a request lifted from the smart phone plugin.
But what really does “id=” mean? What are acceptable values?

when I run the second example it works fine, but the output from the call is formatted like the result page is on a smart phone. What needs to be done to this so the result from changing the setpoint is simply an “OK” or some clean ascii text return. I just need to know if it worked or not. (result will be stuffed into a string for evaluation) I figure it must be some other form if id= but again, I have no clue what can/should go here.

Hope this makes sense.

Les

Hi Les, in this page

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

you could find a good detail of what are you looking for.

In your second example, you are making the request through the smartphone plugin. You could also change it for:

http://192.168.1.30:49451/data_request?id=lu_variableset&DeviceNum=4&serviceId=urn:upnp-org:serviceId:TemperatureSetpoint1_Cool&Variable=CurrentSetpoint&Value=75

Hope it helps

Thank you for those bits of info… its amazing what is out there if you just know where it is. Most times I can search around for awhile and stumble on it, this one had been bugging me. :smiley:

Les

Okay… another question…
setting variables from https now give me an OK which is what I was looking for.

Now… I guess this is more of a ‘job’ to turn unit off…
https://fwd2.mios.com/xxx/xxxxx/xxxxx/data_request?id=lu_action&DeviceNum=4&serviceId=urn:upnp-org:serviceId:HVAC_UserOperatingMode1&action=SetModeTarget&NewModeTarget=Off

When I run this, it works, but instead of OK i get back an incrementing number each time its called… 8 14 16 23. I assume this is the task/job #. If for some reason it does not work properly do I get some error code/message instead?

At least with setting variables I assume that anything other than OK means it didn’t work.

Sorry for the ‘dumb’ questions.

Yes, you are right. When you send a command it creates a job. The number that you get is its id. You can check the status with:

/data_request?id=status&DeviceNum=4&output_format=xml

The problem is that you will get a full xml with all status for the device (including its associated jobs)

I was looking for a direct way to query the job status and can’t find it. I found a work around using the wap plugin:

/data_request?id=lr_wap_job&device=4&room=#&job=###&time=0.03

replace the room # and job ###

Another way to check it is just request the variable result and see if it really changed :slight_smile: Not too sophisticated

Following the logic above I’m trying to set a cool setpoint. This request:

/data_request?id=lu_action&DeviceNum=3&serviceId=urn:upnp-org:serviceId:TemperatureSetpoint1_Cool&action=SetCurrentSetpoint&NewCurrentSetpointCool=55

Produces the following error:
ERROR: Device does not handle service/action

Can anyone tell me what’s wrong here?
Thanks!

@dluksenberg,
It should look like:
[tt] http://veraIP:3480/data_request?id=lu_action&DeviceNum=98&serviceId=urn:upnp-org:serviceId:TemperatureSetpoint1_Cool&action=SetCurrentSetpoint&NewCurrentSetpoint=70[/tt]

The parameter is called “[tt]NewCurrentSetpoint[/tt]”, and you need to have the device # of your T-Stat (mine is #98, per the example above)

I just validated this against my Trane and it’s working…

Thanks! It worked. I was confused by the Luup devices page.
http://wiki.mios.com/index.php/Luup_Devices#HVAC.2FClimate

I tacked on the Cool suffix because of this documentation:

Service
* urn:upnp-org:serviceId:HVAC_UserOperatingMode1
o For action SetModeTarget
* urn:upnp-org:serviceId:TemperatureSetpoint1_Heat
o For action NewCurrentSetpointHeat
* urn:upnp-org:serviceId:TemperatureSetpoint1_Cool
o For action NewCurrentSetpointCool
* urn:upnp-org:serviceId:HVAC_FanOperatingMode1
o For action SetMode

I removed the suffixes on the page, did a little formating, added 2 examples, and got rid of the dummy Latin.

BTW, the captcha for creating a wiki user is broken for Firefox 3.6. The captcha is also broken in chrome for external links in a wiki edit. I just removed http:// to get around that.