NEWS
state value : needs integer instead of text
-
to read values of adapters in loxone I need to be able to read values. Loxone cannot read text, only values. E.g. with the LG-think adapter the state values are text, while the corresponding numbers are also available, but not via the state variable. So I am looking for a way to easily read those values via the rest API. Can anyone help with this ?
-
@claudecoppens Example
on({ id: 'lg-thinq.device.state', change: 'any' }, function (obj) { let numValue; switch (obj.state.val) { case 'ON': numValue = 1; break; case 'OFF': numValue = 0; break; default: numValue = -1; // or any default value } setState('0_userdata.0.device.numericState', numValue); // Replace with your target state });
REST-API (simpleApi)
GET http://<iobroker-ip>:8087/get/0_userdata.0.device.numericState