In WeeWX, the value None is used to signal missing or bad data. You must be constantly vigilant to its possible presence.
Can't help you on why the value went to None. On Wed, Oct 21, 2020 at 4:41 PM DaveStLou <[email protected]> wrote: > For many months I've been using the formula below in a twitter template > I've created today it started throwing this error. > > Oct 21 16:00:23 pi4 weewx[8659] ERROR weewx.cheetahgenerator: Generate > failed with exception '<class 'TypeError'>' > Oct 21 16:00:23 pi4 weewx[8659] ERROR weewx.cheetahgenerator: **** > Ignoring template /etc/weewx/skins/Twitter/tweet.txt.tmpl > Oct 21 16:00:23 pi4 weewx[8659] ERROR weewx.cheetahgenerator: **** *Reason: > '<' not supported between instances of 'NoneType' and 'float'* > Oct 21 16:00:23 pi4 weewx[8659] ERROR weewx.cheetahgenerator: **** > Traceback (most recent call last): > Oct 21 16:00:23 pi4 weewx[8659] ERROR weewx.cheetahgenerator: **** File > "/usr/share/weewx/weewx/cheetahgenerator.py", line 322, in generate > Oct 21 16:00:23 pi4 weewx[8659] ERROR weewx.cheetahgenerator: **** > unicode_string = compiled_template.respond() > Oct 21 16:00:23 pi4 weewx[8659] ERROR weewx.cheetahgenerator: **** File > "_etc_weewx_skins_Twitter_tweet_txt_tmpl.py", line 106, in respond > Oct 21 16:00:23 pi4 weewx[8659] ERROR weewx.cheetahgenerator: **** > *TypeError: > '<' not supported between instances of 'NoneType' and 'float'* > > Not sure why it popped up all of a sudden except maybe there's a value in > $current.barometer.raw that doesn't work with this expression. > > I appreciate any help or direction. Thanks! > > > On Saturday, February 8, 2020 at 10:11:48 AM UTC-6 [email protected] wrote: > >> You can add the text in the template. The key is to test for the raw >> value, using the .raw suffix. Something like (NOT TESTED): >> >> #set trend_raw = $trend.barometer.raw >> >> Wind $current.windSpeed Barometer $current.barometer #slurp >> #if $trend_raw < -0.05 >> falling rapidly#slurp >> #elif $trend_raw < -0.01 >> falling slowly#slurp >> #elif $trend_raw < 0.005 >> steady#slurp >> #elif $trend_raw < 0.01 >> rising slowly#slurp >> #else >> rising rapidly#slurp >> Temperature $current.outTemp Rain today $day.rain.sum Humidity >> $current.outHumidity >> >> Adjust values as you see fit. The #slurp directive prevents a newline >> from being injected. >> >> See the Language overview >> <https://cheetahtemplate.org/users_guide/language.html> in the Cheetah >> User's Guide for the full template syntax. >> >> -tk >> > -- > 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/bc3935cc-9f3d-4157-92d9-8548c122b4den%40googlegroups.com > <https://groups.google.com/d/msgid/weewx-user/bc3935cc-9f3d-4157-92d9-8548c122b4den%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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/CAPq0zEDA5szHUTj0PyTtCkS5aA%2B9ZknbmtTnBdL%2B3rU_qjvmUg%40mail.gmail.com.
