[SOLVED] HTTP disable thing from rule authentication error

Well, it’s not really usual to mess with Things from rules, which is why the API isn’t really there and straight forward. What are you really trying to accomplish? Typically you would be working with Items, not Things.

With the JS Scripting add-on installed it should be something like

var thingMgr = osgi.getService('org.openhab.core.thing.ThingManager');
var ThingUID = Java.type('org.openhab.core.thing.ThingUID');
thingMgr.setEnabled(new ThingUID('thing:uid:string'), false);
5 Likes