Looks like a bug when running as a service, I'll take a look. What does your [Accumulator] section look like?
On Wednesday, 10 February 2021 at 13:41:47 UTC-5 [email protected] wrote: > For me it still does not work. > > The configuration is: > [[[pegel/567470/alarmcolor]]] > name = W567470c > conversion_type = None > expires_after = 4000 > > And the log is: > Feb 10 19:32:47 LokalWiki weewx[378692] CRITICAL __main__: Caught > unrecoverable exception: > Feb 10 19:32:47 LokalWiki weewx[378692] CRITICAL __main__: **** could not > convert string to float: '#c5e566' > Feb 10 19:32:47 LokalWiki weewx[378692] CRITICAL __main__: **** Traceback > (most recent call last): > Feb 10 19:32:47 LokalWiki weewx[378692] CRITICAL __main__: **** File > "/usr/share/weewx/weewxd", line 157, in main > Feb 10 19:32:47 LokalWiki weewx[378692] CRITICAL __main__: **** > engine.run() > Feb 10 19:32:47 LokalWiki weewx[378692] CRITICAL __main__: **** File > "/usr/share/weewx/weewx/engine.py", line 210, in run > Feb 10 19:32:47 LokalWiki weewx[378692] CRITICAL __main__: **** > self.dispatchEvent(weewx.Event(weewx.NEW_LOOP_PACKET, packet=packet)) > Feb 10 19:32:47 LokalWiki weewx[378692] CRITICAL __main__: **** File > "/usr/share/weewx/weewx/engine.py", line 245, in dispatchEvent > Feb 10 19:32:47 LokalWiki weewx[378692] CRITICAL __main__: **** > callback(event) > Feb 10 19:32:47 LokalWiki weewx[378692] CRITICAL __main__: **** File > "/usr/share/weewx/user/MQTTSubscribe.py", line 1591, in new_loop_packet > Feb 10 19:32:47 LokalWiki weewx[378692] CRITICAL __main__: **** > target_data = self.subscriber.get_accumulated_data(queue, > Feb 10 19:32:47 LokalWiki weewx[378692] CRITICAL __main__: **** File > "/usr/share/weewx/user/MQTTSubscribe.py", line 1478, in > get_accumulated_data > Feb 10 19:32:47 LokalWiki weewx[378692] CRITICAL __main__: **** return > self.manager.get_accumulated_data(queue, start_ts, end_ts, units) # pragma: > no cover > Feb 10 19:32:47 LokalWiki weewx[378692] CRITICAL __main__: **** File > "/usr/share/weewx/user/MQTTSubscribe.py", line 937, in get_accumulated_data > Feb 10 19:32:47 LokalWiki weewx[378692] CRITICAL __main__: **** > accumulator.addRecord(data) > Feb 10 19:32:47 LokalWiki weewx[378692] CRITICAL __main__: **** File > "/usr/share/weewx/weewx/accum.py", line 436, in addRecord > Feb 10 19:32:47 LokalWiki weewx[378692] CRITICAL __main__: **** func(self, > record, obs_type, add_hilo, weight) > Feb 10 19:32:47 LokalWiki weewx[378692] CRITICAL __main__: **** File > "/usr/share/weewx/weewx/accum.py", line 495, in add_value > Feb 10 19:32:47 LokalWiki weewx[378692] CRITICAL __main__: **** > self[obs_type].addHiLo(val, record['dateTime']) > Feb 10 19:32:47 LokalWiki weewx[378692] CRITICAL __main__: **** File > "/usr/share/weewx/weewx/accum.py", line 168, in addHiLo > Feb 10 19:32:47 LokalWiki weewx[378692] CRITICAL __main__: **** val = > to_float(val) > Feb 10 19:32:47 LokalWiki weewx[378692] CRITICAL __main__: **** File > "/usr/share/weewx/weeutil/weeutil.py", line 1250, in to_float > Feb 10 19:32:47 LokalWiki weewx[378692] CRITICAL __main__: **** return > float(x) if x is not None else None > Feb 10 19:32:47 LokalWiki weewx[378692] CRITICAL __main__: **** > ValueError: could not convert string to float: '#c5e566' > Feb 10 19:32:47 LokalWiki weewx[378692] CRITICAL __main__: **** Exiting. > > I tried "none" and "None" in the configuration to the same result. > > > > Tarmo schrieb am Montag, 8. Februar 2021 um 23:42:34 UTC+1: > >> "If you get this working, I’d like to ‘steal’ the details/steps for a >> wiki page. >> -rich" >> >> you own this. this is your work and people around the world are thankful >> for this. >> >> >> On Monday, February 8, 2021 at 3:19:36 AM UTC+2 [email protected] wrote: >> >>> It should be doable. I do something similar with a few temperature >>> sensors/fields. The fact that you are dealing with string data does add >>> some complexity. >>> First, for the field configuration you will need to set the >>> conversion_type = None. Although it is not documented on the wiki, see >>> https://github.com/bellrichm/WeeWX-MQTTSubscribe/wiki/Configuring#conversion_type >>> >>> This will stop MQTTSubscribe from trying to convert the incoming data. >>> >>> Next, you will need to configure the accumulator for this field/type. >>> See, https://github.com/weewx/weewx/wiki/Accumulators. It looks like >>> for this field/type you want to set accumulator = firstlast and extractor = >>> last. >>> >>> Now you should be able to access it via $current. field/type name. >>> >>> If you get this working, I’d like to ‘steal’ the details/steps for a >>> wiki page. >>> -rich >>> >>> On Sunday, 7 February 2021 at 17:05:51 UTC-5 Tarmo wrote: >>> >>>> Can I do it? I have a text in MQTT like "Cloudy with clear spells" >>>> which I would like to display on my website. Although, there is no need to >>>> store it in the weewx database. I would like to just to update it at every >>>> archive interval. >>>> >>> -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/7334e341-6a8c-4c93-88cc-6a7c19cfb500n%40googlegroups.com.
