@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