Stefan You need to forget $current.sunshine_hours.raw as that will only give you the sunshine in the interval which will always be either 0 or 5 in your case.
For the daily total you need to use $day.sunshine_hours.sum in order to get the total sunshine hours for the day from midnight up to the current time. On Tuesday, 23 July 2019 15:09:06 UTC+3, Stefan wrote: > > Hello Thomas. > > I found the mistake. When we create the new table, we use the name > weewx.sdb_new instead of the weewx.sdb. Have this now adjusted in the > weewx.conf and lo and behold, num works it. The rest I had done, but > unfortunately not this detail. Many thanks to all helpers. Class like > that works. > > Your code also works great: > #set hours = int ($ current.sunshine_hours.raw) > #set minutes = int (($ current.sunshine_hours.raw - $ hours) * 60 + > 0.5) > <sun value = "$ hours h $ minutes m" /> > > Many Thanks > > Am Dienstag, 23. Juli 2019 13:09:25 UTC+2 schrieb Thomas Keffer: >> >> The type "sunshine_hours" is not in your database. It will work with >> "$current" because you have a current record, so weewx is using that. But, >> because it is not in your database, weewx cannot sum over the day. >> >> See the section *Adding a new type to the database >> <http://weewx.com/docs/customizing.htm#add_archive_type>* in the >> Customizing Guide for how to do this. >> >> -tk >> >> >> On Tue, Jul 23, 2019 at 4:00 AM Stefan <[email protected]> wrote: >> >>> This is with $current.sunshine_hours.raw. It works! >>> >>> <solar> >>> <solar value="861"/> >>> <solar_max value="861"/> >>> <solar_max_time value="12:51"/> >>> <sun value="0.0833333333333"/> >>> </solar> >>> >>> But with $day.sunshine_hours.raw or $day.sunshine_hours.sum.raw or >>> $day.sunshine_hours.raw.sum >>> The Problem always turns up when replacing $current by $day. >>> >>> >>> >>> Am Dienstag, 23. Juli 2019 08:35:37 UTC+2 schrieb gjr80: >>>> >>>> The answer is in the error message. You are using >>>> $day.sunshine_hours.raw, you should be using $day.sunshine_hours.sum or >>>> perhaps $day.sunshine_hours.sum.raw >>>> >>>> Gary >>>> >>> -- >>> 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/5ddf5a22-a565-4e12-9093-5c69d187e420%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/weewx-user/5ddf5a22-a565-4e12-9093-5c69d187e420%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/a912b5d5-78d0-45fd-b2ab-ae0ea4779afc%40googlegroups.com.
