DSMR Reader Documentation

Download Report

Transcript DSMR Reader Documentation

DSMR Reader Documentation Release 1.5.0

Dennis Siemensma

04. January 2017

Inhoudsopgave

1 Introductie 1.1

1.2

Projectmissie & doelen Waarom?

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1.3

1.4

1.5

Talen Github

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Vaardigheid

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 Screenshots 2.1

2.2

Zonnepanelen & teruglevering electriciteit

Dashboard

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.3

2.4

2.5

Archief

Trends

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Statistieken

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.6

2.7

2.8

2.9

Vergelijk

Status

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Exporteren instellingen

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10 11 12 12 3 3 4 4 7 8 1 1 1 1 1 1

3 Installatie 3.1

3.2

Afhankelijkheden & vereisten

1. Database backend

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3.3

3.4

2. Dependencies 3. Application user

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3.5

3.6

3.7

3.8

3.9

Je allereerste (optionele) meting 4. Webserver/Nginx (part 1)

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5. Clone project code from Github

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6. Virtualenv

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7. Application configuration & setup

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3.10 8. Bootstrapping

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3.11 9. Webserver/Nginx (part 2)

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3.12 10. Supervisor

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

17 17 18 19 19 20 20 21 21 22 22 23 23

4 De applicatie gebruiken 4.1

4.2

DSMR 2.x (oude meters) Bekijk applicatie

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4.3

4.4

4.5

Herstart-test

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Databehoud & backups

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Applicatie updates (bugfixes & nieuwe mogelijkheden)

. . . . . . . . . . . . . . . . . . . . . . . . .

25 25 25 26 26 26

i

4.6

Waarschuwing voor publiekelijke toegang

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

26

5 API

5.1

5.2

Configuratie

API calls

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

29 30 31

6 Veelgestelde vragen (FAQ) 6.1

6.2

Hoe kan ik mijn applicatie bijwerken?

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Dropbox: Automatisch backups uploaden

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6.3

6.4

Mindergas.nl: Automatisch gasmeterstanden exporteren

. . . . . . . . . . . . . . . . . . . . . . . .

Verbruiksnotificaties: Dagelijkse verbruiksstatistieken op je smartphone

. . . . . . . . . . . . . . . .

6.5

6.6

6.7

6.8

6.9

Ik betaal voor een enkel tarief maar ik zie er twee!

Ik wil mijn elektriciteitsfasen ook inzien

Verzoek/fout melden

. . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Prijzen opnieuw berekenen met terugwerkende kracht

. . . . . . . . . . . . . . . . . . . . . . . . .

Ik zie geen gasverbruik

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

33 33 34 36 37 40 40 41 41 41

7 Wijzigingenoverzicht 7.1

Updaten

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.2

7.3

7.4

v1.5.1 - 2017-01-04

v1.5.0 - 2017-01-01 v1.4.1 - 2016-12-12

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.5

7.6

7.7

7.8

v1.4.0 - 2016-11-28 v1.3.2 - 2016-11-08 v1.3.1 - 2016-08-16 v1.3.0 - 2016-07-15

7.9

v1.2.0 - 2016-05-18 7.10 v1.1.2 - 2016-05-01 7.11 v1.1.1 - 2016-04-27 7.12 v1.1.0 - 2016-04-23

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.13 v1.0.1 - 2016-04-07

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.14 v1.0.0 - 2016-04-07 7.15 [ 𝛽 ] 𝑣 0 .

1(2015 − 10

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

− 29) 𝑡𝑜 0 .

16(2016 − 04 − 06)

. . . . . . . . . . . . . . . . . . . . . . . . . . .

43 43 43 44 44 45 45 45 45 46 46 46 46 47 47 47

8 Bijdrage leveren 8.1

8.2

Feedback

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Pull requests

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

51 51 51

9 Credits 9.1

9.2

Bijzondere dank voor de code-bijdragen van Dank voor de bijdrages van

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

9.3

9.4

Software

Overig

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

53 53 53 53 54

10 Licentie (GNU GPLv3) 10.1 GNU GENERAL PUBLIC LICENSE

10.2 TERMS AND CONDITIONS

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

55 55 56

ii

HOOFDSTUK

1 Introductie

1.1 Projectmissie & doelen

• Een gemakkelijk te gebruiken oplossing voor het bijhouden van je eigen energieverbruik.

• Alle gegevens zijn eigendom van jezelf (alle data wordt lokaal opgeslagen en wordt niet gedeeld met de buiten wereld).

• Altijd gratis te gebruiken (en tevens open-source op Github).

1.2 Waarom?

Omdat open-source het beste in een community naar boven brengt en zorgt voor nieuwe ideĂŤen of inzichten. In het afgelopen jaar zijn er tevens tal andere coole DSMR-projecten gestart!

1.3 Talen

De gehele applicatie, en bijbehorende code, is in het Engels geschreven. De grafische interface is echter ook in het Nederlands beschikbaar. Deze wordt getoond afhankelijk van de taalinstelling van je webbrowser.

1.4 Vaardigheid

Het project is behoorlijk gedocumenteerd, maar vereist desondanks een zekere Unix-vaardigheid. Je zult namelijk handmatig diverse afhankelijkheden moeten installeren via de command line.

Ik raad je aan deze tool alleen te gebruiken wanneer je enige Linux-basiskennis hebt. Of wanneer je interesse hebt in de gebruikte componenten.

1.5 Github

Je kunt het project hier vinden: https://github.com/dennissiemensma/dsmr-reader

1

DSMR Reader Documentation, Release 1.5.0

2 Hoofdstuk 1. Introductie

HOOFDSTUK

2 Screenshots

Hieronder staan enkele screenshots van de applicatie. Lees hieronder ook de notitie met betrekking tot zonnepanelen en de ondersteuning daarvoor.

Inhoud •

Screenshots

–

Zonnepanelen & teruglevering electriciteit

– –

Dashboard Archief

– – – – – –

Trends

Statistieken

Vergelijk

Status

Exporteren instellingen

2.1 Zonnepanelen & teruglevering electriciteit

Notitie: Wees ervan bewust dat ik thuis geen zonnepanelen heb voor heeft qua weergave teruglevering elektriciteit .

, maar dat de applicatie daar wel ondersteuning Daarom staan er daar niet altijd grafieken van in deze screenshots, maar de gebruikers die ze wel thuis hebben, zullen overal een extra groene grafiek zien binnen de applicatie.

3

DSMR Reader Documentation, Release 1.5.0

2.2 Dashboard

Het dashboard weergeeft de meest recente informatie over je energieverbruik van vandaag en de lopende maand tot nu toe.

2.3 Archief

Het archief stelt je in staat om terug in de tijd te gaan naar elke moment dat gemeten is met de appli catie.

Gegevens kunnen getoond worden op verschillende detailniveaus: per dag, per maand en per jaar.

4 Hoofdstuk 2. Screenshots

DSMR Reader Documentation, Release 1.5.0

2.3. Archief 5

DSMR Reader Documentation, Release 1.5.0

6 Hoofdstuk 2. Screenshots

2.4 Trends

DSMR Reader Documentation, Release 1.5.0

2.4. Trends

Trends weergeven je gemiddelde energieverbruik en gewoontes.

7

DSMR Reader Documentation, Release 1.5.0

2.5 Statistieken

De statistiekenpagina weergeeft de huidige staat van je slimme meter en de huidige energietarieven (wanneer van toe passing).

8 Hoofdstuk 2. Screenshots

DSMR Reader Documentation, Release 1.5.0

2.5. Statistieken 9

DSMR Reader Documentation, Release 1.5.0

2.6 Vergelijk

Met deze pagina vergelijk je eenvoudig twee dagen, maanden of jaren met elkaar.

10 Hoofdstuk 2. Screenshots

DSMR Reader Documentation, Release 1.5.0

2.7 Status

De statuspagina weergeeft de ‘gezondheid’ van de applicatie en die van de dataverwerking.

Moch ten er problemen zijn met het verzamelen van gegevens dan zou dat hier zichtbaar moeten zijn.

2.7. Status 11

DSMR Reader Documentation, Release 1.5.0

2.8 Exporteren

Wil je alle dag- of uurtotalen exporteren om in Excel te bekijken? Dat kan via deze pagina door ze te exporteren in .CSV-formaat.

2.9 instellingen

Het project is gemaakt met Django en hieronder staan enkele beheerderspagina’s daarvan.

De applicatie heeft behoorlijk back-ups en Dropbox-integratie.

