AC API WebRequest via Webcore


#1

1) Give a description of the problem
I have access to my Daikin Air Condtioning API and I want to create a webcore piston that will change my FAN mode to “Silence” because the current DHT does not support this function

2) What is the expected behaviour?
When I run the piston, AC will change the settings

3) What is happening/not happening?
If I run the http command in browser the AC reacts on every command. When I make the POST request on webcore I receive “403” error

This is the url that should run on webcore ( like the one on browser)

http://192.168.x.x/aircon/set_control_info?pow=1&mode=3&stemp=23&shum=0&f_rate=B&f_dir=0

**4) Post a Green Snapshot of the piston

5) Attach logs after turning logging level to Full
(PASTE YOUR LOGS HERE THEN HIGHLIGHT ALL OF THE LOGS AND CLICK ON THE </> ICON TO FORMAT THEM CORRECTLY)

╔Received event [Acăsică].wc_async_reply = httpRequest with a delay of 0ms

+58ms ║RunTime Analysis CS > 18ms > PS > 5ms > PE > 35ms > CE

+61ms ║Runtime (38671 bytes) successfully initialized in 5ms (v0.3.110.20191009) (60ms)

+62ms ║╔Execution stage started

+74ms ║║403

+76ms ║║Executed virtual command log (1ms)

+78ms ║╚Execution stage complete. (16ms)

+79ms ╚Event processed successfully (79ms)

Please help me!
Thanks
Vlad


#2

It isn’t kit that I’ve worked with, but you do show a URL that you say works with a browser. Browsers would normally be using a GET request and that URL has the query string typical of a GET request. Have you tried with a GET rather than a POST?


#3

Changed to “GET”, same 403 response….

And yes, the URL does work in browser…

In the API Instructions that I found online, they say that I should use POST (link below)


#4

Get requests are not currently working in the latest version of webcore on ST. See this post for how to revert to a working version:


#5

Hi!

Thanks for the insight but I am currently running 0.3.110 so it should work…


#6

I thought 0.3.110 used exclusively synchronous HTTP. You are getting an async reply though.

Also your piston says you are on 0.3.113 UI but your logs are from 0.3.110 runtime.

Are all four of your SmartApps the same version as something doesn’t seem quite right there?


#7

Updated all 4 codes in IDE but still the same issue. What is also strange is that the “UI Version” it’s still 0.3.113 also after updating and publishing the smartapps.

Is there anything else To be done?:-?


#8

Did you try editing and re-saving the piston after updating the smartapps? Other than that, I can’t think of anything else.


#9

Changing the codes really messed up most of my pistons.
It seems that this version of webcore is unable to change Boolean variables based on different conditions……
Any thoughts?

LE: Solved by fresh install of WebCore….
I’ll test also the piston from above once again…


#10

Solved!

It needed a authorization header of form “Host” = “192.168.x.x” .
Apparently is a special request from Daikin.

Now it works :grin:
Anyway thanks very much for support