glennmckechnie / weewx-uradmon

This extension captures and stores the output from an A3 (and other) uradmonitor (https://www.uradmonitor.com) The Report will generate a seperate html page at weewx/uradmon/index.html
GNU General Public License v3.0
3 stars 1 forks source link

graph scale #6

Closed RedVox73 closed 2 years ago

RedVox73 commented 2 years ago

Hi Glenn, small detail on the graph: The scale needs to move from 60uSv/h to 0.60uSv/h

2022-02-06

glennmckechnie commented 2 years ago

Yes, You are right, there is a mismatch.

Looking at the output again it appears to be cpm rather than microsievert/hour. So it's out by a factor of 120 going by the following link where 1 microSievert per hour would equate to 120 CPM. What is stored and being charted is the value straight from the units json output. So without attempting to work any magic on the data I'm probably best off to chage the scale to cpm.

As an aside. Your unit doesn't measure temperature? You can disable that graph in skin.conf

Cheers Glenn

RedVox73 commented 2 years ago

Yes, You are right, there is a mismatch.

Looking at the output again it appears to be cpm rather than microsievert/hour. So it's out by a factor of 120 going by the following link where 1 microSievert per hour would equate to 120 CPM. What is stored and being charted is the value straight from the units json output. So without attempting to work any magic on the data I'm probably best off to chage the scale to cpm.

As an aside. Your unit doesn't measure temperature? You can disable that graph in skin.conf

Cheers Glenn

Would it be possible to covert it after it has been stored in the database? uSv/h is what is preferred I would think... since that is a value related. CPM doesn't relate to anything... but I understand your problem here.

glennmckechnie commented 2 years ago

I've been having a check of weewx and the image generator and while I don't think it can be done on the fly there (skin.conf); I think it can (and should) be stored as cpm and converted to microsievert through the units | conversionDict. Much as US | METRIC | METRICWX are done. I've just got to make one and work out where to put it!

Let me get my head around it and I'll see if clears enough to put it into working code.

I do need to finish the languages first, and that has led me down a rabbit burrow or three!

RedVox73 commented 2 years ago

Hi Glenn,

Thank you very much for taking the time to look in to this.

Grtx Michiel

Van: Glenn @.> Verzonden: zondag 6 februari 2022 12:12 Aan: glennmckechnie/weewx-uradmon @.> CC: Michiel Bouwmeester @.>; Author @.> Onderwerp: Re: [glennmckechnie/weewx-uradmon] graph scale (Issue #6)

I've been having a check of weewx and the image generator and while I don't think it can be done on the fly there (skin.conf); I think it can (and should) be stored as cpm and converted to microsievert through the units | conversionDict. Much as US | METRIC | METRICWX are done. I've just got to make one and work out where to put it!

Let me get my head around it and I'll see if clears enough to put it into working code.

I do need to finish the languages first, and that has led me down a rabbit burrow or three!

— Reply to this email directly, view it on GitHub https://github.com/glennmckechnie/weewx-uradmon/issues/6#issuecomment-1030810614 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AXTSOEHCKG3GVGBE54XLF43UZZJPFANCNFSM5NVDXT6Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub . You are receiving this because you authored the thread. https://github.com/notifications/beacon/AXTSOEC76LGVGTVDSJCLLL3UZZJPFA5CNFSM5NVDXT62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHVYOX5Q.gif Message ID: @. @.> >

glennmckechnie commented 2 years ago

Okay!

It took way more than the proverbial 5 minutes but I also sorted out a few other things while I was at it. I've dogfooded it and it (now) works for me, hopefully your configuration will too. You will let me know if it doesn't :-) and that is good!

Visit the README. The Unit action happens in the weewx.conf file so change it there, as you see fit. When it comes to the uptime graph personally I prefer day rather than second - now that it's achievable (and possibly always was).

_microsievert are locked in as 1:110. That can be changed in uradmon.py if you are handy with an editor and make no typos. If there is a compelling reason to make that another value, I'm all ears.

Cheers Glenn

lizdodd commented 2 years ago

I'm not doing so well with this update, using mariadb. I cloned into the new master, installed the extension and edited /etc/weewx/weewx.conf I changed these values ` # These are the default units from the uradmon

unit and driver. Change these to suit your needs

            # Pressure options are 'inHg', 'mmHg', 'mbar', or 'hPa'
            group_urad_pressure = Pa
            # Time options are second', 'day ', 'hour,
            group_elapsed = second
            # Radiation options are 'cpm' or 'micro_sievert'
            group_ion_radiation = cpm

to hPa, day and micro_sievert I restarted weewx and it was unhappy Feb 16 09:32:31 banksia weewx[23064] INFO user.uradmon: service version is 0.2.8 Feb 16 09:32:31 banksia weewx[23064] INFO user.uradmon: archive_interval in seconds is 300, minutes 5 Feb 16 09:32:31 banksia weewx[23064] CRITICAL main: Caught unrecoverable exception: Feb 16 09:32:31 banksia weewx[23064] CRITICAL main: schema mismatch: ['dateTime', 'usUnits', 'interval', 'uvolt', 'ucpm', 'utemp', 'uhum', 'upres', 'uvoc', 'uco2', 'unoise', 'uch2o', 'upm25', 'uptime'] != ['dateTime', 'usUnits', 'interval', 'uvolt', 'ucpm', 'utemp', 'uhum', 'upres', 'uvoc', 'uco2', 'unoise', 'uch2o', 'upm25', 'uptime', 'ubat', 'urtc', 'us1', 'us2', 'us3', 'us4', 'upm1', 'upm10', 'ulat', 'ulong', 'ualt', 'uspeed', 'usats'] Feb 16 09:32:31 banksia weewx[23064] CRITICAL main: Traceback (most recent call last): Feb 16 09:32:31 banksia weewx[23064] CRITICAL main: File "/usr/share/weewx/weewxd", line 147, in main Feb 16 09:32:31 banksia weewx[23064] CRITICAL main: engine = weewx.engine.StdEngine(config_dict) Feb 16 09:32:31 banksia weewx[23064] CRITICAL main: File "/usr/share/weewx/weewx/engine.py", line 93, in init Feb 16 09:32:31 banksia weewx[23064] CRITICAL main: self.loadServices(config_dict) Feb 16 09:32:31 banksia weewx[23064] CRITICAL main: File "/usr/share/weewx/weewx/engine.py", line 161, in loadServices Feb 16 09:32:31 banksia weewx[23064] CRITICAL main: obj = weeutil.weeutil.get_object(svc)(self, config_dict) Feb 16 09:32:31 banksia weewx[23064] CRITICAL main: File "/usr/share/weewx/user/uradmon.py", line 333, in init Feb 16 09:32:31 banksia weewx[23064] CRITICAL main: (dbcol, memcol)) Feb 16 09:32:31 banksia weewx[23064] CRITICAL main: Exception: schema mismatch: ['dateTime', 'usUnits', 'interval', 'uvolt', 'ucpm', 'utemp', 'uhum', 'upres', 'uvoc', 'uco2', 'unoise', 'uch2o', 'upm25', 'uptime'] != ['dateTime', 'usUnits', 'interval', 'uvolt', 'ucpm', 'utemp', 'uhum', 'upres', 'uvoc', 'uco2', 'unoise', 'uch2o', 'upm25', 'uptime', 'ubat', 'urtc', 'us1', 'us2', 'us3', 'us4', 'upm1', 'upm10', 'ulat', 'ulong', 'ualt', 'uspeed', 'usats'] Feb 16 09:32:31 banksia weewx[23064] CRITICAL main: Exiting. ` I put the values back to Pa, seconds and cpm in weewx.conf and restarted with the same error message. I think that the mysql / mariadb schema does not have the last set of values which belong to the "industrial" unit. I uninstalled uradmon at this stage.

glennmckechnie commented 2 years ago

That response is because of the database change that was mentioned in the Update notes for Feb 2022.

To fix (or bypass the check) then after the [UradMon] section in weewx.conf add the following, or change the existing entry (I've just uploaded a version with True in it)...

dbm_check = False

Because the code has been rejigged to accommodate some of the other models. I had to make a decision on how to populate the database. Choose different schemas manually by editing the code or a new schema? I chose the new schema, one size fits all and while that may be okay, I didn't completely remove the dbm schema check. I took a bet each way, left it in but added the bypass switch. You've been caught by that.

Ah, and I also removed the mysql database details so the new database of uradmon2 wasn't created. Mea Culpa. I got too tidy.

With your response I think I may disable that check altogether - providing your installation goes okay from here on (with that switch). I think yours has noise, dB and I can't test that here.

I've just uploaded that fix to master, download the zip and it will be in that.. Let me know if that works with your existing database. (I prefer you have a back up first though)

Cheers Glenn

glennmckechnie commented 2 years ago

And just to clarify. I'm using my original sqlite database uradmon.sdb , that's from my original installation, with the 'dbm_check = False' switch and it works as it did before.

lizdodd commented 2 years ago

I've got a backup ;) I'm setting up weewx on a new server, so the old is my backup! I added the suggested line to /etc/weewx/weewx.conf and uradmon works well with the pre-existing database. We could suggest this line for those using an existing database rather than a new one. I do have noise level reported Screenshot_2022-02-17_09-23-36

and uptime was reset while the system collected 24 days worth of data from the weather station, interrogating the urad monitor every second Screenshot_2022-02-17_09-24-27

glennmckechnie commented 2 years ago

Excellent!.

Backups for the win!

I've pushed v0.2.9 with some fixes.

The README now has the required notes, along with a comment in weewx.conf. The mysql stanza has been re-added to weewx.conf, the schema mismatch no longer halts weewx (Ooops). It only halts uradmon data collection until that's fixed.

Thanks for the feedback.