PHP program for read the power counter customer information.
- Upgrade to Symfony 5.4 components
- Drop the InfluxDB support
- PHP 7.8+
- PHP SQLite extension
- composer 2
- The serial port of the power counter connected at your computer.
The power counter have an serial port for the customer. You can connect this serial port to you computer with an small card.
This schema of the small card is descibed into the ERDF documentation.
You need buy the components and build it before continue the installation of this program.
Clone the project or download the tarball.
Open terminal and execute :
$ php composer.phar install --no-dev -o
Make the configuration file into the destination folder.
$ touch config.yml
The compteur
key is the model of your electric counter. Only CBEMM
and CBETM
supported now.
For
linky
counter, useCBEMM
and ask the legacy mode configuration to ERDF.
The device
key is the path to the serial device socket.
compteur: CBEMM
device: /dev/ttyAMA0
By default, the storage is SQLite into data.sqlite
file.
In the terminal :
$ ./telereleve
Open terminal and execute :
$ php composer.phar install -o
$ ./run-unit
compteur: CBEMM #this value is by default
device: /dev/ttyAMA0 # this value is the GPIO serial port for the Raspberry Pi
storage:
driver: Sqlite # This is the default value. Another storage supported is 'InfluxDb'.
parameters: # This is the default value. This constains arbitrary array configuration key for the driver.
path: datas.sqlite
# Parameters array for Chain storage driver :
driver: Chain
parameters:
storages: # set all storage here. You can set many storage with same driver
sqlite: # the key for driver. Is used on error. This array contains the driver configuration.
driver: Sqlite
parameters:
path: datas.sqlite
skip_on_storage_error: false # if true, no error stop the save process. If one storage is on error, the error is ignored.
enable_email: false # By default, the email sending is disabled.
template: default.text.twig # The name file for default template for email body content.
log_file: telereleve.log # The file log
smtp:
server: 127.0.0.1
port: 25
security: null
username: null
password: null
mime: text/plain
from:
display_name: TeleReleve
email: me@localhost
to:
display_name: Me
email: me@localhost