$day($data_binding=...).wind.avg not working

83 views
Skip to first unread message

Graham Eddy

unread,
Mar 10, 2022, 6:37:51 AM3/10/22
to weewx...@googlegroups.com
under 4.7.0 $day.wind.avg works fine but $day($data_binding=...).wind.avg does not. is this expected?
(i have not tried the latter on earlier versions.)

Mar 10 21:17:42 ironbark wee_reports[3057643] DEBUG weewx.cheetahgenerator: Unrecognized: $day($data_binding='gw1000_binding').wind.avg


Tom Keffer

unread,
Mar 10, 2022, 10:17:10 AM3/10/22
to weewx-user
I just tried it on my Mac and it worked fine. I even added it to the test suite (commit e907b59).

Are you sure that the binding "gw1000_binding" has wind? That is, it needs a daily summary schema that includes wind.


--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/540CCCD8-0B87-4942-87EA-1EA2773D0F48%40gmail.com.

Graham Eddy

unread,
Mar 10, 2022, 7:17:49 PM3/10/22
to weewx...@googlegroups.com
the weewx instance that owns gw1000 database reports $day.wind.avg fine:


the weewx instance that imports gw1000 database via gw1000_binding reports the ‘unrecognised’ error on $day($data_binding=‘gw1000_binding’).wind.avg. however, it is fine with $day($data_binding=‘gw1000_binding’).windSpeed etc:


this is the html template code that (successfully) imports scalar wind data and (unsuccessfully) vector wind data:
      <article>
        <img src="gw1000/plots/daywind.png" loading="lazy" />
        <div>
          <p class="obstype">Wind</p>
          <p class="agg">Ave</p>
          <p class="value">$span($data_binding='gw1000_binding', $day_delta=1).windSpeed.avg</p>
          <time></time>
          <p class="agg">Max</p>
          <p class="value">$span($data_binding='gw1000_binding', $day_delta=1).windSpeed.max</p>
          <time>$span($data_binding='gw1000_binding', $day_delta=1).windSpeed.maxtime.format('%H:%M %d/%m')</time>
          <p class="obstype">Gust</p>
          <p class="agg"></p>
          <p class="value"></p>
          <time></time>
          <p class="agg">Max</p>
          <p class="value">$span($data_binding='gw1000_binding', $day_delta=1).windGust.max</p>
          <time>$span($data_binding='gw1000_binding', $day_delta=1).windGust.maxtime.format('%H:%M %d/%m')</time>
        </div>
      </article>

         

      <article>
        <img src="gw1000/plots/daywindvec.png" loading="lazy" />
        <div>
          <p class="obstype">Spd</p>
          <p class="agg">Ave</p>
          <p class="value">$day($data_binding='gw1000_binding').wind.avg</p>
          <time></time>
          <p class="agg">RMS</p>
          <p class="value">$day($data_binding='gw1000_binding').wind.rms</p>
          <time></time>
          <p class="obstype">Vec</p>
          <p class="agg">Ave</p>
          <p class="value">$day($data_binding='gw1000_binding').wind.vecavg</p>
          <time></time>
          <p class="agg">Ave</p>
          <p class="value">$day($data_binding='gw1000_binding').wind.vecdir</p>
          <time></time>
        </div>
      </article>


hopefully i’m just doing something stupid (i can fix that!)

this is on RPi 64bit bullseye (i gave up on macOS operational environment long ago as too mutant and mutating further…)
 Graham Eddy 

Graham Eddy

unread,
Mar 10, 2022, 7:24:35 PM3/10/22
to weewx...@googlegroups.com
i hasten to clarify that those plot images are generated by the weewx instance that owns the gw1000 database. the other weewx instance generates html that only points to the existing image, but it does (try to) generate the text values via the tags
 Graham Eddy 

On 11 Mar 2022, at 11:17 am, Graham Eddy <graha...@gmail.com> wrote:

the weewx instance that owns gw1000 database reports $day.wind.avg fine:

<Screen Shot 2022-03-11 at 10.59.34 am.png>

the weewx instance that imports gw1000 database via gw1000_binding reports the ‘unrecognised’ error on $day($data_binding=‘gw1000_binding’).wind.avg. however, it is fine with $day($data_binding=‘gw1000_binding’).windSpeed etc:

<Screen Shot 2022-03-11 at 11.06.28 am.png>

Tom Keffer

unread,
Mar 11, 2022, 11:18:17 PM3/11/22
to weewx-user
If I understand correctly, the instance that archives into the gw1000 can evaluate $day.wind.avg just fine, but the instance that imports it cannot.

I wonder if this is due to a time synchronization issue between the two instances?

The type 'wind' exists only in the daily summaries. In the main archive, it's been flattened into windSpeed and windDir. The daily summaries can only be used for aggregations over a midnight-to-midnight day, or the very last day in the database, that is, midnight to the last update of the daily summaries.

This test could fail if the archive records don't match between the two instances. For example, perhaps the data in the gw1000 database isn't quite ready when the other instance needs it?

See the Customizing Guide for an example where this happened.

Graham Eddy

unread,
Mar 12, 2022, 12:50:21 AM3/12/22
to weewx...@googlegroups.com
this probably points to it. i created a database several days ago (took 7 hours to do calc-missing !!!) that has not been updated since and i am generating reports using the date of the last record in that database - debugging skin mods. the daily records in that database will be correctly ‘daily’ with respect to the reporting date, but maybe something is trying to compare to current real date?
 Graham Eddy 
Reply all
Reply to author
Forward
0 new messages