Git Product home page Git Product logo

dsmrreader / dsmr-reader Goto Github PK

View Code? Open in Web Editor NEW
458.0 458.0 95.0 57.74 MB

DSMR-telegram reader & data visualizer for hobbyists. Free for non-commercial use.

Home Page: https://dsmr-reader.readthedocs.io

License: Other

Shell 2.37% Python 55.32% CSS 19.87% JavaScript 16.01% HTML 6.42%
dsmr-reader dsmr4 dsmr5 dsmrp1 energy-consumption-visualizer non-commercial p1 raspberry-pi telegram-data-storage

dsmr-reader's People

Contributors

balk77 avatar dennissiemensma avatar denvers avatar dependabot[bot] avatar f-erry avatar franktimmers avatar gerard33 avatar goegol avatar helmo avatar hugokerstens avatar jbrunink avatar jeanmik avatar jeroenpeters1986 avatar jorisvervuurt avatar jorkzijlstra avatar ju5t avatar justin991q avatar lckarssen avatar matgeroe avatar meijjaa avatar mind04 avatar mthmulders avatar nomnomnomhb avatar pyrocumulus avatar richieb2b avatar sanderdw avatar trbs avatar vavdb avatar watskebart avatar xirixiz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dsmr-reader's Issues

Check whether gas readings are optional

Because sometimes there is simply no gas meter attached to the dsmr device.

Possibly affects:

  • Mandatory database fields
  • Compactor services
  • Temperature readings hook.
  • Frontend interface

Redirect management command output to self.stdout

Originally reported by: Dennis Siemensma (Bitbucket: dennissiemensma, GitHub: dennissiemensma)


https://docs.djangoproject.com/en/1.8/howto/custom-management-commands/#module-django.core.management

"Note

When you are using management commands and wish to provide console output, you should write to self.stdout and self.stderr, instead of printing to stdout and stderr directly. By using these proxies, it becomes much easier to test your custom command. Note also that you don’t need to end messages with a newline character, it will be added automatically, unless you specify the ending parameter"


Status page/alerts when features are disabled/unavailable

Some features can be disabled in the admin interface. It would be nice if the GUI would show a message or have a status page (extend statistics page?) to also display whether features are enabled.

For example, it would be devestating if a user for some reason disabled P1 tracking, missing data.

Store daily, weekly, monthly and yearly statistics

Originally reported by: Dennis Siemensma (Bitbucket: dennissiemensma, GitHub: dennissiemensma)


The current compactor only compact gas each hour and electricity each reading (~ 10 seconds).

In order to support statistics and graphs on daily, weekly, monthly and yearly basis we should make another compactor.
To keep things separated, we might have to rename the existing compactor to something similar as 'extractor'.


Use WeatherUnderground as weather service

A friend of mine showed me Weather Underground, which is much more specific than the current source Buienradar. Almost every town has a use which shares his weather meter via this source.

I heard the API takes 150 free hits a day. I'm not sure that this is enough.

Align GasConsumption.read_at to represent the start of hour

Originally reported by: Dennis Siemensma (Bitbucket: dennissiemensma, GitHub: dennissiemensma)


Currently GasConsumption.read_at represents the passed hour read, so the end timestamp of the hour. We should make that the start of the hour instead.

Now

read_at = 22:00 = reading was between 21:00 and 22:00

Aligned

read_at = 21:00 = reading was between 21:00 and 22:00

Should not be very hard to alter, as migrations will be easy in the database (-1 hour).


Dashboard: EnergySupplierPrice matching query does not exist.

Originally reported by: Dennis Siemensma (Bitbucket: dennissiemensma, GitHub: dennissiemensma)


DoesNotExist at /
EnergySupplierPrice matching query does not exist.

#!python

/home/dsmr/dsmr-reader/dsmr_stats/mixins.py in get_context_data
                            day=electricity[0].read_at.astimezone(settings.LOCAL_TIME_ZONE) ...
▶ Local vars
/home/dsmr/dsmr-reader/dsmr_stats/services.py in day_consumption
                    target_date=consumption['day'] ...
▶ Local vars
/home/dsmr/dsmr-reader/dsmr_stats/models/energysupplier.py in by_date
                        start__lte=target_date, 

Explore timezone.localtime() as replacement for datetime.astimezone()

While exploring options for #42, I stumbled across Django's timezone.localtime(x), which:
Converts an aware datetime.datetime to local time.

Local time is defined by the current time zone, unless another time zone
is specified.

I'm used to datetime.astimezone(settings.LOCAL_TIME_ZONE), which seemed to work, but is not very neat anyway. So I checked the difference between the two:

localtime()
2016-02-14 06:25:00+00:00

astimezone()
2016-02-14 07:25:00+01:00

localtime relies on settings.TIME_ZONE, which is set hardcoded to UTC in this project to avoid DST bugs. However, I manualy convert lookups using an hardcoded settings.LOCAL_TIME_ZONE, which targets CET. The database also stores either UTC (mysql) or CET + 1 (postgres).

I think it would be best to have all data stored as UTC. It would also drop the need for having the 'hack' LOCAL_TIME_ZONE.

Export data points in CSV format

Originally reported by: Dennis Siemensma (Bitbucket: dennissiemensma, GitHub: dennissiemensma)


It should be possible for non-technical users to export certain data points in CSV format.

