Closed ssalonen closed 3 years ago
After creating things manually using examples in docs, the things do get added as ONLINE but values are NULL according to http://localhost:8080/#!/settings/items/
Logs seem to indicate these manually created things work as they should though
09:13:13.430 [TRACE] [ing.fmiweather.internal.client.Client] - Found value wawa=0.0 @ time=1604733000 for location 101004
09:13:13.430 [TRACE] [ing.fmiweather.internal.client.Client] - Found value wawa=null @ time=1604733600 for location 101004
09:13:13.431 [DEBUG] [ing.fmiweather.internal.client.Client] - Request org.openhab.binding.fmiweather.internal.client.ObservationRequest@188b1634 translated to url https://opendata.fmi.fi/wfs?service=WFS&version=2.0.0&request=getFeature&storedquery_id=fmi::observations::weather::multipointcoverage&starttime=2020-11-07T06:40:00Z&endtime=2020-11-07T07:20:00Z×tep=10&fmisid=101004¶meters=t2m,rh,wd_10min,ws_10min,wg_10min,p_sea,r_1h,snow_aws,vis,n_man,wawa. Response: FMIResponse({Location(name="Helsinki Kumpula", id="101004", latitude=60.20307, longitude=24.96131)={wg_10min=ResponseDataValues(timestampsEpochSecs=[1604731200, 1604731800, 1604732400, 1604733000, 1604733600], values=[6.4, 6.1, 5.4, 5.9, null]), wd_10min=ResponseDataValues(timestampsEpochSecs=[1604731200, 1604731800, 1604732400, 1604733000, 1604733600], values=[244.0, 233.0, 238.0, 239.0, null]), vis=ResponseDataValues(timestampsEpochSecs=[1604731200, 1604731800, 1604732400, 1604733000, 1604733600], values=[50000.0, 50000.0, 50000.0, 50000.0, null]), r_1h=ResponseDataValues(timestampsEpochSecs=[1604731200, 1604731800, 1604732400, 1604733000, 1604733600], values=[null, null, 0.0, null, null]), wawa=ResponseDataValues(timestampsEpochSecs=[1604731200, 1604731800, 1604732400, 1604733000, 1604733600], values=[0.0, 0.0, 0.0, 0.0, null]), n_man=ResponseDataValues(timestampsEpochSecs=[1604731200, 1604731800, 1604732400, 1604733000, 1604733600], values=[0.0, 0.0, 0.0, 0.0, null]), rh=ResponseDataValues(timestampsEpochSecs=[1604731200, 1604731800, 1604732400, 1604733000, 1604733600], values=[90.0, 90.0, 89.0, 88.0, null]), p_sea=ResponseDataValues(timestampsEpochSecs=[1604731200, 1604731800, 1604732400, 1604733000, 1604733600], values=[1019.7, 1019.7, 1019.6, 1019.6, null]), snow_aws=ResponseDataValues(timestampsEpochSecs=[1604731200, 1604731800, 1604732400, 1604733000, 1604733600], values=[0.0, 0.0, 0.0, 0.0, null]), ws_10min=ResponseDataValues(timestampsEpochSecs=[1604731200, 1604731800, 1604732400, 1604733000, 1604733600], values=[4.3, 4.4, 4.1, 4.1, null]), t2m=ResponseDataValues(timestampsEpochSecs=[1604731200, 1604731800, 1604732400, 1604733000, 1604733600], values=[6.4, 6.4, 6.7, 6.9, null])}})
The discovery indeed does not support a forecast thing type - even if they are added as discovery results later in the code:
@cweitkamp oddly I get the same error with both thing types, observation
and forecast
:
09:52:39.648 [ERROR] [enhab.core.thing.binding.ThingFactory] - Thing factory (class org.openhab.binding.fmiweather.internal.HandlerFactory) returned null on create thing when it reports to support the thing type (fmiweather:forecast).
09:52:39.648 [WARN ] [ig.discovery.internal.PersistentInbox] - Cannot create thing. No binding found that supports creating a thing of type fmiweather:forecast.
09:52:45.209 [ERROR] [enhab.core.thing.binding.ThingFactory] - Thing factory (class org.openhab.binding.fmiweather.internal.HandlerFactory) returned null on create thing when it reports to support the thing type (fmiweather:observation).
09:52:45.210 [WARN ] [ig.discovery.internal.PersistentInbox] - Cannot create thing. No binding found that supports creating a thing of type fmiweather:observation.
We found the reason. See https://github.com/openhab/openhab-core/commit/aae207bfe95da3b0b7eaaf08e4beda546a1c228d#r43959474
Thanks to @J-N-K for fixing it.
Pheew, that was advanced, thank you very much!
@cweitkamp is your comment on "The discovery indeed does not support a forecast thing type" still relevant?
The list of supported thing types is used in the DiscoveryServiceRegistry
to create a global list. But I am afraid it currently will not be used further.
To be safe I would recommend to add the missing thing type for the bindings discovery service.
@cweitkamp I have hard time reading the core commit. Would it explain the null items as well?
@ssalonen Sry, I currently have no idea. But it might be related because the fix commited by @J-N-K prevents this exception during XML parsing:
2020-11-07 12:31:53.540 [WARN ] [ig.xml.osgi.XmlDocumentBundleTracker] - The XML document '/OH-INF/thing/thing-types.xml' in module 'org.openhab.binding.fmiweather' could not be parsed: The attribute 'advanced' of the node 'channel-group-type' is not supported or exists multiple times!
---- Debugging information ----
message : The attribute 'advanced' of the node 'channel-group-type' is not supported or exists multiple times!
class : org.openhab.core.thing.xml.internal.ChannelGroupTypeXmlResult
required-type : org.openhab.core.thing.xml.internal.ChannelGroupTypeXmlResult
converter-type : org.openhab.core.thing.xml.internal.ChannelGroupTypeConverter
path : /thing-descriptions/channel-group-type[3]
line number : 282
class[1] : java.util.ArrayList
required-type[1] : java.util.ArrayList
converter-type[1] : com.thoughtworks.xstream.converters.collections.CollectionConverter
class[2] : org.openhab.core.thing.xml.internal.ThingDescriptionList
required-type[2] : org.openhab.core.thing.xml.internal.ThingDescriptionList
converter-type[2] : org.openhab.core.thing.xml.internal.ThingDescriptionConverter
version : 1.4.13
-------------------------------
com.thoughtworks.xstream.converters.ConversionException: The attribute 'advanced' of the node 'channel-group-type' is not supported or exists multiple times!
---- Debugging information ----
message : The attribute 'advanced' of the node 'channel-group-type' is not supported or exists multiple times!
class : org.openhab.core.thing.xml.internal.ChannelGroupTypeXmlResult
required-type : org.openhab.core.thing.xml.internal.ChannelGroupTypeXmlResult
converter-type : org.openhab.core.thing.xml.internal.ChannelGroupTypeConverter
path : /thing-descriptions/channel-group-type[3]
line number : 282
class[1] : java.util.ArrayList
required-type[1] : java.util.ArrayList
converter-type[1] : com.thoughtworks.xstream.converters.collections.CollectionConverter
class[2] : org.openhab.core.thing.xml.internal.ThingDescriptionList
required-type[2] : org.openhab.core.thing.xml.internal.ThingDescriptionList
converter-type[2] : org.openhab.core.thing.xml.internal.ThingDescriptionConverter
version : 1.4.13
-------------------------------
at org.openhab.core.config.xml.util.ConverterAttributeMapValidator.readValidatedAttributes(ConverterAttributeMapValidator.java:117) ~[?:?]
at org.openhab.core.config.xml.util.ConverterAttributeMapValidator.readValidatedAttributes(ConverterAttributeMapValidator.java:82) ~[?:?]
at org.openhab.core.thing.xml.internal.AbstractDescriptionTypeConverter.unmarshal(AbstractDescriptionTypeConverter.java:184) ~[?:?]
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) ~[bundleFile:1.4.13]
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:72) ~[bundleFile:1.4.13]
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) ~[bundleFile:1.4.13]
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50) ~[bundleFile:1.4.13]
at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readBareItem(AbstractCollectionConverter.java:132) ~[bundleFile:1.4.13]
at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:117) ~[bundleFile:1.4.13]
at com.thoughtworks.xstream.converters.collections.CollectionConverter.addCurrentElementToCollection(CollectionConverter.java:98) ~[bundleFile:1.4.13]
at com.thoughtworks.xstream.converters.collections.CollectionConverter.populateCollection(CollectionConverter.java:91) ~[bundleFile:1.4.13]
at com.thoughtworks.xstream.converters.collections.CollectionConverter.populateCollection(CollectionConverter.java:85) ~[bundleFile:1.4.13]
at com.thoughtworks.xstream.converters.collections.CollectionConverter.unmarshal(CollectionConverter.java:80) ~[bundleFile:1.4.13]
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) ~[bundleFile:1.4.13]
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:72) ~[bundleFile:1.4.13]
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) ~[bundleFile:1.4.13]
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50) ~[bundleFile:1.4.13]
at org.openhab.core.thing.xml.internal.ThingDescriptionConverter.unmarshal(ThingDescriptionConverter.java:53) ~[?:?]
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) ~[bundleFile:1.4.13]
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:72) ~[bundleFile:1.4.13]
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) ~[bundleFile:1.4.13]
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50) ~[bundleFile:1.4.13]
at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134) ~[bundleFile:1.4.13]
at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32) ~[bundleFile:1.4.13]
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1404) ~[bundleFile:1.4.13]
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1383) ~[bundleFile:1.4.13]
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1334) ~[bundleFile:1.4.13]
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1288) ~[bundleFile:1.4.13]
at org.openhab.core.config.xml.util.XmlDocumentReader.readFromXML(XmlDocumentReader.java:106) ~[bundleFile:?]
at org.openhab.core.config.xml.osgi.XmlDocumentBundleTracker.parseDocuments(XmlDocumentBundleTracker.java:396) [bundleFile:?]
at org.openhab.core.config.xml.osgi.XmlDocumentBundleTracker.processBundle(XmlDocumentBundleTracker.java:382) [bundleFile:?]
at org.openhab.core.config.xml.osgi.XmlDocumentBundleTracker$2.run(XmlDocumentBundleTracker.java:347) [bundleFile:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:?]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
at java.lang.Thread.run(Unknown Source) [?:?]
OK## Expected Behavior
Current Behavior
When trying to add discovered FMI weather thing, it fails with an error in the logs:
In addition, it is not possible to create the things using MainUI
Steps to Reproduce (for Bugs)
Context
FMI weather unusable in openHAB3
Tried with fresh manual install of openHAB 2.5.10, work flawlessly there so it appears to be regression in OH3.
Your Environment
Fedora linux
openHAB 3.0 M2, manual runtime installation, with
openhab-addons-3.0.0.M2.kar
inaddons
. Only FMI weather binding installed