Alle Artikel von admin

SmartPi Use

Connect the SmartPi following scheme in order to transform your Raspberry Pi into a full functional smart meter:

smartpi_schemata

Please note: The arrow on the current sensor shows the current flow in production direction. If the sensor is applied conversely, consumption appears negative. Turn the sensor or change the value of change_current_direction in the configuration file from 0 to 1.

2016-09-30-beschriftung_smartpi_seite_klein

Connection for split core current sensors

2016-09-30-beschriftung_smartpi_vorne_klein

Connection for voltage measurement

Danger. Please note that only persons with the appropriate training and expertise are allowed to connect the voltage measurement. Work on mains voltage is very dangerous.

All other can change the value of measure_voltage to 0 and set the value voltage manually.

After installation type http://<ipaddress:1080> in your web browser.
You see the startpage with actual values and a linechart of power distribution.

Screenshot of SmartPi webpage

 

Configuration file:

The configuration of the SmartPi is stored in the file /etc/smartpi and looks like the following:

Description:

serial Serial number of SmartPi (will be send in JSON-File)
name Name of SmartPi (will be send in JSON-File)
lat, lng Location (will be send in JSON-File)
[database]
dir, file
Path and location of the integrated rrd database
i2c_device Device of the I2C
shared_dir, shared_file Location of the file for sharing actual values to other processes
power_frequency Frequency of the grid (important for right values)
measure_voltage If it is 1 the voltage will be measured. If it is 0 the SmartPi uses the listed voltage in [voltage]
change_current_direction If the value is 1 the power measurement will be inverted
 ftp_upload If value is 1 ftp upload of csv-file is enabled. If value is 0 the program will do nothing.
ftp_server, ftp_user, ftp_pass Login details from the ftp-server. (for later use)
ftp_path Directory path for the SmartPi csv files. The last directory is the serial number.
[csv]
decimalpoint, timeformat 
Set the decimal separator and timeformat for the csv file.
 port Port of the integrated webserver
 docroot Document root of the integrated webserver
[umts] Huawei E3131 supported
umts 1=active
umts_apn APN 
umts_pin Your PIN
umts_username APN username 
umts_password APN password

SmartPi API

With the integrated RESTful-service it is possible to connect the SmartPi and read out all relevant values. The webinterface of the SmartPi uses also the REST-API.

Actual Values:
For example type http://<ipaddress:1080>/api/all/all/now in your webbrowser to get all actual values.

The structure of the URL looks like: http://<ipaddress>:<port>/api/<phaseid>/<valueid>/now

Allowed parameters for valueid:

current Current [A] (available for phase 1,2,3, neutral conductor)
voltage Voltage [V] (available for phase 1,2,3)
power Power [W]  (available for phase 1,2,3)
cosphi cos φ  (available for phase 1,2,3 –  it is important to measure the voltage)
frequency Frequency [Hz]  (available for phase 1,2,3)
all Get all Values

 

Allowed parameters for phaseid:

1 Phase 1
2 Phase 2
3 Phase 3
4 only for use with valueid current (current of  neutral conductor)
all All phases

 

Historical and chart data:
The REST-API can also serve historical data.
For example http://<ipaddress:1080>/api/chart/123/power/from/2016-09-29T00:00:00.000Z/to/2016-09-29T14:00:00.000Z gives you all measured values of power

from September 29,2016 between 0.00 a.m and 2.00 p.m.

The structure of the URL looks like: http://<ipaddress>:<port>/api/chart/<phaseid>/<valueid>

Allowed parameters for valueid:

current Current [A] (available for phase 1,2,3, neutral conductor)
voltage Voltage [V] (available for phase 1,2,3)
power Power [W]  (available for phase 1,2,3)
cosphi cos φ  (available for phase 1,2,3 –  it is important to measure the voltage)
energy_pos Energy [Wh] (energy consumption)
energy_neg  Energy [Wh] (energy production)

 

Allowed parameters for phaseid:

1 Phase 1
2 Phase 2
3 Phase 3
4 only for use with valueid current (current of  neutral conductor)
123 All phases