Skip to content

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

License

Notifications You must be signed in to change notification settings

glennmckechnie/weewx-uradmon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

weewx-uradmon

Update: 17 Feb 2022

  • bump to v0.2.9, fix schema check, re-add mysql database option, log schema mismatch (and abort uradmon queries) rather than shutdown weewx.

If you are using an existing database then you can manually edit the weewx.conf entries to point to uradmon.sdb (or uradmon ) rather than the newer uradmon2.sdb (uradmon2) if you want to use that historical data.

Restarting weewx will then report a schema mismatch upon start up due to the new schema (that was introduced for some of the other models) and the original schema being different. To get around this check you will need to edit and set dbm_check to False in weewx.conf (see the example below). Weewx will continue to run, but no data from your uradmonitor will be fetched until this mismatch is fixed.

This has been tested and works on databases from 1.x versions, that used either sqlite or mysql. As always, have a fresh, working backup before risking your valuable data.

change from ...

dbm_check = True

to ...

dbm_check = False

for existing databases.

If this is a fresh installation (no previous version, nor data) then you need to do none of the above. Once weewx is restarted, uradmon will start adding data to uradmon2.sdb (sqlite), or uradmon2 (mysql)

Output of uRADMonitor units is C°, cpm, Pa, ppm, ug/m^3, volts

  • Add conversions for cpm to micro_sievert
  • Add Conversions for Pa to hPa, mbar, inHG, mmHg
  • Fix missing, b0rked en.conf entries

No release ... yet. Awaiting more feedback! Use the master from the github repo.

By default the sqlite database is used. The mysql stanza is included in weewx.conf, to use that database instead adjust [[uradmon_binding]] accordingly.

Description

This extension provides a Service, and a Report skin that integrates with weewx (weather station software).

The Service captures and stores the output from a uradmonitor into a local database at the exisiting archive interval (as set in weewx.conf). By default it captures the data from an A3 unit but it should also capture most other modules. Sqlite is the default database, mysql is also an option. The Report will generate a seperate html page in the style of the Seasons skin. It will be located at weewx/uradmon/index.html with daily, weekly, monthly and yearly graphs as is done with the main weewx/ pages and your weather station.

