HTTPGET Help

Folks,

I have been going around in circles with this one and I am sure I am doing something really stupid but I have no read so many different topics/resources that I am now completely lost.

I am writing my own device handler for a seneye pond sensor that I have purchased. I am trying to access the sensor values via an api interface I am using the HTTPGET request structured as follows:
def params = [
uri: "https://api.seneye.com",
path: "/v1/devices/111999/exps?",
query: [
"user" : "MyUserName",
"pwd" : "MyPassword"
]
]
and expecting the following response

0

<critical_in>-1</critical_in>

0

0

0

0

<critical_in>-1</critical_in>

0

0

0

0

<critical_in>-1</critical_in>

0

0

0

0

<critical_in>-1</critical_in>

0

0

0

0

The actual response I get is as follows:

111999

My Device

2

<time_diff>0</time_diff>

This information is available from the following URI

https://api.seneye.com/v1/devices?user=MyUserName&pwd=MyPassword

so the URI I am trying to access is very similar

https://api.seneye.com/V1/devices/111999/exps?user=MyUserName&pwd=MyPassword

I am thinking that for some reason my HTTPGet request is omitting the "exps" element in Bold above but cant not figure out way.

Can anyone point me in the right direction.

Many Thanks

The Hubitat log has a continued problem of not parsing the message for xml format display. The data you are receiving is (probably) correct. To display the source XML, use the command:

log.trace groovy.xml.XmlUtil.escapeXml(resp.body)

1 Like