wat features, zoals buitentemperatuur bijhouden, geautomatiseerde Op deze pagina kun je een overzicht vinden van alle instellingen.

12 Hoofdstuk 2. Screenshots

DSMR Reader Documentation, Release 1.5.0

2.9. instellingen 13

DSMR Reader Documentation, Release 1.5.0

Hier kun je je energieprijzen beheren: Hiermee beheer je de instellingen voor je back-ups:

14 Hoofdstuk 2. Screenshots

DSMR Reader Documentation, Release 1.5.0

Kies je eigen kleuren voor de grafieken: De applicatie ondersteunt het dagelijks exporteren van je gasmeterstanden naar je eigen account bij mindergas.nl.

Er zijn nog diverse andere beheerpagina’s beschikbaar voor de overige configuratie-instellingen.

2.9. instellingen 15

DSMR Reader Documentation, Release 1.5.0

16 Hoofdstuk 2. Screenshots

HOOFDSTUK

3 Installatie

Notitie: Het installeren duurt naar verwachting zo’n half uur van je eigen vaardigheid op de command line.

(op een RaspberryPi 2/3), maar hangt natuurlijk ook af Inhoudsopgave •

Installatie

–

Afhankelijkheden & vereisten

– –

1. Database backend

2. Dependencies

– – – – – – – – –

3. Application user

Je allereerste (optionele) meting 4. Webserver/Nginx (part 1)

5. Clone project code from Github 6. Virtualenv

7. Application configuration & setup 8. Bootstrapping

9. Webserver/Nginx (part 2) 10. Supervisor

3.1 Afhankelijkheden & vereisten

• RaspberryPi 2 of 3 • De RaspberryPi 1 lijkt te traag zijn.

voor het draaien van dit project, gezien meerdere processoren vrijwel vereist Notitie: • Alternatief #1 : Je kunt dit natuurlijk ook draaien op een server vlakbij je slimme meter, zolang de vereisten maar ondersteund worden.

• Alternatief #2 : De applicatie ondersteunt het ontvangen van P1 telegrammen via een API, dus je kunt dit ook

op een server buiten je huis draaien. ( API DOCS )

• Raspbian OS

17

DSMR Reader Documentation, Release 1.5.0

• Aanbevolen en mee getest, al zou elk OS die dezelfde vereisten ondersteunt prima moeten zijn.

• Python 3.4+ Waarschuwing: Django).

Ondersteuning voor Python 3.3

is vervallen sinds DSMR-reader v1.5

(vanwege • PostgreSQL 9+ of MySQL / MariaDB 5.5+ • Ik raad PostgreSQL sterk aan wegens de goede ingebouwde ondersteuning voor tijdzones.

• Slimme meter met ondersteuning voor ten minste DSMR 4.x+ en een P1 telegram poort • Tot nu toe getest met Landis+Gyr E350, Kaifa. Telegram poort (P1) ziet er uit als een RJ11 (telefoon) aanslui ting.

• Minimaal 1 GB schijfruimte vereist op RaspberryPi (SD-kaart) (ten behoeve van de applicatie en Virtua lEnv).

• Meer schijfruimte is nodig voor het opslaan van alle metingen (optioneel). Over het algemeen adviseer ik minimaal een 8 GB SD-kaart.

• De metingen nemen zo’n 90+ procent van alle schijfruimte in beslag. Er komt echter een optie voor retentie in een toekomstige release in 2017.

• Slimme meter P1 data kabel • Je kunt deze online bestellen voor ongeveer 15 a 20 Euro.

• Basiskennis Linux voor het uitrollen en mogelijk debuggen van problemen • Het scheelt eenmaal een hoop wanneer je weet waar je mee bezig bent.

3.2 1. Database backend

De applicatie slaat alle metingen op in een database. Afhankelijk van je wensen en behoeftes heb je de keuze uit: (Keuze A.) PostgreSQL (Keuze B.) MySQL/MariaDB .

Notitie: Wanneer je geen idee hebt wat je moet kiezen, dan adviseer ik doorgaans om PostgreSQL te kiezen. Dit vanwege de uitstekende ingebouwde ondersteuning voor tijdzones (nodig voor zomer-/wintertijd).

3.2.1 (Keuze A.) PostgreSQL

Installeer PostgreSQL. Daarnaast is postgresql-server-dev-all nodig voor het installeren van de VirtualEnv later.

• Installeer database: sudo apt-get install -y postgresql postgresql-server-dev-all Start PostgreSQL niet wegens een fout in ‘locales’?

Probeer dan het volgende: locales . Werkt het nog steeds niet? Open dan dit bestand /etc/environment dpkg-reconfigure , voeg onderaan de regel LC_ALL="en_US.utf-8" toe en herstart het systeem.

(!) Negeer voor de volgende drie commando’s de foutmelding: ‘ could not change directory to “/root”: Permission denied ‘.

18 Hoofdstuk 3. Installatie

DSMR Reader Documentation, Release 1.5.0

• Creëer databasegebruiker: sudo sudo -u postgres createuser -DSR dsmrreader • Creëer database, met als eigenaar de databasegebruiker die we net hebben aangemaakt: sudo sudo -u postgres createdb -O dsmrreader dsmrreader • Stel wachtwoord in voor databasegebruiker: sudo sudo -u postgres psql -c "alter user dsmrreader with password 'dsmrreader';"

3.2.2 (Keuze B.) MySQL/MariaDB

Installeer MariaDB. Je kunt er ook voor kiezen om het closed-source MySQL te installeren. Welke je ook kiest, libmysqlclient-dev is later nodig voor de VirtualEnv.

• Installeer database: sudo apt-get install -y mariadb-server-10.0 libmysqlclient-dev • Creëer database: sudo mysqladmin create dsmrreader • Creëer databasegebruiker: echo "CREATE USER 'dsmrreader'@'localhost' IDENTIFIED BY 'dsmrreader';" | sudo mysql --defaults-file=/etc/mysql/debian.cnf -v • Stel rechten in voor databasegebruiker: echo "GRANT ALL ON dsmrreader.* TO 'dsmrreader'@'localhost';" | sudo mysql --defaults-file=/etc/mysql/debian.cnf -v • Pas de databaserechten toe: sudo mysqladmin reload --defaults-file=/etc/mysql/debian.cnf

3.3 2. Dependencies

Tijd om diverse tools te installeren. Deze zijn nodig voor de Nginx webserver, de Gunicorn applicatieserver en voor het binnenhalen van de code van de applicatie vanaf Github: sudo apt-get install -y nginx supervisor git python3 python3-pip python3-virtualenv virtualenvwrapper Installeer cu . Met dit programmaatje kunnen we vrij gemakkelijk de DSMR-verbinding testen naar je slimme meter toe. Erg handig om te kijken of dat ßberhaupt al lekker werkt.

sudo apt-get install -y cu

3.4 3. Application user

De applicatie draait standaard onder de gebruiker dsmr . Hierdoor heeft het geen root -rechten (nodig), wat over het algemeen zeer afgeraden wordt.

Maak een aparte gebruiker aan met eigen homedir. De code voor de applicatie en VirtualEnv zetten we later hier in:

3.3. 2. Dependencies 19

DSMR Reader Documentation, Release 1.5.0

sudo useradd dsmr --home-dir /home/dsmr --create-home --shell /bin/bash De gebruiker heeft ook toegang nodig om de kabel te kunnen uitlezen. Hiervoor voegen de we gebruiker toe aan de groep dialout : sudo usermod -a -G dialout dsmr Ga ofwel door naar het volgende hoofdstuk voor een testmeting of ga direct door naar stap 4.

3.5 Je allereerste (optionele) meting

Notitie: OPTIONEEL : Je kunt deze stap overslaan wanneer je al eerder een (test)meting hebt gedaan met je slimme meter. Ik raad het dus vooral aan als je nog nooit eerder je P1-poort hebt uitgelezen. Hiermee verzeker je jezelf ook dat de applicatie straks dezelfde (werkende) toegang heeft voor de metingen.

• Log nu in als de gebruiker die we zojuist hebben aangemaakt voor de eerste testmeting!

sudo su - dsmr • Test met cu voor DSMR 4+ : cu -l /dev/ttyUSB0 -s 115200 --parity=none -E q • Of test met cu voor DSMR 2.2

(ongetest): cu -l /dev/ttyUSB0 -s 9600 --parity=none Je zou nu iets moeten zien als Connected.

. Vervolgens krijg je, als het goed is, binnen tien seconden een hele lap tekst te zijn met een hoop cijfers. Werkt het niet? Probeer dan een andere BAUD-waarde, zoals hierboven beschreven.

Of kijk op een nuttig weblog .

• Om cu af te sluiten, typ “ q.

”, druk op Enter en wacht voor een paar seconden. Het programma sluit af met de melding Disconnected.

.

3.6 4. Webserver/Nginx (part 1)

We configureren vervolgens de webserver (Nginx). Deze serveert alle statische bestanden en geeft de applicatie verzoeken door naar de backend, waar de applicatie in Gunicorn draait onder Supervisor. Deze stellen we later in.

• Zorg ervoor dat je hier nog steeds root - of sudo -gebruiker bent.

Django kopieert alle statische bestanden naar een aparte map, die weer door Nginx gebruikt wordt. Daarom is er tevens (schrijf)toegang voor nodig: sudo mkdir -p /var/www/dsmrreader/static sudo chown -R dsmr:dsmr /var/www/dsmrreader/

20 Hoofdstuk 3. Installatie

DSMR Reader Documentation, Release 1.5.0

3.7 5. Clone project code from Github

Nu kunnen we de code van de applicatie van Github downloaden en in de homedir zetten die we net aangemaakt hebben.

• Zorg ervoor dat je ingelogd bent als dsmr -gebruiker (zo niet, typ dan: sudo su - dsmr ) • Kloon de repository: git clone https://github.com/dennissiemensma/dsmr-reader.git

Dit kan enkele seconden in beslag nemen. Als het goed is zie je hierna een map genaamd dsmr-reader , met daarin een kopie van de repository zoals die op Github staat.

3.8 6. Virtualenv

Alle (externe) afhankelijkheden worden opgeslagen in een aparte omgeving, ook wel VirtualEnv genoemd.

Dit is allemaal erg handig, ondanks dat het feitelijk niets meer voorstelt dan een aparte map binnen de homedir van onze gebruiker. Hierdoor kunnen we namelijk meerdere versie van software op hetzelfde systeem installeren, zonder dat dat elkaar bijt. Meer informatie hierover kan hier gevonden worden .

• Zorg ervoor dat je nog steeds ingelogd bent als dsmr -gebruiker (zo niet, typ dan: sudo su - dsmr ) • Maak map aan voor de VirtualEnv van deze gebruiker: mkdir ~/.virtualenvs

• Maak een nieuwe VirtualEnv aan. Het is gebruikelijk om hiervoor dezelfde naam te gebruiken als die van de applicatie of het project.

virtualenv ~/.virtualenvs/dsmrreader --no-site-packages --python python3 Notitie: N.B.: het is belangrijk dat je voor deze VirtualEnv aangeeft dat Python 3 de gewenste standaardversie is: • Zet beide commands in het ~/.bashrc

bestand van de dsmr gebruiker met je favoriete bestandseditor: source ~/.virtualenvs/dsmrreader/bin/activate cd ~/dsmr-reader Hiermee wordt zowel de VirtualEnv geactiveerd ĂŠn ga je direct naar de juiste map. Dit werkt de eerstvolgende keer dat je inlogt als dsmr gebruiker.

Notitie: Je kunt dit vrij gemakkelijk testen door uit te loggen als weer in te loggen met sudo su - dsmr .

dsmr gebruiker (met CTRL + D) en vervolgens Als het goed is heeft je terminal (dsmrreader)dsmr@rasp:~/dsmr-reader $ nu een (dsmrreader) prefix, bijvoorbeeld: Zorg ervoor dat je bovenstaande notities hebt gelezen ĂŠn uitgevoerd, aangezien ze nodig zijn voor het volgende hoofd stuk.

3.7. 5. Clone project code from Github 21

DSMR Reader Documentation, Release 1.5.0

3.9 7. Application configuration & setup

Eerder tijdens de installatie moest je kiezen voor ofwel (A.) PostgreSQL ofwel (B.) MySQL/MariaDB . De applicatie moet zelf ook weten met welke variant hij communiceert.

Daarom heb ik twee standaard (Django-)configuraties gemaakt die je gewoon kan kopiÍren. Daarnaast heeft elke database zijn eigen database-client nodig. Daarvoor heb ik ook een tweetal requirements-bestanden gemaakt, waar alles al in staat wat nodig is. Zoals bijvoorbeeld Django en de databaseverbinding.

Het bestand base.txt

bevat alle afhankelijkheden die de applicatie sowieso nodig heeft, ongeacht de databasekeuze die je gemaakt hebt.

Notitie: De installatie van de volgende afhankelijkheden kan enige tijd in beslag nemen . Dit varieert en is sterk afhankelijk van de snelheid van je Internet-verbinding en je RaspberryPi. Je hoeft je dus niet zorgen te maken wanneer dit lang lijkt te duren. :]

