Karen, I think a couple of things are going on. In your log snippet I see: Jan 30 17:32:18 LokalWiki weewx[1005876] DEBUG user.MQTTSubscribe: (Service) TopicManager *self.cached_fields is {}* Is this set in your second run? If so, what are the values? I’d expect it is now set, but but the key is wrong - so there is never a cache hit. Let me know what you see and I can get a fix done. -rich ps. - yes the ‘use_topic_as_fieldname’ is confusing. Working on eliminating it in v2. On Sunday, 31 January 2021 at 14:01:41 UTC-5 kk44...@gmail.com wrote:
> The use_topic_as_fieldname option worked. (Nevertheless, I find it > confusing to set the option to "true" to _not_ using the topic as field > name in WeeWX.) > > Unfortunately it does not cache. If I see the value for one archive > interval, it is gone for the next. It shows the parameter name enclosed in > question marks then, only. > > bell...@gmail.com schrieb am Samstag, 30. Januar 2021 um 22:39:47 UTC+1: > >> The subscription to the ‘wind’ topic is just some code that needs to be >> cleaned up. Tracking via #119 >> <https://github.com/bellrichm/WeeWX-MQTTSubscribe/issues/119>. >> >> You also need the ‘use_topic_as_fieldname = True’ option. Additional >> information is here >> <https://github.com/bellrichm/WeeWX-MQTTSubscribe/wiki/Configuring-additional-options#use_topic_as_fieldname>. >> >> So it would look something like this. >> [[topics]] >> unit_system=METRIC >> use_server_datatime=True >> ignore_start_time=True >> ignore_end_time=True >> use_topic_as_fieldname = True >> [[[pegel/567470/W_cm]]] >> name=W567470v >> conversion_type=float >> expires_after=4000 >> >> I think “archive_field_cache_dict is None" is some errant logging. The >> cache is at the archive record level, not the loop. So, you need to wait >> for at least one archive record that has no loop packets with the data (and >> of course a previous archive record had to have the value, cache can’t have >> expired, etc). On the second archive record, there should be some logging >> about updating the archive record. >> >> On Saturday, 30 January 2021 at 11:48:11 UTC-5 kk44...@gmail.com wrote: >> >>> I want to receive data from MQTT, I tried lots of options by now, but to >>> no success. >>> >>> Special: Data are published to MQTT once in a quarter of an hour, only. >>> >>> When data is published through MQTT and received by the MQTTSubscribe >>> service, the first loop packet after that contains the data. So I guess the >>> configuration is not completely wrong. >>> >>> But subsequent loop records do not. >>> >>> There seems to be noch caching. >>> >>> I see in the log: "archive_field_cache_dict is None". Maybe that has >>> some importance. I did not find an option to set it. >>> >>> And it ignores the name I set for the field. >>> >>> Additionally I see something "winddir-windgust" in the log. I did not >>> subscribe to such messages. >>> >>> weewx.conf contains: >>> >>> [[topics]] >>> unit_system=METRIC >>> use_server_datatime=True >>> ignore_start_time=True >>> ignore_end_time=True >>> [[[pegel/567470/W_cm]]] >>> name=W567470v >>> conversion_type=float >>> expires_after=4000 >>> etc. >>> >>> The log says: >>> >>> Jan 30 17:08:02 LokalWiki weewx[1004756] DEBUG user.MQTTSubscribe: >>> (Service) TopicManager data-> outgoing accumulated pegel/567470/W_cm: >>> dateTime: 1612022883, usUnits: 1, W_cm: 130.0 >>> >>> Jan 30 17:08:02 LokalWiki weewx[1004756] DEBUG user.MQTTSubscribe: >>> (Service) data-> final packet is 2021-01-30 17:08:03 CET (1612022883): >>> dateTime: 1612022883, Q: 62.6, rain: 0.0, rainRate: 0.0, usUnits: 1, W_cm: >>> 130.0, windDir: 46, windSpeed: 2.0 >>> Jan 30 17:08:05 LokalWiki weewx[1004756] DEBUG user.MQTTSubscribe: >>> (Service) data-> final packet is 2021-01-30 17:08:05 CET (1612022885): >>> dateTime: 1612022885, rain: 0.0, rainRate: 0.0, usUnits: 1, windDir: 46, >>> windSpeed: 2.0 >>> >>> If I look to the start section of the log it says (tried again some >>> minutes later): >>> Jan 30 17:32:18 LokalWiki weewx[1005876] DEBUG user.MQTTSubscribe: >>> (Service) Using weewx version 4.2.0 >>> Jan 30 17:32:18 LokalWiki weewx[1005876] DEBUG user.MQTTSubscribe: >>> (Service) Using Python 3.8.5 (default, Jul 28 2020, 12:59:40) #012[GCC >>> 9.3.0] >>> Jan 30 17:32:18 LokalWiki weewx[1005876] DEBUG user.MQTTSubscribe: >>> (Service) Platform Linux-5.4.0-60-generic-x86_64-with-glibc2.29 >>> Jan 30 17:32:18 LokalWiki weewx[1005876] DEBUG user.MQTTSubscribe: >>> (Service) Locale is 'de_DE.UTF-8' >>> Jan 30 17:32:18 LokalWiki weewx[1005876] INFO user.MQTTSubscribe: >>> (Service) Version is 1.6.2 >>> Jan 30 17:32:18 LokalWiki weewx[1005876] INFO user.MQTTSubscribe: >>> (Service) Log level: 10 >>> Jan 30 17:32:18 LokalWiki weewx[1005876] INFO user.MQTTSubscribe: >>> (Service) Log debug setting: 0 >>> Jan 30 17:32:18 LokalWiki weewx[1005876] INFO user.MQTTSubscribe: >>> (Service) Log console: False >>> Jan 30 17:32:18 LokalWiki weewx[1005876] INFO user.MQTTSubscribe: >>> (Service) Log file: None >>> Jan 30 17:32:18 LokalWiki weewx[1005876] DEBUG user.MQTTSubscribe: >>> (Service) sanitized configuration removed ['password'] >>> Jan 30 17:32:18 LokalWiki weewx[1005876] DEBUG user.MQTTSubscribe: >>> (Service) MQTTSUBscriber sanitized_service_dict is {'host': 'xxxxxxxxx', >>> 'log': 'True', 'username': 'pegel', 'enable': 'True', 'message_callback': >>> {'type': 'individual'}, 'logging_level': 'DEBUG', 'binding': 'loop', >>> 'keepalive': '60', 'port': '1883', 'topics': {'unit_system': 'METRIC', >>> 'use_server_datatime': 'True', 'ignore_start_time': 'True', >>> 'ignore_end_time': 'True', 'pegel/566055/W_cm': {'name': 'W566055v', >>> 'conversion_type': 'float', 'expires_after': '4000'}, 'pegel/566055/Q': >>> {'name': 'Q566055v', 'conversion_type': 'float', 'expires_after': '4000'}, >>> 'pegel/567470/W_cm': {'name': 'W567470v', 'conversion_type': 'float', >>> 'expires_after': '4000'}, 'pegel/567470/Q': {'name': 'Q567470v', >>> 'conversion_type': 'float', 'expires_after': '4000'}}} >>> Jan 30 17:32:18 LokalWiki weewx[1005876] INFO user.MQTTSubscribe: >>> (Service) overlap is 0.0 >>> Jan 30 17:32:18 LokalWiki weewx[1005876] DEBUG user.MQTTSubscribe: >>> (Service) TopicManager self.subscribed_topics is {'pegel/566055/W_cm': >>> {'type': 'normal', 'unit_system': 16, 'msg_id_field': None, 'qos': 0, >>> 'use_server_datetime': False, 'ignore_start_time': True, 'ignore_end_time': >>> True, 'adjust_start_time': 1.0, 'adjust_end_time': 0.0, 'datetime_format': >>> None, 'offset_format': None, 'ignore': False, 'max_queue': >>> 9223372036854775807, 'queue': deque([]), 'fields': {}, >>> 'ignore_msg_id_field': []}, 'pegel/566055/Q': {'type': 'normal', >>> 'unit_system': 16, 'msg_id_field': None, 'qos': 0, 'use_server_datetime': >>> False, 'ignore_start_time': True, 'ignore_end_time': True, >>> 'adjust_start_time': 1.0, 'adjust_end_time': 0.0, 'datetime_format': None, >>> 'offset_format': None, 'ignore': False, 'max_queue': 9223372036854775807, >>> 'queue': deque([]), 'fields': {}, 'ignore_msg_id_field': []}, >>> 'pegel/567470/W_cm': {'type': 'normal', 'unit_system': 16, 'msg_id_field': >>> None, 'qos': 0, 'use_server_datetime': False, 'ignore_start_time': True, >>> 'ignore_end_time': True, 'adjust_start_time': 1.0, 'adjust_end_time': 0.0, >>> 'datetime_format': None, 'offset_format': None, 'ignore': False, >>> 'max_queue': 9223372036854775807, 'queue': deque([]), 'fields': {}, >>> 'ignore_msg_id_field': []}, 'pegel/567470/Q': {'type': 'normal', >>> 'unit_system': 16, 'msg_id_field': None, 'qos': 0, 'use_server_datetime': >>> False, 'ignore_start_time': True, 'ignore_end_time': True, >>> 'adjust_start_time': 1.0, 'adjust_end_time': 0.0, 'datetime_format': None, >>> 'offset_format': None, 'ignore': False, 'max_queue': 9223372036854775807, >>> 'queue': deque([]), 'fields': {}, 'ignore_msg_id_field': []}, >>> '1612024338.424195-windGust-windGustDir-windDir-windSpeed': {'type': >>> 'collector', 'unit_system': 16, 'qos': 0, 'use_server_datetime': False, >>> 'ignore_start_time': True, 'ignore_end_time': True, 'adjust_start_time': >>> 1.0, 'adjust_end_time': 0.0, 'datetime_format': None, 'offset_format': >>> None, 'max_queue': 9223372036854775807, 'queue': deque([])}} >>> Jan 30 17:32:18 LokalWiki weewx[1005876] DEBUG user.MQTTSubscribe: >>> (Service) TopicManager self.cached_fields is {} >>> Jan 30 17:32:18 LokalWiki weewx[1005876] INFO user.MQTTSubscribe: >>> (Service) message_callback_provider_name is >>> user.MQTTSubscribe.MessageCallbackProvider >>> Jan 30 17:32:18 LokalWiki weewx[1005876] INFO user.MQTTSubscribe: >>> (Service) clientid is MQTTSubscribe-7610 >>> Jan 30 17:32:18 LokalWiki weewx[1005876] INFO user.MQTTSubscribe: >>> (Service) client_session is True >>> Jan 30 17:32:18 LokalWiki weewx[1005876] INFO user.MQTTSubscribe: >>> (Service) host is xxxxxxxxxx >>> Jan 30 17:32:18 LokalWiki weewx[1005876] INFO user.MQTTSubscribe: >>> (Service) port is 1883 >>> Jan 30 17:32:18 LokalWiki weewx[1005876] INFO user.MQTTSubscribe: >>> (Service) keepalive is 60 >>> Jan 30 17:32:18 LokalWiki weewx[1005876] INFO user.MQTTSubscribe: >>> (Service) username is pegel >>> Jan 30 17:32:18 LokalWiki weewx[1005876] INFO user.MQTTSubscribe: >>> (Service) password is set >>> Jan 30 17:32:18 LokalWiki weewx[1005876] INFO user.MQTTSubscribe: >>> (Service) Archive topic is None >>> Jan 30 17:32:18 LokalWiki weewx[1005876] DEBUG user.MQTTSubscribe: >>> (Service) MessageCallbackProvider self.fields is {} >>> Jan 30 17:32:18 LokalWiki weewx[1005876] DEBUG user.MQTTSubscribe: >>> (Service) MQTTSubscribe MQTT: Sending CONNECT (u1, p1, wr0, wq0, wf0, c1, >>> k60) client_id=b'MQTTSubscribe-7610' >>> Jan 30 17:32:18 LokalWiki weewx[1005876] INFO user.MQTTSubscribe: >>> (Service) binding is loop >>> Jan 30 17:32:18 LokalWiki weewx[1005876] INFO user.MQTTSubscribe: >>> (Service) archive_field_cache_dict is None >>> Jan 30 17:32:18 LokalWiki weewx[1005876] DEBUG user.MQTTSubscribe: >>> (Service) Starting loop >>> Jan 30 17:32:18 LokalWiki weewx[1005876] DEBUG user.MQTTSubscribe: >>> (Service) MQTTSubscribe MQTT: Received CONNACK (0, 0) >>> Jan 30 17:32:18 LokalWiki weewx[1005876] INFO user.MQTTSubscribe: >>> (Service) Connected with result code 0 >>> Jan 30 17:32:18 LokalWiki weewx[1005876] INFO user.MQTTSubscribe: >>> (Service) Connected flags {'session present': 0} >>> Jan 30 17:32:18 LokalWiki weewx[1005876] DEBUG user.MQTTSubscribe: >>> (Service) MQTTSubscribe MQTT: Sending SUBSCRIBE (d0, m1) >>> [(b'pegel/566055/W_cm', 0)] >>> Jan 30 17:32:18 LokalWiki weewx[1005876] DEBUG user.MQTTSubscribe: >>> (Service) Subscribing to pegel/566055/W_cm has a mid 1 and rc 0 >>> Jan 30 17:32:18 LokalWiki weewx[1005876] DEBUG user.MQTTSubscribe: >>> (Service) MQTTSubscribe MQTT: Sending SUBSCRIBE (d0, m2) >>> [(b'pegel/566055/Q', 0)] >>> Jan 30 17:32:18 LokalWiki weewx[1005876] DEBUG user.MQTTSubscribe: >>> (Service) Subscribing to pegel/566055/Q has a mid 2 and rc 0 >>> Jan 30 17:32:18 LokalWiki weewx[1005876] DEBUG user.MQTTSubscribe: >>> (Service) MQTTSubscribe MQTT: Sending SUBSCRIBE (d0, m3) >>> [(b'pegel/567470/W_cm', 0)] >>> Jan 30 17:32:18 LokalWiki weewx[1005876] DEBUG user.MQTTSubscribe: >>> (Service) Subscribing to pegel/567470/W_cm has a mid 3 and rc 0 >>> Jan 30 17:32:18 LokalWiki weewx[1005876] DEBUG user.MQTTSubscribe: >>> (Service) MQTTSubscribe MQTT: Sending SUBSCRIBE (d0, m4) >>> [(b'pegel/567470/Q', 0)] >>> Jan 30 17:32:18 LokalWiki weewx[1005876] DEBUG user.MQTTSubscribe: >>> (Service) Subscribing to pegel/567470/Q has a mid 4 and rc 0 >>> Jan 30 17:32:18 LokalWiki weewx[1005876] DEBUG user.MQTTSubscribe: >>> (Service) MQTTSubscribe MQTT: Sending SUBSCRIBE (d0, m5) >>> [(b'1612024338.424195-windGust-windGustDir-windDir-windSpeed', 0)] >>> Jan 30 17:32:18 LokalWiki weewx[1005876] DEBUG user.MQTTSubscribe: >>> (Service) Subscribing to >>> 1612024338.424195-windGust-windGustDir-windDir-windSpeed has a mid 5 and rc >>> 0 >>> Jan 30 17:32:18 LokalWiki weewx[1005876] DEBUG user.MQTTSubscribe: >>> (Service) MQTTSubscribe MQTT: Received SUBACK >>> Jan 30 17:32:18 LokalWiki weewx[1005876] INFO user.MQTTSubscribe: >>> (Service) Subscribed to mid: 1 is size 1 has a QOS of 0 >>> Jan 30 17:32:18 LokalWiki weewx[1005876] DEBUG user.MQTTSubscribe: >>> (Service) MQTTSubscribe MQTT: Received SUBACK >>> Jan 30 17:32:18 LokalWiki weewx[1005876] INFO user.MQTTSubscribe: >>> (Service) Subscribed to mid: 2 is size 1 has a QOS of 0 >>> Jan 30 17:32:18 LokalWiki weewx[1005876] DEBUG user.MQTTSubscribe: >>> (Service) MQTTSubscribe MQTT: Received SUBACK >>> Jan 30 17:32:18 LokalWiki weewx[1005876] INFO user.MQTTSubscribe: >>> (Service) Subscribed to mid: 3 is size 1 has a QOS of 0 >>> Jan 30 17:32:18 LokalWiki weewx[1005876] DEBUG user.MQTTSubscribe: >>> (Service) MQTTSubscribe MQTT: Received SUBACK >>> Jan 30 17:32:18 LokalWiki weewx[1005876] INFO user.MQTTSubscribe: >>> (Service) Subscribed to mid: 4 is size 1 has a QOS of 0 >>> Jan 30 17:32:18 LokalWiki weewx[1005876] DEBUG user.MQTTSubscribe: >>> (Service) MQTTSubscribe MQTT: Received SUBACK >>> Jan 30 17:32:18 LokalWiki weewx[1005876] INFO user.MQTTSubscribe: >>> (Service) Subscribed to mid: 5 is size 1 has a QOS of 0 >>> >>> -- You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/d1dbf687-b96d-40e3-886a-4f8c39d74bf2n%40googlegroups.com.