I’m trying to define a thing declaratively in the Thing file, but cannot figure out how the properties should be defined. I can define the Bridge just fine, but problem is with the individual Things.
A working bridge is:
Bridge lgthinq:bridge:df7c4e9d43 "LG ThinQ Bridge" [ country="--", manualCountry="FI", language="--", manualLanguage="fi-FI", username="my@email.com", password="mypwd" ]
{ // thing comes here, see below
}
If I add a thing via UI, it will result with this in the org.openhab.core.thing.Thing.json
:
"lgthinq:201:df7c4e9d43:459f59e5-d80e-1871-9e0a-4cbad7f8eddc": {
"class": "org.openhab.core.thing.internal.ThingStorageEntity",
"value": {
"isBridge": false,
"channels": ["OMITTED"],
"label": "Washing Machine",
"bridgeUID": "lgthinq:bridge:df7c4e9d43",
"configuration": {},
"properties": {
"device_alias": "Washing Machine",
"device_id": "459f59e5-d80e-1871-9e0a-4cbad7f8eddc",
"modelId": "F_VB_Y___W.B_2QEUK",
"model_url_info": "https://objectcontent.lgthinq.com/39dd1e90-5aea-4ace-8bd1-e10bed926779?hdnts\u003dexp\u003d1680656673~hmac\u003d2a73517c5d9a3aa0c27eb45320d54b28e71a56490e59b05eefe742a43e4a4d63",
"platform_type": "thinq2"
},
"UID": "lgthinq:201:df7c4e9d43:459f59e5-d80e-1871-9e0a-4cbad7f8eddc",
"thingTypeUID": "lgthinq:201"
}
Now, turning that into Thing definition (and placed inside the Bridge definition) should be something like this:
{
Thing 201 WashingMachine "Washing machine" [device_alias="Washing Machine", device_id="459f59e5-d80e-1871-9e0a-4cbad7f8eddc", modelId="F_VB_Y___W.B_2QEUK", model_url_info="https://objectcontent.lgthinq.com/39dd1e90-5aea-4ace-8bd1-e10bed926779?hdnts\u003dexp\u003d1680656673~hmac\u003d2a73517c5d9a3aa0c27eb45320d54b28e71a56490e59b05eefe742a43e4a4d63", platform_type="thinq2"]
// also decoding the unicode = chars in URL gives same result
// Thing 201 WashingMachine "Washing machine" [device_alias="Washing Machine", device_id="459f59e5-d80e-1871-9e0a-4cbad7f8eddc", modelId="F_VB_Y___W.B_2QEUK", model_url_info="https://objectcontent.lgthinq.com/39dd1e90-5aea-4ace-8bd1-e10bed926779?hdnts=exp=1680656673~hmac=2a73517c5d9a3aa0c27eb45320d54b28e71a56490e59b05eefe742a43e4a4d63", platform_type="thinq2"]
}
However, it doesn’t work:
2022-11-28 17:40:57.680 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'lgthinq:201:df7c4e9d43:WashingMachine' changed from UNINITIALIZED to INITIALIZING
==> /var/log/openhab/openhab.log <==
2022-11-28 17:40:57.689 [DEBUG] [nternal.handler.LGThinQWasherHandler] - Initializing Thinq thing. Washer Thing v0.1
2022-11-28 17:40:57.691 [DEBUG] [nternal.handler.LGThinQWasherHandler] - initializeThing LQ Thinq lgthinq:201:df7c4e9d43:WashingMachine. Bridge status ONLINE
2022-11-28 17:40:57.693 [ERROR] [ices.LGThinQAbstractApiClientService] - Error reading resource from URI:
java.net.MalformedURLException: no protocol:
at java.net.URL.<init>(URL.java:645) ~[?:?]
at java.net.URL.<init>(URL.java:541) ~[?:?]
at java.net.URL.<init>(URL.java:488) ~[?:?]
at org.openhab.binding.lgthinq.lgservices.LGThinQAbstractApiClientService.loadDeviceCapability(LGThinQAbstractApiClientService.java:114) [bundleFile:?]
at org.openhab.binding.lgthinq.lgservices.LGThinQAbstractApiClientService.getCapability(LGThinQAbstractApiClientService.java:248) [bundleFile:?]
at org.openhab.binding.lgthinq.internal.handler.LGThinQAbstractDeviceHandler.getCapabilities(LGThinQAbstractDeviceHandler.java:192) [bundleFile:?]
at org.openhab.binding.lgthinq.internal.handler.LGThinQWasherHandler.updateChannelDynStateDescription(LGThinQWasherHandler.java:110) [bundleFile:?]
at org.openhab.binding.lgthinq.internal.handler.LGThinQAbstractDeviceHandler.initializeThing(LGThinQAbstractDeviceHandler.java:207) [bundleFile:?]
at org.openhab.binding.lgthinq.internal.handler.LGThinQWasherHandler.initialize(LGThinQWasherHandler.java:105) [bundleFile:?]
at jdk.internal.reflect.GeneratedMethodAccessor94.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:829) [?:?]
2022-11-28 17:40:57.698 [ERROR] [nternal.handler.LGThinQWasherHandler] - Error updating channels dynamic options descriptions based on capabilities of the device. Fallback to default values.
org.openhab.binding.lgthinq.internal.errors.LGThinqApiException: Error reading IO interface
at org.openhab.binding.lgthinq.lgservices.LGThinQAbstractApiClientService.loadDeviceCapability(LGThinQAbstractApiClientService.java:120) ~[bundleFile:?]
at org.openhab.binding.lgthinq.lgservices.LGThinQAbstractApiClientService.getCapability(LGThinQAbstractApiClientService.java:248) ~[bundleFile:?]
at org.openhab.binding.lgthinq.internal.handler.LGThinQAbstractDeviceHandler.getCapabilities(LGThinQAbstractDeviceHandler.java:192) ~[bundleFile:?]
at org.openhab.binding.lgthinq.internal.handler.LGThinQWasherHandler.updateChannelDynStateDescription(LGThinQWasherHandler.java:110) ~[bundleFile:?]
at org.openhab.binding.lgthinq.internal.handler.LGThinQAbstractDeviceHandler.initializeThing(LGThinQAbstractDeviceHandler.java:207) [bundleFile:?]
at org.openhab.binding.lgthinq.internal.handler.LGThinQWasherHandler.initialize(LGThinQWasherHandler.java:105) [bundleFile:?]
at jdk.internal.reflect.GeneratedMethodAccessor94.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: java.net.MalformedURLException: no protocol:
at java.net.URL.<init>(URL.java:645) ~[?:?]
at java.net.URL.<init>(URL.java:541) ~[?:?]
at java.net.URL.<init>(URL.java:488) ~[?:?]
at org.openhab.binding.lgthinq.lgservices.LGThinQAbstractApiClientService.loadDeviceCapability(LGThinQAbstractApiClientService.java:114) ~[bundleFile:?]
... 14 more
Any pointers what could be causing this and what am I configuring incorrectly in the Thing definition?