3.9.1 (Keuze A.) PostgreSQL

• Heb je gekozen voor PostgreSQL? Voer dan deze twee regels uit: cp dsmrreader/provisioning/django/postgresql.py dsmrreader/settings.py

pip3 install -r dsmrreader/provisioning/requirements/base.txt -r dsmrreader/provisioning/requirements/postgresql.txt

3.9.2 (Keuze B.) MySQL/MariaDB

• Of heb je gekozen voor MySQL/MariaDB? Voer dan deze twee commando’s uit: cp dsmrreader/provisioning/django/mysql.py dsmrreader/settings.py

pip3 install -r dsmrreader/provisioning/requirements/base.txt -r dsmrreader/provisioning/requirements/mysql.txt

Zonder problemen alles kunnen installeren?

Mocht een van de database clients niet willen installeren wegens missende bestanden, controleer dan of je eerder tijdens de installatie het volgende hebt uitgevoerd: als het goed is heb je postgresql-server-dev-all (voor PostgreSQL ) of libmysqlclient-dev geïnstalleerd, tegelijkertijd met de databaseserver. Die zijn namelijk hiervoor nodig.

(voor MySQL )

3.10 8. Bootstrapping

Tijd om te kijken of alles goed is ingesteld. We gaan de applicatie proberen te initialiseren.

• Voer dit uit om de database te initialiseren: ./manage.py migrate Ga nu bezit met de statische bestanden voor de webinterface. Dit kopieert alle statische bestanden in de map die we eerder, vlak na de installatie voor Nginx, hebben aangemaakt. Het zorgt ervoor dat Nginx deze bestanden kan hosten buiten de code-bestanden.

• Synchroniseer statische bestanden:

22 Hoofdstuk 3. Installatie

DSMR Reader Documentation, Release 1.5.0

./manage.py collectstatic --noinput Maak een gebruiker aan voor binnen de applicatie. Django vraagt je om een wachtwoord te kiezen. Met deze gegevens kun je het beheerderspaneel binnen de applicatie gebruiken. Indien gewenst kun je een andere gebruikersnaam kiezen.

Het e-mailadres maakt niet uit, want de applicatie ondersteunt toch geen e-mail.

• Creëer je eigen gebruiker: ./manage.py createsuperuser --username admin --email root@localhost Notitie: Wachtwoord ooit vergeten? Via de command line kun je je wachtwoord (bij verlies) hiermee aanpassen: ./manage.py changepassword admin Je bent op dit punt bijna klaar met de installatie.

3.11 9. Webserver/Nginx (part 2)

Notitie: Deze installatiehandleiding gaat er vanuit dat je de Nginx webserver alleen gebruikt voor deze applicatie.

Het is uiteraard mogelijk dat andere applicaties ook Nginx gebruiken, maar daarvoor zul je de wildcard moet weghalen in de dsmr-webinterface vhost, die je hieronder kopieert.

Ga terug naar de root / sudo -gebruiker om de webserver in te stellen (druk op CTRL + D ).

Verwijder de standaard vhost van Nginx wanneer je deze niet zelf gebruikt (zie de notitie hierboven): sudo rm /etc/nginx/sites-enabled/default • Kopieer de vhost voor de applicatie. Deze luistert standaard naar elke hostname (wildcard), maar dat is natuur lijk naar eigen wens aan te passen: sudo cp /home/dsmr/dsmr-reader/dsmrreader/provisioning/nginx/dsmr-webinterface /etc/nginx/sites-enabled/ • Laat Nginx controleren of je geen typefouten hebt gemaakt en herlaad Nginx vervolgens wanneer de configtest lukt: sudo service nginx configtest sudo service nginx reload