Data points may be:

  • Electricity (1 or 2) delivered or returned.
  • Gas delivered.
  • Electricity / gas cost
  • Total cost

As we should only allow export of pre-calculated date ranges, we might have to keep track of daily, weekly, monthly and even yearly statistics.

This option should be built as a django admin feature, using a custom method or something.


Separating apps & using signals

Originally reported by: Dennis Siemensma (Bitbucket: dennissiemensma, GitHub: dennissiemensma)


For the weather app (#18) I am about to use signals to keep the apps seperated. I just realized that it should be the de facto way of compacting readings.

Currently the compactor runs in a sperate command/supervisor process, doing nothing most of the time.
Django signals will make sure to both dispose the command and also only trigger when there is actually something to do.


Make additional DSMR data optional

The following data is stored for every base DSMR reading:

        "0-0:96.14.0": "electricity_tariff",
        "0-0:96.7.21": "power_failure_count",
        "0-0:96.7.9": "long_power_failure_count",
        "1-0:32.32.0": "voltage_sag_count_l1",
        "1-0:52.32.0": "voltage_sag_count_l2",
        "1-0:72.32.0": "voltage_sag_count_l3",
        "1-0:32.36.0": "voltage_swell_count_l1",
        "1-0:52.36.0": "voltage_swell_count_l2",
        "1-0:72.36.0": "voltage_swell_count_l3",

The data itself might be interesting, but should not get stored every time. Therefor we should wipe it from the data structure and have dsmr_datalogger.services.telegram_to_reading() ignore it.

The best solution I can come up with is to have dsmr_datalogger.services.read_telegram(), which is the data source for telegram_to_reading(), send a signal every time a telegram is read. Some other app (probably dsms_stats) should act upon it, storing it to a daily table (or Solo-model) once a day.

This will:

  • Improve reliability for parsing telegrams.
  • Save lots of data (I currently have 500.000+ readings over just 60 days, times the number of fields above)
  • Separate extra data not required for core functions.

Cleanup unused static files

Github currently analyzes this project as:
JavaScript 64.9% CSS 25.1% Python 7.5% HTML 2.3% Shell 0.2%

Around 65% of javascript seems a bit to much. I probably added *-dev packages or versions as well. Should get checked out and cleaned up, if possible.

Netinstall installer-config.txt / ansible

Originally reported by: Dennis Siemensma (Bitbucket: dennissiemensma, GitHub: dennissiemensma)


My Pi just wouldn't install due to broken or laggy mirrors. I fixed it by using some german university as mirror (http://www.raspbian.org/RaspbianMirrors).

We might want to have a read-to-use installer-config.txt anyway, which might shorten the installation guide a lot (for the headless users). More info @ https://github.com/debian-pi/raspbian-ua-netinst#installer-customization


Non-commercial use licence

http://choosealicense.com/licenses/

"Non-Commercial: Licensee may not use Software for commercial purposes. for the purpose of this license, commercial purposes means that a 3rd party has to pay in order to access Software or that the Website that runs Software is behind a paywall."

Implement automatic backups & Dropbox cloud storage

Backups should be made easy. We should check for any free online storage we can use and integrate.

For example, it would be nice when users can create or link their Dropbox, Onedrive, etc to the application, which will ensure backups.

Note sure if possible, but worth investigating.

Dropbox

https://www.dropbox.com/developers-v1/core/docs/python

OneDrive

https://github.com/onedrive/onedrive-sdk-python

Google Drive

https://developers.google.com/drive/v3/web/quickstart/python

Generic settings in database for consumption grouping

Originally reported by: Dennis Siemensma (Bitbucket: dennissiemensma, GitHub: dennissiemensma)


The grouping of consumption is currently a management command argument. We should move that to the database and have some other settings as well.

Consumption grouping:

  • Is now management command argument
  • Is now either 10 seconds or a minute.
  • Allow: 1, 2, 3, 5, 10, 15, 30 or 60 minutes.

Replace baud_rate setting for DSMR version

Originally reported by: Dennis Siemensma (Bitbucket: dennissiemensma, GitHub: dennissiemensma)


I recently added baud_rate settings, but it seems that older versions also use different settings for byte size and parity

DSMR 2/3

    serial_handle.baudrate = 9600
    serial_handle.bytesize = serial.SEVENBITS
    serial_handle.parity = serial.PARITY_EVEN
    serial_handle.baudrate = 115200
    serial_handle.bytesize = serial.EIGHTBITS
    serial_handle.parity = serial.PARITY_NONE

The buad rate setting should be converted to a predefined DSMR-version choice.


Data export: Mindergas.nl

Originally reported by: Dennis Siemensma (Bitbucket: dennissiemensma, GitHub: dennissiemensma)


Implement external API. Docs @ https://www.mindergas.nl/member/api

Note. Terms of use:

#!python

Gebruiksvoorwaarden

Er zijn een paar voorwaarden verbonden aan het gebruik van de API:

* De API is bedoeld voor privegebruik, dus om jouw meterstanden naar je eigen account te uploaden.
* Commercieel gebruik is niet toegestaan tenzij anders overeengekomen met ons.
* Alleen normaal gebruik van de API: Het uploaden van een meterstand 1x per 1 of meer dagen.
* We behouden ons het recht voor om de toegang tot de API te kunnen blokkeren.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.