Instructions:

  1. Download the skin to your weewx machine.

    The latest working code can be found by using the following command...

    wget -O weewx-uradmon.zip https://github.com/glennmckechnie/weewx-uradmon/archive/master.zip

    This version will have the most recent updates.

    (Alternatively, it is packaged as a release under https://github.com/glennmckechnie/weewx-uradmon/releases This gives a fixed (in time) version. You will need to adjust the following instructions by using the filename you downloaded.)

  2. Change to that directory and run the weewx extension installer for your version

    For the newer weewx versions 5.x use...

    sudo weectl extension install weewx-uradmon.zip

    For previous versions - 4.x use the following...

    sudo wee_extension --install weewx-uradmon.zip

    (or if using a release version, substitute the filename weewx-uradmon.zip with the downloaded file name (eg: v0.1.4.zip))

  3. You will need to edit the main weewx.conf file and under the [Uradmon] section add the IP address of your unit.

     # Options for extension 'uradmon'
     [UradMon]
         #urad_debug = True
         data_binding = uradmon_binding
         uradmon_address = weewx.conf-Enter_your_network_address
    

    It will appear as above. Change the weewx.conf-Enter_your_network_address to point to your unit, using its IP address or its Qualified name.

    Next, edit the uradmon/skin.conf and in the top section there is the unit_id that needs changing. Replace what is there, with yours.

    [Uradmonitor]
            # id of your uradmonitor device, aka unit.
            # This is the unique number allocated by the uradmonitor site and
            # can be found on your dashboard page, once you are logged in.
            unit_id = 82010071
    
  4. Restart weewx

    sudo /etc/init.d/weewx stop
    
    sudo /etc/init.d/weewx start
    
  5. Problems? Hopefully none but if there are then look at your logs - syslog and apache2/error.log. If you view them in a terminal window then you will see what's happening, as it occurs.

    (I find multitail -f /var/log/syslog /var/log/apache2/error.log works for me {adjust to suit your install} -- apt-get install multi-tail if needed)

6.To uninstall

sudo wee_extension --uninstall uradmon

and then restart weewx

   sudo /etc/init.d/weewx stop

   sudo /etc/init.d/weewx start
   

Database options

In its default configuration, this skin will write to an sqlite database.

To change that to a mysql database then you need a suitable database user and to make a minor alteration to the uradmon entry in weewx.conf.

For the database, the following example assumes it will be named uradmon2, and that the database user will be the weewx default user. eg:- The following extract shows your user...

[DatabaseTypes]
    [...]
    [[MySQL]]
        [...]
        user = weewx

That user can now be assigned the appropriate permissions to operate the needed database. You may need to create the user depending how you have previously setup weewx setup (the default is sqlite only, ie:- no mysql).

mysql -uroot -p
Enter password:

 [...]
 MariaDB [(none)]> CREATE USER 'weewx'@'localhost' IDENTIFIED BY 'weewx';
 MariaDB [(none)]> GRANT select, update, create, delete, insert ON uradmon.* to weewx@localhost;
Query OK, 0 rows affected (0.01 sec)

MariaDB [(none)]> quit;
Bye

With the above step done you'll then need to change one of the uradmon entries that was installed by the uradmon extension into weewx.conf...

Replace the old entry database = uradmon_sqlite with your new one database = uradmon_mysql eg:-

[DataBindings]
    [[uradmon_binding]]
        [...]
        database = uradmon_mysql

you will also need to add the following...

[Databases]
    [[uradmon_mysql]]
        database_name = uradmon2
        database_type = MySQL

Save weewx.conf and then restart weewx as per the installation instructions above, then watch your logs for any errors. It should work seemlessly, but it always pays to check!

Changelog

Update: 05 Feb 2022

Add languages to skin - currently available from master branch only - and it is a Work In Progress!

This version is tentatively released as v0.2.7. In truth the master will be the most uptodate.

Contributions welcomed!! See issue #5 for a rundown on what is required

Update: Feb 2022

It has been reworked to include (if I've done it correctly) the A, D and Industrial units. It will detect which type based on the 'type' id returned from a json query. Currently it recognizes an A3 (type 8), an A (types 5 & 1), an Industrial (type 14) and a D model (type 6). Any other types will fall through to a syslog ERROR message with their corresponding json output. With that output we should be able to incorporate that hardware version, hopefully without any issues.

This version is not backwards compatable with the 1.5 series as it uses a different database schema. It was a case of the user hand editing the uradmon.py script to select the appropriate schema, or just having a one size fits all database with all the known fields present. I chose that later method. That's not to say that the code/database can't be tweaked to accomadate the original method but there is no reason to upgrade an existing installation to this version of the software. Nothing will be gained by it as this version is about incorporating other models. The database is now named 'uradmon2'. Just in case and because data is precious!

Now, I don't own these extra units. If something breaks I'll need quality debug information to fix it. I will definitely need the json output from your unit. That should be available in your syslog as if it runs without finding a suitable hook, it will politely print the output there.

index.html.tmpl will need modifying if you are using anything other than an A or A3 model. Not every field contains data and therefore needs to be individually checked. The latest A3 units no longer have cpm, or volts in their output - a huge change from the original. skin.conf will also need adjusting for the extra database fields that become available with the Industrial and D models. The weewx documentation should cover everything you need to know about configuring the skin.conf and index.html.tmpls. It should be your first port of call to learn about tweaking weewx.

If you have a problem you can't solve. Raise it as an issue on github or contact me directly. Github issues are best as it won't get lost plus everyone will know about it.

If you fix a problem, no matter how small, then also let me known so that I can update it here.

Update: Jun 2020

This version has been rolled up and released as v0.1.5 and is the last in its line. It is was written for, and is best suited to the A3 units.

Fix the utf-8 breakage (micros and cubes), add weewx4 logging.

This runs under python 2.7 ; it will also run under python3 as is required for weewx4.

The main change is that this weewx extension (SLE) has now been updated to capture, archive, and display the noise parameter. If your model does not capture noise, the skin will adapt by ignoring that field.

To do this the old database requires an extra field. This doesn't matter if you're doing a brand new install as it will obviously be created along with everything else. If you are upgrading though, you'll need to dump (if you want to restore your old data) and then rename (delete) your old database as uradmon will not use it in its current form.

Thanks go to evilbunny2008 and lizdodd for this enhancement.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published