This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Daikin AC control via WiFi online controller
#8
(05.07.2016, 05:58)admin Wrote: There's a similar script which uses HTTP for communication:
http://forum.logicmachine.net/showthread.php?tid=320

Example for your AC system:
Code:
function parse(txt)
  local chunks, key, value, result

  chunks = txt:split(',')
  result = {}
  for _, chunk in ipairs(chunks) do
    key, value = unpack(chunk:split('='))
    result[ key ] = value
  end

  return result
end

ip = '192.168.1.1'
http = require('socket.http')
url = 'http://' .. ip .. '/aircon/get_sensor_info?'

result, err = http.request(url)
if result then
  data = parse(result)
  -- log(data)
  grp.update('1/1/1', data.otemp)
else
  alert('HTTP request failed: ' .. tostring(err))
end

i hope someone can help me,
i try to use this script, but i got a fail
it said
Quote:Resident script:11: attempt to call global 'parse' (a nil value)
stack traceback:
For me it looks like he cant connect to my airco?

I changed the IP adres on line 1 to the IP adres of my airco
add the group adresses to my Wiser/LM

and if i open my browser and browse to 'http://192.168.11.99/aircon/get_sensor_info?'
i see the next line: 'ret=OK,htemp=18.0,hhum=-,otemp=15.0,err=0,cmpfreq=0,mompow=1'
like the names on line 12, 13 and 14.

what is what im doing wrong.

i need to say this is the first time, i try to get http request.
Reply


Messages In This Thread
RE: Daikin AC control via WiFi online controller - by Dré - 30.12.2021, 14:16

Forum Jump: