Stumped: Simple Send Get fails

Seems each rule I try to use the Send Get within a rule action I need to go through hoops to make it work. In this case I have not found a solution or workaround to send a simple command to MakerApi.
The rule is triggered when a temperature sensor changes. The action, send the temperature via MakerApi to another device. Here is the log output of the rule when triggered:

> [app:1850](http://192.168.1.129/logs#)2022-11-29 08:54:09.494 AM[info](http://192.168.1.129/logs#)Action: Send GET to: http://192.168.1.129/apps/api/737/devices/1749/setTemperature/%temp%?access_token=xxxtheTokenxxx(http://192.168.1.129/apps/api/737/devices/1749/setTemperature/27?access_token=xxxtheTokenxxx)
> 
> [app:1850](http://192.168.1.129/logs#)2022-11-29 08:54:09.443 AM[info](http://192.168.1.129/logs#)Action: Set temp to Backyard Tower temperature((27))
> 
> [app:1850](http://192.168.1.129/logs#)2022-11-29 08:54:09.152 AM[info](http://192.168.1.129/logs#)Triggered: Temperature of Backyard Tower(27) *changed*

It never gets to MakerApi (no log output).
I can copy the url from the above log output, paste it into the browser address bar and, voila, it works. Below is the MakerAPI output

[app:737](http://192.168.1.129/logs#)2022-11-29 09:03:52.247 AM[debug](http://192.168.1.129/logs#)deviceItem called

[app:737](http://192.168.1.129/logs#)2022-11-29 09:03:52.243 AM[debug](http://192.168.1.129/logs#)Executing with secondary command: setTemperature [27] on device: attic

[app:737](http://192.168.1.129/logs#)2022-11-29 09:03:52.203 AM[debug](http://192.168.1.129/logs#)[NUMBER]

[app:737](http://192.168.1.129/logs#)2022-11-29 09:03:52.201 AM[debug](http://192.168.1.129/logs#)[auto, cool, emergencyHeat, fanAuto, fanCirculate, fanOn, heat, initialize, off, setCoolingSetpoint, setHeatingSetpoint, setSupportedThermostatFanModes, setSupportedThermostatModes, setTemperature, setThermostatFanMode, setThermostatMode, setThermostatOperatingState, setThermostatSetpoint]


[app:737](http://192.168.1.129/logs#)2022-11-29 09:03:52.198 AM[debug](http://192.168.1.129/logs#)[27]

[app:737](http://192.168.1.129/logs#)2022-11-29 09:03:52.196 AM[debug](http://192.168.1.129/logs#)setTemperature

[app:737](http://192.168.1.129/logs#)2022-11-29 09:03:52.194 AM[debug](http://192.168.1.129/logs#)findDevice called

[app:737](http://192.168.1.129/logs#)2022-11-29 09:03:52.192 AM[debug](http://192.168.1.129/logs#)sendDeviceCommandSecondary called

I'm a bit confused - So why are you using Maker API and not the device directly?

Maker is usually for external apps that need to access the hub. If you are using an external app then the issue is with that external app assuming the browser call works. If you are using a custom HE app then you should be able to access the device directly.

I am using RM. 1 trigger (Temp changes, 1 action (send Get) Doesnt matter where I run it (local hub, remote hub) the Send Get doesnt work in either situations.

My guess is that maybe it has something to do with the variable and URL encoding. Just for the sake of testing, have you tried it with a literal value (the same way you'd have to do in a browser)? That could help with knowing where to start troubleshooting.

If these are the same hub, or even two hubs on the same LAN, there are also other ways to do this.

That is one of the first things I tried. I didnt need to use the variable temp as I could have used value but I have had issues with RM and Send GET in the past where the solutions was to use local variable formatted to work within the url.
i.e Value = "String with Space"
fStr = Value .replace (' ','%20)

In this case such formatting wasnt needed as all I was passing was a whole number

I think Robert is saying, can you test whether hard coding a number instead of using anything from the device works.

I understood that. I hardcoded the temp value but it never seems to get through. That said, I found a long forgotten old groovy app that used in the past. I prefer RM but in this case, where I have 12 sensors to update, the smartapp may be a more practical means,

2 Likes

Looks like your source and destination hub are the same, try using port 8080, i.e.

Send GET to: http://192.168.1.129:8080/apps/api/737/devices/1749/setTemperature/%temp%?access_token=xxxtheTokenxxx
3 Likes

:smile: Bingo!!!!!!!! :laughing:Is there anything you don't know???

LOL, unfortunately quite a bit, but I've made that mistake a few (thousand) times so easier to spot. It's like the old definition of an expert: An expert is someone who has made so many mistakes that they've learned what doesn't work...

2 Likes

I assumed you were doing this on a different hub, or at least that this was your long-term plan, and in that case, you shouldn't need to worry about an alternate port. If you're doing it on the same hub, why are you using Maker API instead of just dealing with the device directly in the rule?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.