07.03.2022, 08:27
Try running this code and post what you get in Logs. Change ip, user and pwd variables as needed.
Code:
http = require('socket.http')
ip = '192.168.178.100' -- ip address of Waterkotte heat pump
user = 'XXX' -- username of web interface
pwd = 'XXX' -- password of web interface
url = 'http://' .. ip .. '/cgi/login?username=' .. user .. '&password=' .. pwd
res, code = http.request(url)
log('login request', res, code)
if res and code == 200 then
token = res:match('%x+')
log('token', token)
if type(token) == 'string' and #token == 32 then
storage.set('ecotouch-token', token)
end
end
if token then
url = 'http://' .. ip .. '/cgi/readTags?n=1&t1=A1'
res, code = http.request({
url = url,
headers = {
['Cookie'] = 'IDALToken=' .. token
}
})
log('read request', res, code)
end