3.12 10. Supervisor

We gaan nu Supervisor configureren, die gebruikt wordt om de applicatie en achtergrondprocessen te draaien. Tevens zorgt Supervisor ervoor dat deze processen bij het (opnieuw) opstarten automatisch draaien.

• Kopieer het configuratie-bestand voor Supervisor: sudo cp /home/dsmr/dsmr-reader/dsmrreader/provisioning/supervisor/dsmr-reader.conf /etc/supervisor/conf.d/ • Wissel naar de supervisorctl beheerconsole:

3.11. 9. Webserver/Nginx (part 2) 23

DSMR Reader Documentation, Release 1.5.0

sudo supervisorctl • Voer de volgende commando’s in ( degene na de > ). Dit zorgt ervoor dat Supervisor zijn eigen configuratie opnieuw controleert en toepast: supervisor > reread supervisor > update Er draaien als het goed is altijd drie processen. Kijk goed of ze uiteindelijk niet in ERROR of BACKOFF status terecht zijn gekomen. Je kunt het overzicht verversen door status te typen.

• Typ het volgende wanneer je nog in supervisorctl ‘s console bent: supervisor > status Voorbeeld van wanneer alles naar behoren draait: dsmr_backend dsmr_datalogger dsmr_webinterface RUNNING RUNNING RUNNING pid 123, uptime 0:00:06 pid 456, uptime 0:00:07 pid 789, uptime 0:00:07 • Wil je controleren of de datalogger zijn werk goed doet? Bekijk dan het logbestand in supervisor met: supervisor> tail -f dsmr_datalogger Uiteindelijk zou je ongeveer dezelfde lap tekst moeten zien als toen we handmatig gemeten hebben met het programma.

cu Wil je uit supervisor? Druk dan op CTRL + C om het logbestand niet meer te bekijken en vervolgens op CTRL + D om uit supervisor te gaan.

Alles zou nu moeten werken! We zijn bijna klaar, op een paar laatste dingen na in het volgende hoofdstuk.

24 Hoofdstuk 3. Installatie

HOOFDSTUK

4 De applicatie gebruiken

Inhoudsopgave •

De applicatie gebruiken

–

DSMR 2.x (oude meters)

– –

Bekijk applicatie

Herstart-test

– – –

Databehoud & backups Applicatie updates (bugfixes & nieuwe mogelijkheden) Waarschuwing voor publiekelijke toegang

4.1 DSMR 2.x (oude meters)

Notitie: N.B.: De standaard DSMR-versie die de applicatie gebruikt is DSMR 4.x. Dit is namelijk de standaardver sie voor nieuwe/recent geplaatste slimme meters.

Waarschuwing: Wanneer je een meter met DSMR 2.x hebt, zul je deze in het beheerderpaneel onder dataloggerconfiguratie moet instellen.

4.2 Bekijk applicatie

Dit is het moment om de applicatie te bekijken in je browser om te zien of alles naar behoren werkt. Vul het IP-adres van je RaspberryPi in je browser.

Heb je de applicatie geinstalleerd met een monitor aan je RaspberryPi en weet je het IP-adres niet? Typ in dat geval het volgende in en je krijgt het IP-adres te zien: ifconfig | grep addr eth0 Link encap:Ethernet HWaddr b8:27:eb:f4:24:de inet addr:192.168.178.150

Bcast:192.168.178.255

inet addr:127.0.0.1

Mask:255.0.0.0

Mask:255.255.255.0

In dit voorbeeld is het IP-adres 192.168.178.150

. Het is aan te raden om je apparaat een vast IP-adres te geven in je router. Dit zorgt ervoor dat je de applicatie altijd op dezelfde locatie kan terugvinden.

25

DSMR Reader Documentation, Release 1.5.0

4.3 Herstart-test

Herstart het apparaat met zien draaien via reboot om te testen of alles automatisch opstart. Je zou na de herstart alles moeten sudo supervisorctl status . Dit zorgt ervoor dat je datalogger eventuele stroomstoringen overleeft (of wanneer je zelf de stroom eraf haalt).

4.4 Databehoud & backups

Notitie: Zorg ervoor dat je regelmatig back-ups maakt ! Het is een veelvoorkomende fout om dat niet te doen en zelf liep ik er ook al vrij snel tegenaan. Gelukkig gebeurde dat vrij vroeg in het traject en was ik ‘slechts’ een maand aan gegevens kwijt. Stel je voor dat je jaren met historische data kwijtraakt, zou zonde zijn!

• De SD-kaart is verreweg de zwakste schakel in dit geheel and gaat gegarandeerd kapot op een dag.

• De applicatie maakt standaard elke nacht een back-up. Echter, hiermee staan de gegevens nog steeds lokaal op je ‘kwestsbare’ SD-kaart. Je zult die data dus moeten kopieren naar een locatie buiten je RaspberryPi om.

• Er is ingebouwde ondersteuning om back-ups naar je Dropbox -account te uploaden.

toegang tot je (privĂŠ) bestanden in je Dropbox-account heeft .

Zonder dat de applicatie • Zorg ervoor dat je ofwel deze feature gebruikt ofwel zelf back-ups maakt en ze regelmatig ergens heen kopieert (zie hieronder).

• Je kunt er tevens voor kiezen om zelf backups buiten de applicatie om te maken.

• Er zijn voorbeeldscripts voor back-ups beschikbaar in dsmrreader/provisioning/postgresql/psql-backup.sh

voor PostgreSQL . Deze gebruik ik zelf om handmatig een back-up te maken naar een USB-stick die aan mijn RaspberryPi hangt.

• Voor MySQL/MariaDB kun je dit script gebruiken: dsmrreader/provisioning/mysql/mysql-backup.sh

.

• Zorg ervoor dat je de back-ups via een ‘daily cronjob’ hebt ingepland en test dat door het volgende uit te voeren: run-parts -v /etc/cron.daily

.

• Kijk ook af en toe of je nog voldoende schijfruimte hebt. Later zal ik de mogelijkheid toevoegen om oude metingen (niet de dagtotalen) te verwijderen na een X-periode.

Alles gelukt? Gefeliciteerd! Dit was het lastigste gedeelte en nu kun je eindelijk gebruikmaken van de applicatie en je energieverbruik meten.

4.5 Applicatie updates (bugfixes & nieuwe mogelijkheden)

Zie ook:

Deze informatie kun je hier terugvinden .

4.6 Waarschuwing voor publiekelijke toegang

Waarschuwing: Wanneer je de applicatie koppelt aan het Internet wil je sowieso extra maatregelen nemen: • Zorg ervoor dat je de instelling SECRET_KEY wijzigt in het bestand dsmrreader/settings.py

.

26 Hoofdstuk 4. De applicatie gebruiken

DSMR Reader Documentation, Release 1.5.0

• Vergeet vooral niet om daarna ./post-deploy.sh

uit te voeren (staat in hoogste map van project), die ervoor zorgt dat de hele applicatie zichzelf herlaadt en daarmee de nieuwe instellingen per direct gebruikt.

• Installeer een firewall, zoals ufw ( UncomplicatedFirewall ) and beperk al het toegestane verkeer tot poort 22 (puur voor jezelf) en poort 80 .

• Je zou in Nginx de toegang moeten beperken door altijd inloggegevens te vragen voor het bekijken van de applicatie. Genereer een zogenaamde htpasswd-tekenreeks via een van de vele websites die dit voor je kunnen doen .

Waarschuwing: Je kunt een htpassw-generator veilig gebruiken zolang je maar NOOIT persoonlijke informa tie of gegevens invoert die je ook op andere websites gebruikt !

• Plak de htpasswd-tekenreeks in het bestand /etc/nginx/htpasswd .

• Open de website’s vhost in /etc/nginx/sites-enabled/dsmr-webinterface gende regels in (verwijder de ## tekens): en schakel de vol ## ## auth_basic "Restricted application"; auth_basic_user_file /etc/nginx/htpasswd; • Zorg ervoor dat je geen typefouten hebt gemaakt door te controleren met: sudo service nginx configtest • En herlaad met: sudo service nginx reload Als het goed is krijg je de volgende keer dat je de applicatie bekijkt een pop-up te zien, waarin je gevraagd wordt om in te loggen. Voor meer informatie over dit onderwerp zie de Nginx documentatie .

4.6. Waarschuwing voor publiekelijke toegang 27

DSMR Reader Documentation, Release 1.5.0

28 Hoofdstuk 4. De applicatie gebruiken

De applicatie heeft een eenvoudige, enkele API-call voor dataloggers op afstand.

Inhoud •

API

– –

Configuratie

*

API inschakelen

*

Autorisatie

*

Voorbeelden

API calls

*

POST /api/v1 /datalogger/dsmrreading

¡

Voorbeeld

HOOFDSTUK

5 API

29

DSMR Reader Documentation, Release 1.5.0

5.1 Configuratie 5.1.1 API inschakelen

Standaard is de API in de applicatie uitgeschakeld. Je kunt deze inschakelen in het configuratiescherm of beheerderpa neel.

5.1.2 Autorisatie

Naast het inschakelen van de API zul je ook een (automatisch) gegenereerde API autorisatiesleutel moeten gebruiken.

Deze kun je terugvinden op dezelfde pagina als in bovenstaand screenshot. Op de configuratiepagina staat de sleutel ook, maar slechts ten delete. Pas overigens gerust de API autorisatiesleutel naar wens aan. De applicatie genereert initieel (eenmalig) een voor je.

Je moet deze gebruiken voor elke API call die je uitvoert. De header heet X-AUTHKEY . Zie hieronder voor een voorbeeld.

5.1.3 Voorbeelden

Met cURL : curl http://YOUR-DSMR-URL/api/v1/endpointX \ -d 'telegram=xxxxx' \ -H 'X-AUTHKEY: YOUR-DSMR-API-AUTHKEY' Met requests : requests .

post( 'http://YOUR-DSMR-URL/api/v1/datalogger/dsmrreading' , headers = { 'X-AUTHKEY' : 'YOUR-DSMR-API-AUTHKEY' }, data = { 'telegram' : 'xxxxx' }, )

30 Hoofdstuk 5. API

DSMR Reader Documentation, Release 1.5.0

5.2 API calls 5.2.1 POST /api/v1 /datalogger/dsmrreading

Dit staat je toe om een ruwe telegram aan de applicatie door te geven, wanneer je deze op afstand uitleest.

• Methode: POST • Data: telegram (als een ruwe tekenreeks inclusief zowel alle regeleindes \n als ‘carriage returns’ \r ) • Status code resultaat: HTTP 200 wanneer succesvol, elke andere code bij falen.

Voorbeeld

(met de requests tool beschikbaar in PIP):

import requests

# Tested with requests==2.9.1

# Fake buffer.

telegram_string = '' .

join([ "/KFM5KAIFA-METER

\r\n

" , "

\r\n

" , "1-3:0.2.8(42)

\r\n

" , "0-0:1.0.0(160303164347W)

\r\n

" , "0-0:96.1.1(*******************************)

\r\n

" , "1-0:1.8.1(001073.079*kWh)

\r\n

" , "1-0:1.8.2(001263.199*kWh)

\r\n

" , "1-0:2.8.1(000000.000*kWh)

\r\n

" , "1-0:2.8.2(000000.000*kWh)

\r\n

" , "0-0:96.14.0(0002)

\r\n

" , "1-0:1.7.0(00.143*kW)

\r\n

" , "1-0:2.7.0(00.000*kW)

\r\n

" , "0-0:96.7.21(00006)

\r\n

" , "0-0:96.7.9(00003)

\r\n

" , "1-0:99.97.0(1)(0-0:96.7.19)(000101000001W)(2147483647*s)

\r\n

" , "1-0:32.32.0(00000)

\r\n

" , "1-0:32.36.0(00000)

\r\n

" , "0-0:96.13.1()

\r\n

" , "0-0:96.13.0()

\r\n

" , "1-0:31.7.0(000*A)

\r\n

" , "1-0:21.7.0(00.143*kW)

\r\n

" , "1-0:22.7.0(00.000*kW)

\r\n

" , "!74B0

\n

" , ]) # Register telegram by simply sending it to the application with a POST request.

response = requests .

post( 'http://YOUR-DSMR-URL/api/v1/datalogger/dsmrreading' , headers = { 'X-AUTHKEY' : 'YOUR-DSMR-API-AUTHKEY' }, data = { 'telegram' : telegram_string}, ) # You will receive a status 200 when successful.

if

response .

status_code != 200 : # Or you will find the error (hint) in the reponse body on failure.

print

( 'Error: {}' .

format(response .

text))

5.2. API calls 31

DSMR Reader Documentation, Release 1.5.0

32 Hoofdstuk 5. API

HOOFDSTUK

6 Veelgestelde vragen (FAQ)

Inhoud •

Veelgestelde vragen (FAQ)

–

Hoe kan ik mijn applicatie bijwerken?

– –

Dropbox: Automatisch backups uploaden

Mindergas.nl: Automatisch gasmeterstanden exporteren

– – – – – –

Verbruiksnotificaties: Dagelijkse verbruiksstatistieken op je smartphone

Ik betaal voor een enkel tarief maar ik zie er twee!

Ik wil mijn elektriciteitsfasen ook inzien

Prijzen opnieuw berekenen met terugwerkende kracht Ik zie geen gasverbruik Verzoek/fout melden

6.1 Hoe kan ik mijn applicatie bijwerken?

De versie die je draait is altijd gebaseerd op de ‘laatste’ versie van de applicatie, ook wel de master branch genoemd.

Met enige regelmaat zijn er updates beschikbaar. Sinds v1.5

kun je dit ook eenvoudig controleren op de Status-pagina van de applicatie.

Waarschuwing: Voordat je bijwerkt, zorg ervoor dat je in ieder geval een recente back-up van je database hebt !

Meer informatie over back-ups kun je hier vinden .

Je kun je applicatie bijwerken door het script deploy.sh

uit te voeren, die in zich in de hoofdmap van het project bevindt. Zorg er wel voor dat je ingelogd bent als dsmr gebruiker op de terminal: ./deploy.sh

Dit zorgt ervoor dat alle wijzigingen op een juiste volgorde worden binnengehaald en toegepast. Een overzicht van wat dit uitrol-script exact doet: • GIT pull (codebase bijwerken).

• Update PIP afhankelijkheden.

• Past openstaande databasemigraties toe.

• Synchroniseert statische bestanden naar de Nginx map.

• Herlaadt de Gunicorn-applicatieserver (webinterface) en achtergrondprocessen (zoals de datalogger).

33

DSMR Reader Documentation, Release 1.5.0

• Gooit de cache leeg.

6.2 Dropbox: Automatisch backups uploaden

Hoe kan ik mijn Dropbox-account koppelen voor de backups?

Zorg allereerst dat je een Dropbox-account hebt. Ga vervolgens naar Dropbox Apps en klik op “Create app” rechtsbo venin.

Kies de volgende opties: (1) Dropbox API en (2) App folder .

Voer vervolgens een naam voor je app in (3), deze wordt ook gebruikt als naam van de submap binnen je Apps-folder in Dropbox.

34 Hoofdstuk 6. Veelgestelde vragen (FAQ)

DSMR Reader Documentation, Release 1.5.0

The app is als het goed is nu aangemaakt in developer-modus.

ken genereren door op de knop “Generate” te klikken, die Je kunt nog een toegangsto verderop onderaan de pagina staat.

6.2. Dropbox: Automatisch backups uploaden 35

DSMR Reader Documentation, Release 1.5.0

Kopieer de gegenereerde toegangstoken naar de DSMR-reader instellingen onder Dropbox-configuratie. DSMR reader zou vrij vlot gemaakte backups moeten uploaden naar je Dropbox-account.

6.3 Mindergas.nl: Automatisch gasmeterstanden exporteren

Hoe kan ik mijn mindergas.nl-account koppelen?

Zorg nu ervoor naar “ dat je Meterstand een API ” mindergas.nl-account en klik op de hebt of knop registreer onder het je op kopje hun website .

Ga “Authenticatietoken” .

36 Hoofdstuk 6. Veelgestelde vragen (FAQ)

DSMR Reader Documentation, Release 1.5.0

Kopieer de gegenereerde authenticatietoken in de DSMR-reader instellingen onder Mindergas.nl-configuratie.

Vanzelfsprekend werkt deze feature alleen wanneer er gas gemeten wordt, en wanneer je de optie ‘Exporteer gegevens naar MinderGas’ aangevinkt hebt in dezelfde configuratie.

Notitie: N.B.: Wegens het beleid van mindergas.nl is het niet toegestaan om met terugwerkende kracht meterstanden door te geven via de API. De applicatie ondersteunt dat om die reden niet. Je kunt oude meterstanden echter wel via hun website handmatig invoeren, indien gewenst.

6.4 Verbruiksnotificaties: smartphone Dagelijkse verbruiksstatistieken op je

Welke services voor het sturen van notificaties worden ondersteund?

Op dit moment worden twee platforms ondersteund: Android en iOS. De ondersteunde app voor Android is Notify MyAndroid . De ondersteunde app voor iOS is Prowl .

Hoe stel ik verbruiksnotificaties in?

Zorg ervoor dat je NotifyMyAndroid of Prowl hebt geĂŻnstalleerd op je smartphone. Als dat niet het geval is, bezoek dan de app store van je platform, download de gewenste app en maak daarvoor een account. Daarna haal je de API key voor de notificatieservice die je wilt gebruiken op. Om te lezen hoe dat werkt, lees dan de instructies bij de volgende kopjes.

In de DSMR-reader instellingen voor de Verbruiksnotificaties zet je een vinkje bij Stuur Notificaties en selecteer daaronder welke notificatieservice je wilt gebruiken. KopieeĂŤr daarna de API key van de notificatieservice en plak deze in het tekstveld voor de API key. Als je deze instellingen opslaat zul je na middernacht je eerste notificatie ontvangen. Geen nood, de notificatie wordt altijd verstuurd met lage prioriteit, deze maakt je dus niet wakker.

Hoe haal ik de API key op voor NotifyMyAndroid?

6.4. Verbruiksnotificaties: Dagelijkse verbruiksstatistieken op je smartphone 37

DSMR Reader Documentation, Release 1.5.0

Nadat je NotifyMyAndroid hebt gedownload en een account hebt aangemaakt zou je moeten kunnen inloggen op je NotifyMyAndroid-account . Ga nu naar “ My Account ” om een overzicht van je account de API keys te krijgen als je deze al hebt. Om een API key voor de DSMR-reader te genereren klik je op “Generate New Key” .

Als den er een zoals nieuwe in key is onderstaande gegenereerd, screenshot zie (er je staat deze een direct.

rood De kader key om is de te vin key).

Hoe haal ik de API key op voor Prowl?

Nadat je Prowl hebt gedownload en een account hebt aangemaakt zou je moeten kunnen Prowl-account .

Ga nu naar “ API Keys inloggen op je ” om een overzicht van je API keys te krijgen als je deze al hebt.

Om een API key voor de DSMR-reader te genereren geef je een naam op en klik je op “Generate Key” .

38 Hoofdstuk 6. Veelgestelde vragen (FAQ)

DSMR Reader Documentation, Release 1.5.0

Als den er een zoals nieuwe in key is onderstaande gegenereerd, screenshot zie (er je staat deze een direct.

rood De kader key om is de te vin key).

6.4. Verbruiksnotificaties: Dagelijkse verbruiksstatistieken op je smartphone 39

DSMR Reader Documentation, Release 1.5.0

6.5 Ik betaal voor een enkel tarief maar ik zie er twee!

DSMR (en je energieleverancier) lezen altijd zowel hoog als laag tarief van je meter uit. Het is desondanks mogelijk dat je betaalt voor slechts ĂŠĂŠn tarief. In dat geval voegt jouw energieleverancier het hoge en lage tarief samen zodat het lijkt alsof je een enkel tarief hebt.

Deze applicatie weergeeft standaard gescheiden tarieven, maar heeft wel ondersteuning om ze samen te voegen (net zoals je energieleverancier doet). Zorg er wel voor dat je dezelfde prijs invult bij hoog en laag tarief voor elektri citeit en dat je de optie Voeg tarieven samen aanzet in de interfaceconfiguratie.

6.6 Ik wil mijn elektriciteitsfasen ook inzien

Sinds DSMR-reader v1.5

is het mogelijk om je aparte optie die je zelf moet inschakelen in P+ (verbruik) elektriciteitsfasen in te zien.

Dataloggerconfiguratie .

Dit is een De instelling heet daar Houd elektriciteitsfasen bij . Zodra ingeschakeld, zal de applicatie het verbruik per fase vastleggen in tonen in een grafiek in het Dashboard.

Houd in gedachten: • Dit werkt niet met terugwerkende kracht . De datalogger gooit namelijk alle gegevens weg die niet nodig zijn.

• Deze feature werkt alleen wanneer je slimme meter ook daadwerkelijk is aangesloten op drie fasen . Zelfs wanneer de optie is ingeschakeld.

40 Hoofdstuk 6. Veelgestelde vragen (FAQ)

DSMR Reader Documentation, Release 1.5.0

• Wanneer het bijhouden van de fasen is ingeschakeld, zie je op het Dashboard een knop genaamd elektriciteitsfasen . Klik die aan om de grafiek te tonen.

Toon Je zult iets zien in de trend van:

6.7 Prijzen opnieuw berekenen met terugwerkende kracht

Ik heb zojuist mijn energieprijzen aangepast, maar ik zie geen verschil! Hoe kan ik de nieuwe prijzen doorvoeren?

Dagstatistieken worden dagelijks eenmalig gegenereerd. Het is echter wel mogelijk om deze te resetten door het volgende te doen: ./manage.py dsmr_stats_clear_statistics --ack-to-delete-my-data De applicatie verwijdert alle statistieken en genereert ze (langzaam) weer op de achtergrond. Zorg er wel voor dat alle brongegevens intact zijn.

6.8 Ik zie geen gasverbruik

Wees er allereerst zeker van dat je slimme meter uberhaupt gasverbruik registreert, en dat je een paar uur hebt gewacht.

De gasmeterstanden worden sowieso slechts een keer per uur bijgewerkt (voor DSMR v4). De Status-pagina geeft je hier overigens ook inzicht in.

6.9 Verzoek/fout melden

Hoe kan ik een verzoek indienen of een fout melden?

Zie ook: Maak een ticket aan op Github .

6.7. Prijzen opnieuw berekenen met terugwerkende kracht 41

DSMR Reader Documentation, Release 1.5.0

42 Hoofdstuk 6. Veelgestelde vragen (FAQ)

HOOFDSTUK

7 Wijzigingenoverzicht

Inhoudsopgave • – – – – – – – –

Wijzigingenoverzicht

–

Updaten

– –

v1.5.1 - 2017-01-04

v1.5.0 - 2017-01-01

– – – –

v1.4.1 - 2016-12-12

v1.4.0 - 2016-11-28 v1.3.2 - 2016-11-08 v1.3.1 - 2016-08-16 v1.3.0 - 2016-07-15

v1.2.0 - 2016-05-18 v1.1.2 - 2016-05-01 v1.1.1 - 2016-04-27 v1.1.0 - 2016-04-23

v1.0.1 - 2016-04-07 v1.0.0 - 2016-04-07 [ 𝛽 ] v0.1 (2015-10-29) to 0.16 (2016-04-06)

7.1 Updaten

Zorg er alsjeblieft voor dat je altijd een versie database back-up overigens erg eenvoudig via een ingebouwd mechanisme.

hebt, vóórdat je upgrade! Het upgraden zelf is Zie ook: • Over back-ups .

• Over update .

7.2 v1.5.1 - 2017-01-04

Notitie: Deze patch bevat geen nieuwe features en lost alleen upgrade-problemen op voor sommige gebruikers.

Tickets die opgelost zijn in deze release:

43

DSMR Reader Documentation, Release 1.5.0

• Oplossing voor tickets #200 & #217 , welke veroorzaakt worden door het niet wisselen naar de VirtualEnv voor de upgrade. In eerdere versies van de project-documentatie stond dit niet duidelijk genoeg beschreven en dat veroorzaakt deze problemen.

7.3 v1.5.0 - 2017-01-01

Waarschuwing: Wijziging in Python-ondersteuning • De ondersteuning voor Python 3.3

is vervallen wegens de Django upgrade ( #103 ).

• Er is experimentele ondersteuning voor Python 3.6

en tests momenteel ook in voor die versies worden uitgevoerd.

Python 3.7 (nightly) ( #167 ).

gezien de unit Waarschuwing: Waarschuwing voor legacy • De migraties die samengevoegd zijn in ( #31 ) zijn verwijderd . Hier heb je alleen maar te maken wanneer je nog gebruik maakt van een dsmrreader-versie vóór v0.13 ( 𝛽 ) .

• Wanneer je nog steeds een versie van vóór < v0.13 ( 𝛽 ) draait, upgrade dan eerst naar v1.4

(!), gevolgd door een upgrade naar v1.5

.

Tickets die opgelost zijn in deze release: • Verify telegrams’ CRC ( #188 ).

• Display last 24 hours on dashboard ( #164 ).

• Status page visualisation ( #172 ).

• Store and display phases consumption ( #161 ).

• Weather graph not showing when no gas data is available ( #170 ).

• Upgrade to ChartJs 2.0 ( #127 ).

• Improve Statistics page performance ( #173 ).

• Version checker at github ( #166 ).

• Remove required login for dismissal of in-app notifications ( #179 ).

• Round numbers displayed in GUI to 2 decimals ( #183 ).

• Switch Nosetests to Pytest (+ pytest-cov) ( #167 ).

• PyLama code audit (+ pytest-cov) ( #158 ).

• Double upgrade of Django framework Django 1.8

-> Django 1.9

-> Django 1.10

( #103 ).

• Force PYTHONUNBUFFERED for supervisor commands ( #176 ).

• Documentation updates for v1.5 ( #171 ).

• Requirements update for v1.5 (december 2016) ( #182 ).

• Improved backend process logging ( #184 ).

7.4 v1.4.1 - 2016-12-12

Tickets die opgelost zijn in deze release: • Consumption chart hangs due to unique_key violation ( #174 ).

44 Hoofdstuk 7. Wijzigingenoverzicht

DSMR Reader Documentation, Release 1.5.0

• NoReverseMatch at / Reverse for ‘docs’ ( #175 ).

7.5 v1.4.0 - 2016-11-28

Waarschuwing: Wijziging in Python-ondersteuning • Support for Python 3.5

has been added officially ( #55 ).

Tickets die opgelost zijn in deze release: • Push notifications for Notify My Android / Prowl (iOS), written by Jeroen Peters ( #152 ).

• Support for both single and high/low tariff ( #130 ).

• Add new note from Dashboard has wrong time format ( #159 ).

• Display estimated price for current usage in Dashboard ( #155 ).

• Dropbox API v1 deprecated in June 2017 ( #142 ).

• Improve code coverage ( #151 ).

• Restyle configuration overview ( #156 ).

• Capability based push notifications ( #165 ).

7.6 v1.3.2 - 2016-11-08

Tickets die opgelost zijn in deze release: • Requirements update (november 2016) ( #150 ).

7.7 v1.3.1 - 2016-08-16

Tickets die opgelost zijn in deze release: • CSS large margin-bottom ( #144 ).

• Django security releases issued: 1.8.14 ( #147 ).

• Requirements update (August 2016) ( #148 ).

• Query performance improvements ( #149 ).

7.8 v1.3.0 - 2016-07-15

Tickets die opgelost zijn in deze release: • API endpoint for datalogger ( #140 ).

• Colors for charts ( #137 ).

• Data export: Mindergas.nl ( #10 ).

• Requirement upgrade ( #143 ).

7.5. v1.4.0 - 2016-11-28 45

DSMR Reader Documentation, Release 1.5.0

• Installation wizard for first time use ( #139 ).

7.9 v1.2.0 - 2016-05-18

Tickets die opgelost zijn in deze release: • Energy supplier prices does not indicate tariff type (Django admin) ( #126 ).

• Requirements update ( #128 ).

• Force backup ( #123 ).

• Update clean-install.md ( #131 ).

• Improve data export field names ( #132 ).

• Display average temperature in archive ( #122 ).

• Pie charts on trends page overlap their canvas ( #136 ).

• ‘Slumber’ consumption ( #115 ).

• Show lowest & highest Watt peaks ( #138 ).

• Allow day & hour statistics reset due to changing energy prices ( #95 ).

7.10 v1.1.2 - 2016-05-01

Tickets die opgelost zijn in deze release: • Trends page giving errors (when lacking data) ( #125 ).

7.11 v1.1.1 - 2016-04-27

Tickets die opgelost zijn in deze release: • Improve readme ( #124 ).

7.12 v1.1.0 - 2016-04-23

Tickets die opgelost zijn in deze release: • Autorefresh dashboard ( #117 ).

• Improve line graphs’ visibility ( #111 ).

• Easily add notes ( #110 ).

• Export data points in CSV format ( #2 ).

• Allow day/month/year comparison ( #94 ).

• Docs: Add FAQ and generic application info ( #113 ).

• Support for Iskra meter (DSMR 2.x) ( #120 ).

46 Hoofdstuk 7. Wijzigingenoverzicht

DSMR Reader Documentation, Release 1.5.0

7.13 v1.0.1 - 2016-04-07

Tickets die opgelost zijn in deze release: • Update licence to OSI compatible one ( #119 ).

7.14 v1.0.0 - 2016-04-07

• Eerste officiële stabiele release.

7.15 [

𝛽

] v0.1 (2015-10-29) to 0.16 (2016-04-06)

Notitie: Alle vorige bèta releases/veranderingen zijn gecombineerd tot een enkele lijst hieronder.

• Move documentation to wiki or RTD ( #90 ).

• Translate README to Dutch ( #16 ).

• Delete (recent) history page ( #112 ).

• Display most recent temperature in dashboard ( #114 ).

• Upgrade Django to 1.8.12 ( #118 ).

• Redesign trends page ( #97 ).

• Support for summer time ( #105 ).

• Support for Daylight Saving Time (DST) transition ( #104 ).

• Add (error) hints to status page ( #106 ).

• Keep track of version ( #108 ).

• Django 1.8.11 released ( #82 ).

• Prevent tests from failing due to moment of execution ( #88 ).

• Statistics page meter positions are broken ( #93 ).

• Archive only shows graph untill 23:00 (11 pm) ( #77 ).

• Trends page crashes due to nullable fields average ( #100 ).

• Trends: Plot peak and off-peak relative to each other ( #99 ).

• Monitor requirements with requires.io ( #101 ).

• Terminology ( #41 ).

• Obsolete signals in dsmr_consumption ( #63 ).

• Individual app testing coverage ( #64 ).

• Support for extra devices on other M-bus (0-n:24.1) ( #92 ).

• Separate post-deployment commands ( #102 ).

• Show exceptions in production (webinterface) ( #87 ).

• Keep Supervisor processes running ( #79 ).

7.13. v1.0.1 - 2016-04-07 47

DSMR Reader Documentation, Release 1.5.0

• Hourly stats of 22:00:00+00 every day lack gas ( #78 ).

• Test Travis-CI with MySQL + MariaDB + PostgreSQL ( #54 ).

• PostgreSQL tests + nosetests + coverage failure: unrecognized configuration parameter “foreign_key_checks” ( #62 ).

• Performance check ( #83 ).

• Allow month & year archive ( #66 ).

• Graphs keep increasing height on tablet ( #89 ).

• Delete StatsSettings(.track) settings model ( #71 ).

• Drop deprecated commands ( #22 ).

• Datalogger doesn’t work properly with DSMR 4.2 (KAIFA-METER) ( #73 ).

• Dashboard month statistics costs does not add up ( #75 ).

• Log unhandled exceptions and errors ( #65 ).

• Datalogger crashes with IntegrityError because ‘timestamp’ is null ( #74 ).

• Trends are always shown in UTC ( #76 ).

• Squash migrations ( #31 ).

• Display ‘electricity returned’ graph in dashboard ( #81 ).

• Optional gas (and electricity returned) capabilities tracking ( #70 ).

• Add ‘electricity returned’ to trends page ( #84 ).

• Archive: View past days details ( #61 ).

• Dashboard: Consumption total for current month ( #60 ).

• Check whether gas readings are optional ( #34 ).

• Django security releases issued: 1.8.10 ( #68 ).

• Notes display in archive ( #69 ).

• Status page/alerts when features are disabled/unavailable ( #45 ).

• Integrate Travis CI ( #48 ).

• Testing coverage ( #38 ).

• Implement automatic backups & Dropbox cloud storage ( #44 ).

• Link code coverage service to repository ( #56 ).

• Explore timezone.localtime() as replacement for datetime.astimezone() ( #50 ).

• Align GasConsumption.read_at to represent the start of hour ( #40 ).

• Cleanup unused static files ( #47 ).

• Investigated mysql_tzinfo_to_sql — Load the Time Zone Tables ( #35 ).

• Make additional DSMR data optional ( #46 ).

• Localize graph x-axis ( #42 ).

• Added graph formatting string to gettext file ( #42 ).

• Different colors for peak & off-peak electricity ( #52 ).

48 Hoofdstuk 7. Wijzigingenoverzicht

DSMR Reader Documentation, Release 1.5.0

• Admin: Note widget ( #51 ).

• Allow GUI to run without data ( #26 ).

• Moved project to GitHub ( #28 ).

• Added stdout to dsmr_backend to reflect progress.

• Restore note usage in GUI ( #39 ).

• Store daily, weekly, monthly and yearly statistics ( #3 ).

• Improved Recent History page performance a bit. (as result of #3 ) • Updates ChartJS library tot 1.1, disposing django-chartjs plugin. Labels finally work! (as result of #3 ) • Added trends page. (as result of #3 ) • Recent history setting: set range ( #29 ).

• Mock required for test: dsmr_weather.test_weather_tracking ( #32 ).

• Massive refactoring: Separating apps & using signals ( #19 ).

• README update: Exit character for cu ( #27 , by Jeroen Peters).

• Fixed untranslated strings in admin interface.

• Upgraded Django to 1.8.9.

7.15. [

𝛽 ] 𝑣 0 .

1(2015 − 10 − 29) 𝑡𝑜 0 .

16(2016 − 04 − 06)

49

DSMR Reader Documentation, Release 1.5.0

50 Hoofdstuk 7. Wijzigingenoverzicht

HOOFDSTUK

8 Bijdrage leveren

Wil je bijdragen aan dit project? Kijk dan hieronder hoe je kunt helpen.

8.1 Feedback

Het maakt niet uit of je ergens tegenaan loopt of gewoon in contact wil komen, vraag maar raak!

Zie ook: Maak op Github een ticket aan met je vraag of opmerking .

8.2 Pull requests

Pull requests worden gewaardeerd, maar wees ervan bewust dat je wijzigingen het beste eerst kunt bespreken op Github via een ticket. Het zou zonde zijn wanneer je namelijk tijd steekt in iets wat achteraf niet gemerged wordt.

Tot slot, zorg ervoor dat pull requests altijd naar de development branch wijzen en niet de master .

51

DSMR Reader Documentation, Release 1.5.0

52 Hoofdstuk 8. Bijdrage leveren

9.1 Bijzondere dank voor de code-bijdragen van

• Jeroen Peters

9.2 Dank voor de bijdrages van

Getoond in willekeurige belangrijkheid, gesorteerd op naam.

• Bert-Jan Vos • Daniel ter Horst • Gert Schaafsma • Hans-Paul Hemelaar • Jelte Leijenaar • Jeroen Tielen • Koen Volleberg • Paul Vinken • Sander de Leeuw • Sevickson • “ WatskeBart “

9.3 Software

Houd rekening met eventuele licenties/restricties van deze software, wanneer van toepassing.

• Raspbian • Django Project • Django Solo • Django Colorfield • Supervisor

HOOFDSTUK

9 Credits

53

DSMR Reader Documentation, Release 1.5.0

• MySQL • MariaDB • PostgreSQL • Director Responsive Admin • Favicon • Bootstrap-datepicker • Github • TravisCI • Codecov • Read The Docs • MW • Full Page Screen Capture • Buienradar

9.4 Overig

Dutch Smart Meter reading specifications, data cables, examples and hints: • Gé Janssen • Joost van der Linde (smartmeterdashboard) • SOS Solutions • Nico Di Rocco

54 Hoofdstuk 9. Credits

HOOFDSTUK

10 Licentie (GNU GPLv3)

Copyright (C) 2015/2016 Dennis Siemensma Licence •

Licentie (GNU GPLv3)

–

GNU GENERAL PUBLIC LICENSE

– *

Preamble TERMS AND CONDITIONS

* * * *

0. Definitions.

1. Source Code.

2. Basic Permissions.

3. Protecting Users’ Legal Rights From Anti-Circumvention Law.

* * * *

4. Conveying Verbatim Copies.

5. Conveying Modified Source Versions.

6. Conveying Non-Source Forms.

7. Additional Terms.

* * * * * *

8. Termination.

9. Acceptance Not Required for Having Copies.

10. Automatic Licensing of Downstream Recipients.

11. Patents.

12. No Surrender of Others’ Freedom.

13. Use with the GNU Affero General Public License.

14. Revised Versions of this License.

* * * *

15. Disclaimer of Warranty.

16. Limitation of Liability.

17. Interpretation of Sections 15 and 16.

10.1 GNU GENERAL PUBLIC LICENSE

GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. < http://fsf.org/ > Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

55

DSMR Reader Documentation, Release 1.5.0

10.1.1 Preamble

The GNU General Public License is a free, copyleft license for software and other kinds of works.

The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program–to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.

When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.

To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights.

Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.

For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.

Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.

For the developers’ and authors’ protection, the GPL clearly explains that there is no warranty for this free software.

For both users’ and authors’ sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.

Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users’ freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.

Finally, every program is threatened constantly by software patents. States should not allow patents to restrict develop ment and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.

The precise terms and conditions for copying, distribution and modification follow.

10.2 TERMS AND CONDITIONS 10.2.1 0. Definitions.

“This License” refers to version 3 of the GNU General Public License.

“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.

“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”.

“Licensees” and “recipients” may be individuals or organizations.

To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.

56 Hoofdstuk 10. Licentie (GNU GPLv3)

DSMR Reader Documentation, Release 1.5.0

A “covered work” means either the unmodified Program or a work based on the Program.

To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy.

Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.

To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interac tion with a user through a computer network, with no transfer of a copy, is not conveying.

An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.

10.2.2 1. Source Code.

The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.

A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.

The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implemen tation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.

The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activi ties. However, it does not include the work’s System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.

The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.

The Corresponding Source for a work in source code form is that same work.

10.2.3 2. Basic Permissions.

All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program.

The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.

You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or

10.2. TERMS AND CONDITIONS 57

DSMR Reader Documentation, Release 1.5.0

running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.

Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.

10.2.4 3. Protecting Users’ Legal Rights From Anti-Circumvention Law.

No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.

When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work’s users, your or third parties’ legal rights to forbid circumvention of technological measures.

10.2.5 4. Conveying Verbatim Copies.

You may convey verbatim copies of the Program’s source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.

You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.

10.2.6 5. Conveying Modified Source Versions.

You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date.

b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.

c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy.

This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.

d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.

A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation’s users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.

10.2.7 6. Conveying Non-Source Forms.

You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:

58 Hoofdstuk 10. Licentie (GNU GPLv3)

DSMR Reader Documentation, Release 1.5.0

a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accom panied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.

b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accom panied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.

c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source.

This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.

d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.

e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.

A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.

A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling.

In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.

“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.

If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).

The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.

Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.

10.2. TERMS AND CONDITIONS 59

DSMR Reader Documentation, Release 1.5.0

10.2.8 7. Additional Terms.

“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.

When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.

Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Approp riate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or mo dified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.

All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.

If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.

Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.

10.2.9 8. Termination.

You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).

However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.

Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.

60 Hoofdstuk 10. Licentie (GNU GPLv3)

DSMR Reader Documentation, Release 1.5.0

Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.

10.2.10 9. Acceptance Not Required for Having Copies.

You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.

10.2.11 10. Automatic Licensing of Downstream Recipients.

Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.

An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or sub dividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party’s predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.

You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.

10.2.12 11. Patents.

A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor’s “contributor version”.

A contributor’s “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.

Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor’s essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.

In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringe ment). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.

If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients.

10.2. TERMS AND CONDITIONS 61

DSMR Reader Documentation, Release 1.5.0

“Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient’s use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.

If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.

A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License.

You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.

Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringe ment that may otherwise be available to you under applicable patent law.

10.2.13 12. No Surrender of Others’ Freedom.

If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.

10.2.14 13. Use with the GNU Affero General Public License.

Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.

10.2.15 14. Revised Versions of this License.

The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.

Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.

If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy’s public statement of acceptance of a version permanently authorizes you to choose that version for the Program.

62 Hoofdstuk 10. Licentie (GNU GPLv3)

DSMR Reader Documentation, Release 1.5.0

Later license versions may give you additional or different permissions. However, no additional obligations are impo sed on any author or copyright holder as a result of your choosing to follow a later version.

10.2.16 15. Disclaimer of Warranty.

THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.

EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMP LIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

10.2.17 16. Limitation of Liability.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY CO PYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCI DENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PRO GRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

10.2.18 17. Interpretation of Sections 15 and 16.

If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.

END OF TERMS AND CONDITIONS

10.2. TERMS AND CONDITIONS 63