Effortlessly connect and monitor your Landis+Gyr E360 Energy Meter using this Python library. Utilizing the H1 serial port to read telegrams and Home Assistant MQTT Discovery, integrate your energy meter seamlessly with Home Assistant and enjoy insight into your energy bill.
- Monitor OBIS codes: Read the OBIS codes provided by the H1 serial port, and publish to MQTT.
- Handle unidentified OBIS codes: Log the unidentified OBIS codes to stdout.
- Home Assistant Energy Dashboard: Provide the datapoints Home Assistant's Energy Dashboard needs to visualize energy consumption.
To install the library, clone the repository and create a symbolic link to your Python library directory:
git clone https://github.com/slespersen/lge360MQTT.git
ln -s $(pwd)/lge360MQTT /path/to/your/python/site-packages/lge360MQTT
main.py
is provided for running the library. Below are the arguments it accepts:
--serial_port
: (Optional) Serial port for the meter. Default is: /dev/ttyUSB0--baudrate
: (Optional) Baud rate for serial communication. Default is: 115200.--bytesize
: (Optional) Byte size for serial communication. Default is: 8.--parity
: (Optional) Parity for serial communication. Default is: N.--stopbits
: (Optional) Stop bits for serial communication. Default is: 1.--mqtt_broker
: (Required) MQTT broker address.--mqtt_port
: (Optional) MQTT broker port. Default is: 1883.--mqtt_topic
: (Optional) MQTT topic. Default is: landisgyr_e360.
Here’s a quick example to get you started:
sh
python main.py --mqtt_broker 169.254.1.45 --mqtt_port 1883
A systemd service file is provided to enable the script to be run as a service.
Remember to update the variables, according to your setup.
sudo cp lge360MQTT.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable lge360MQTT.service
This project is licensed under the MIT License.
Contributions are welcome! Please feel free to submit a pull request or open an issue.
For any questions or issues, please open an issue.