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.

iBMS integration
#2
Try this. Change url and group address mapping as needed.
Code:
json = require('json') http = require('socket.http') url = 'http://192.168.1.1/' res, err = http.request(url) if not res then   log('request failed', err) else   res, err = json.pdecode(res)   if not res then     log('failed to parse response', err)   else     grp.checkwrite('1/1/1', res.charge_current)     grp.checkwrite('1/1/2', res.discharge_current)     grp.checkwrite('1/1/3', res.capacity_remaining)     grp.checkwrite('1/1/4', res.battery_soh)     grp.checkwrite('1/2/1', res.batteries[1].total_voltage)     grp.checkwrite('1/2/2', res.batteries[1].current)     grp.checkwrite('1/3/1', res.batteries[2].total_voltage)     grp.checkwrite('1/3/2', res.batteries[2].current)   end end
Reply


Messages In This Thread
iBMS integration - by ivob - Yesterday, 19:23
RE: iBMS integration - by admin - 1 hour ago

Forum Jump: