formatting of current.inc

85 views
Skip to first unread message

Neville Davis

unread,
Aug 11, 2022, 9:50:18 PM8/11/22
to weewx-user

I have data being stored in watt Hrs in the db and have a daily sum formatted to 2 decimal places in the current.inc file, it displays within the widget but at the top of the section (see attached). Any ideas on how to correct this please
I also would like to know how to add an observation to the standard groups, e.g the observation "powerconsumed" add to the group "group_energy"
Any help would be appreciated.

Neville
Screen Shot 2022-08-12 at 11.33.41 am.png
Screen Shot 2022-08-12 at 11.44.34 am.png

Tom Keffer

unread,
Aug 11, 2022, 10:00:23 PM8/11/22
to weewx-user
It would be useful to have more information. Did you add "powerconsumed" to the list "observations_current" in skin.conf? If so, where in the list? 

Instead of including a screenshot of current.inc, how about posting an actual copy of both it, and skin.conf? 

As for your second question, see the section Assigning a unit group in the Customizing Guide.

--
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/a541c33f-1b1b-4966-ae67-a0273e6632f0n%40googlegroups.com.
Message has been deleted
Message has been deleted

Neville Davis

unread,
Aug 11, 2022, 10:27:21 PM8/11/22
to weewx-user
My responses keep getting deleted not sure why, possibly attachments????

I will again look at the guide must have missed the info.
Yes I did add "powerconsumed" in the "observations_current" in skin.conf list.
I had already removed those items I wished not to display and added my new observation after rainRate as follows...
" observations_current = outTemp, outHumidity, barometer, windSpeed, rain, rainRate, powerconsumed, inTemp, inHumidity"
this is my current.inc file..

Hopefully this is posted

Neville

## current module for weewx skins

## Copyright Tom Keffer, Matthew Wall

## See LICENSE.txt for your rights

#errorCatcher Echo

#encoding UTF-8


<div id='current_widget' class="widget">

  <div class="widget_title">

    $gettext("Current Conditions")

    <a class="widget_control"

      onclick="toggle_widget('current')">&diams;</a>

  </div>


  <div class="widget_contents">

  <table>

    <tbody>


#set $observations = $to_list($DisplayOptions.get('observations_current', ['outTemp', 'barometer']))


#for $x in $observations

  #if $getVar('year.%s.has_data' % $x)

    #if $x == 'barometer'

      <tr>

        <td class="label">$obs.label.barometer</td>

        <td class="data">$current.barometer ($trend.barometer.formatted)</td>

      </tr>

    #elif $x == 'windSpeed'

      <tr>

        <td class="label">$obs.label.wind</td>

        <td class="data">$current.windSpeed $current.windDir.ordinal_compass ($current.windDir)</td>

      </tr>

    #elif $x == 'rain'

      <tr>

        <td class="label">$gettext("Rain Today")</td>

        <td class="data">$day.rain.sum</td>

        ##<td class="data">$day($data_binding='wx_power').rain.sum</td>

      </tr>

    #elif $x == 'powerconsumed'

      <tr>

        <td class="label">$gettext("Power Consumed today")</td

        <td class="data">$day.powerconsumed.sum.format("%.2f")</td>

      </tr>

    #else

      <tr>

        <td class="label">$obs.label[$x]</td>

        <td class="data">$getVar('current.' + $x)</td>

      </tr>

    #end if

  #end if

#end for


    </tbody>

  </table>

  </div>


</div>



Neville Davis

unread,
Aug 11, 2022, 10:42:24 PM8/11/22
to weewx-user
I have added my new observation to the group and my data now displays with units correctly that is "16622.49 Wh"...and the daily sum is correct.
It still positions itself at the top of the current.inc widget.

Neville

gjr80

unread,
Aug 12, 2022, 1:08:32 AM8/12/22
to weewx-user
Not sure if it's the cause or not, but you might want to add the missing '>' to the closing </td> at the end of this line:

<td class="label">$gettext("Power Consumed today")</td

Gary

Neville Davis

unread,
Aug 12, 2022, 1:36:42 AM8/12/22
to weewx-user
Gary 

Thanks for that, I did look and look, it was the problem.

Neville

Reply all
Reply to author
Forward
0 new messages