22.09.2023, 05:35
For creating profiles use this:
As mentioned before use browser dev tools to figure out correct parameters for the given request.
Code:
data = [[
{
"manufacturer": "TEST",
"description": "TEST",
"mapping": [
{ "name": "C1", "bus_datatype": "bool", "type": "coil", "address": 0, "writable": true }
]
}
]]
vars = {
plugin = 'modbus',
request = 'profile-save',
file = data,
file_filename = 'test.json',
}
webrequest = require('webrequest')
res, err = webrequest('general', 'plugin', vars)
log(res)
As mentioned before use browser dev tools to figure out correct parameters for the given request.