Good morning Gary. Thank you for your help. Here is the code: <solar>
#set hours = int($current.sunshine_hours.raw) #set minutes = int(($current.sunshine_hours.raw - $hours)*60 + 0.5) <sun value="$hours h $minutes m"/> </solar> That works with the current. But now I need the daylight sunshine. If I take day, then I get an error message when processing. Am Montag, 22. Juli 2019 22:51:21 UTC+2 schrieb gjr80: > > Just to get the obvious question out of the way first; you did use > $day.sunshine_hours.sum didn’t you (as opposed to day.sunshine_hours.sum), > the ‘$’ matters? Might help to post a copy of the actual template code > used, you would be surprised how often transcription or spelling errors are > made and not noticed. > > If you did use the ‘$’, did you follow the instructions you linked earlier > in their entirety; in particular steps 3 and 4 to add sunshine_hours to > your database schema? > > Gary > > > > current will give you the amount of sunshine hours in the last archive > period. Based on the code linked it will be either the archive period or > zero, depending on whether the threshold was reached. That’s a bit like > $current.rain, the rainfall in the last archive period, not really what > most folks want. I suspect you really want to use an aggregate in there, if > you have followed the linked instructions then something like > $day.sunshine_hours.sum will give you today’s total sunshine hours. > > If you use $day.sunshine_hours.sum.raw you will get the number of seconds, > eg 5 hours would show 18000. Have a read of the Customization Guide ( > http://weewx.com/docs/customizing.htm#Tags) and learn about tags, their > formatting and unit conversion and you should be able to do most of what > you want. > > 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/f21b507d-0f9c-4e17-86d3-d51872a0c39f%40googlegroups.com.
