I have a Kamstrup meter for my hot water and heating.
On the internet i found a project to read these devices: IR-øje til Kamstrup og andre målere [Hal9k's wiki] (it’s in danish, Google translate works).
I have ordered some PCB’s in china, and assembled these.
On Github i found a python script to read the device, i only have no idea how to implement this into my HA.
As far I can see, python script on each run get the value, and store it in InfluxDB if line before last is uncommented, and publish it to MQTT if last line is uncommented.
Simplest solution will be run script periodically via cron, and get value from MQTT sensor.
Changed rule 162 from
def init(self, serial_port):
to
def init(self, serial_port = “/dev/ttyUSB1”):
So the port is fixed, and not have to be set on commandline…
I found out i can run scripts for testing from developer tools > services. When i run the script i will get a error:
Logger: homeassistant.components.python_script
Source: components/python_script/__init__.py:154
Integration: Python Scripts ([documentation](https://www.home-assistant.io/integrations/python_script), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+python_script%22))
First occurred: 6:34:05 PM (2 occurrences)
Last logged: 6:48:18 PM
Error loading script kamstrup.py: Line 357: "__name__" is an invalid variable name because it starts with "_"