HUB
Sign inSign up

mrbdev/dockerlechacalhomeassistant

By mrbdev

•Updated over 5 years ago

Image
0

364

mrbdev/dockerlechacalhomeassistant repository overview

⁠A Docker based Home Assistant interface for LeChacal.com's RPICT's Energy Monitoring Sensors

Docker Hub: gtricot/lechacal-mqtt:latest⁠

License: GPL v3 Docker Pulls buildx


This project is a simple lightweight docker container, designed to read data from the LeChacal Energy Monitoring PCB's and then transmit data to a Home Assistant⁠ server (via MQTT) as part of a wider energy monitoring solution...

The program ** should ** support all LeChacal devices that communicate via Serial, however at the time of writing I only have a RPICT7V1_v3.0 to test it on.

Lastly, the use of a CT Clamp's to monitor energy consumption on your individual circuits, is a great addition to a fully featured smart home, and the Voltronic HA Solar Monitor⁠ (if you are running this also).


The program is designed to be run in a Docker Container, and can be deployed on a Raspberry PI, inside your breaker box, using a DIN rail mount such as the Modulbox, from Italtronic⁠.

⁠Supported LeChacal PCB's

  • RPICT3V1 - 3 CT 1 Voltage.
  • RPICT3T1 - 3 CT 1 Temperature
  • RPICT4V3_v2.0 - 4 CT 3 AC Voltage.
  • RPICT7V1_v2.0 - 7 CT 1 AC Voltage.
  • RPICT8 - 8 CT

Note, if your device is not listed here you can create a json mapping file - Please look at the examples in the src/device-mapping directory.

⁠Prerequisites

You may need to configure your Raspberry PI's /boot/config.txt file like so:

[all]
enable_uart=1
uart_enable=yes

And disable the Serial Console output using the raspi-config tool.

⁠Usage

Run the official Docker image (amd64, armv6, armv7, arm64).

⁠Run
docker run -d --name lechacal-mqtt       \
    --device=/dev/ttyAMA0:/dev/ttyAMA0      \ # add serial port device from host
    - e MQTT_URL=mqtt://my_mqtt_broker:1883 \ # set mqtt broker url
    gtricot/lechacal-mqtt
⁠Configure

Configuration uses environment variables.

Env varDescriptionDefault value
LOG_LEVELLog level (INFO, DEBUG, ERROR)INFO
SERIALSerial Port location/dev/ttyAMA0
BAUD_RATESerial Port Baud Rate38400
DEVICE_MAPPINGLechacal Device mapping fileRPICT7V1.json
FRACTION_DIGITSFraction digits used when rounding sensor values2
INVERT_NEGATIVE_VALUESIf true, negative values are inverted (no clamp invert needed)false
SENSOR_VALUE_THRESHOLDSensor values inferior to threshold are set to 0 (noise reduction)0
MQTT_URLMQTT Broker connection URLmqtt://localhost:1883
MQTT_USERMQTT user (optional)
MQTT_PASSWORDMQTT password (optional)
IDENTIFIERIdentifier for Home-Assistant Discoverylechacal
DISCOVERY_PREFIXTopic prefix for Home-Assistant Discoveryhomeassistant

Note:

  • builds on docker hub are currently for linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/amd64 -- If you have issues standing up the image on your Linux distribution (i.e. An old Pi/ARM device) you may need to manually build the image to support your local device architecture - This can be done by uncommenting the build flag in your docker-compose.yml file.

⁠Integrating into Home Assistant.

Providing you have setup MQTT⁠ with Home Assistant, the device will automatically register in your Home Assistant when the container starts for the first time -- You do not need to manually define any sensors.

From here you can setup Graphs⁠ and regular text value sensors to display sensor data.

Tag summary
Recent tags
Content type
Image
Digest
Size
108.7 MB
Last updated
over 5 years ago
docker pull mrbdev/dockerlechacalhomeassistant:latest