Closed madradrakie closed 1 year ago
Hi, Are you sure that your meter is "awake"? You can do so by pressing the button. It will remain active for 30 minutes and remains active if a valid IR signal is received.
From: madradrakie @.> Sent: Wednesday, October 5, 2022 9:36:54 PM To: matthijsvisser/kamstrup-402-mqtt @.> Cc: Subscribed @.***> Subject: [matthijsvisser/kamstrup-402-mqtt] Cannot extract meter value - Kamstrup Multical 401 (Issue #7)
I hope you vcan help me. I have a Kamstrup Multical 401 and trying to use your script. I have tried to place de IR head at every possible way at the meter but the following warning keeps appearing. In MQTT i see the topic but no values.
[2022-10-05 21:27:18 daemon.py init: 41 - INFO - initializing daemon] [2022-10-05 21:27:18 mqtt_handler.py connect: 43 - INFO - Connected to MQTT at: 192.168.2.98:1883] [2022-10-05 21:27:18 mqtt_handler.py connect: 45 - INFO - with username pi, QoS level = 1 and retain = False] [2022-10-05 21:27:18 kamstrup_meter.py close: 126 - DEBUG - Closed serial port] [2022-10-05 21:27:18 kamstrup_meter.py open: 118 - DEBUG - Opened serial port] [2022-10-05 21:27:20 kamstrup_meter.py rd: 131 - DEBUG - Rx timeout] [2022-10-05 21:27:20 kamstrup_meter.py readparameter: 198 - WARNING - No response from meter] [2022-10-05 21:27:22 kamstrup_meter.py rd: 131 - DEBUG - Rx timeout] [2022-10-05 21:27:22 kamstrup_meter.py readparameter: 198 - WARNING - No response from meter] [2022-10-05 21:27:24 kamstrup_meter.py rd: 131 - DEBUG - Rx timeout] [2022-10-05 21:27:24 kamstrup_meter.py readparameter: 198 - WARNING - No response from meter] [2022-10-05 21:27:26 kamstrup_meter.py rd: 131 - DEBUG - Rx timeout] [2022-10-05 21:27:26 kamstrup_meter.py readparameter: 198 - WARNING - No response from meter] [2022-10-05 21:27:26 kamstrup_meter.py close: 126 - DEBUG - Closed serial port] [2022-10-05 21:27:26 mqtt_handler.py publish: 55 - INFO - Publishing 'kamstrup/values' '{}' to 192.168.2.98:1883] [2022-10-05 21:27:26 daemon.py run: 84 - INFO - Waiting 1 minute(s) for the next meter readout]
This is my configuration file:
mqtt: host: 192.168.2.98 port: 1883 client: kamstrup402 topic: kamstrup qos: 1 retain: False authentication: True username: pi password: a1connect! serial_device: com_port: /dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0 kamstrup: parameters:
i hope anyone has an idea what i am doing wrong. Thanks in advance.
— Reply to this email directly, view it on GitHubhttps://github.com/matthijsvisser/kamstrup-402-mqtt/issues/7, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AK4J3SUCARZUZNJO7PEGTJLWBXKFNANCNFSM6AAAAAAQ53QGB4. You are receiving this because you are subscribed to this thread.Message ID: @.***>
hi matthijs. before i activate the script i press the button on the meter. i assume the 401 is working the same as the 402. i have tried for an hour to find the sweet spot but still no luck. it is also very hard to determine if the IR leds of the head are alligned perfectly
You can try the official software from kamstrup to verify if the meter will respond to those commands
See https://www.kamstrup.com/nl-nl/warmteoplossingen/slimme-warmtemeters/meter-software
You can try the official software from kamstrup to verify if the meter will respons to those commands
See https://www.kamstrup.com/nl-nl/warmteoplossingen/slimme-warmtemeters/meter-software
Op wo 5 okt. 2022 21:45 schreef madradrakie @.***>:
hi matthijs. before i activate the script i press the button on the meter. i assume the 401 is working the same as the 402. i have tried for an hour to find the sweet spot but still no luck. it is also very hard to determine if the IR leds of the head are alligned perfectly
— Reply to this email directly, view it on GitHub https://github.com/matthijsvisser/kamstrup-402-mqtt/issues/7#issuecomment-1268885487, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK4J3SV2ORAOBV5QSAMRRMTWBXLGLANCNFSM6AAAAAAQ53QGB4 . You are receiving this because you commented.Message ID: @.***>
i have tried the official software but my meter, the kamstrup 401 is not listed. It starts with the 402. I'am really curious if someone has managed to get it working because thereis a sensor eye present on the 401.
I did have the same problem, but after reading the manual I found out that the communication is different between a M402 and M401. At the moment I can read the values from the meter (m401), but I'm still looking into the possibility to send it via Mqtt (no great coder myself). Maybe you can adapt (USB port) and try this bit of code if your IR is placed correctly and is working?:
` import serial from time import sleep
mc401 = serial.Serial(port='/dev/ttyUSB1', bytesize=serial.SEVENBITS, parity=serial.PARITY_EVEN, stopbits=serial.STOPBITS_ONE, timeout=2)
mc401.baudrate = 300 mc401.write(bytes("/#1", 'UTF-8')) mc401.flush() sleep(1) mc401.baudrate = 1200 mc401.flushInput() data = mc401.read(87).split() try: print(data[0], data[1], data[3], data[4], data[5], data[6], data[7]) except IndexError: pass `
The main problem that I encountered is that you must send a signal at 300 baudrate, but you can only receive at 1200 baudrate. I have used the signal /#1 as this gives back energy, volume, temp1, temp2, tempdiff.
hello matthijs. Nico to read that you got it working. Can you tell me what you mean by adapt and at which place i should place the code? The IR reader is connected with a raspberry pi. I am still learning everyday :-)
I have same issue with MutliCAL 602. It should be using same protocol "KMP" but it is just echoing the same values I'm sending to it. Any idea? It works fine with kamstrup official tools, but they are windows tools so I cannot use them :(
Hi,
I don't have the 602, so unfortunately I cant help you with that. But here are my thoughts:
If you receive the exact same message as the code sends, than its possible that you having issues with reflections. Which IR head are you using? You can try to put some paper between the IR head and the meter to diffuse the light a little. Or try some more positions with the meter head. When I was testing the code, I experienced that the official tooling was able to handles more 'noise' than my code.
Thanks for the info. I actually noticed that it is echoing the data even if it is not sitting on the kamstrup meter? Should the script wait little before reading the data or maybe flush before reading 🤔Laith…On 7 Dec 2022, at 21.46, Matthijs @.***> wrote: Hi, I don't have the 602, so unfortunately I cant help you with that. But here are my thoughts: If you receive the exact same message as the code sends, than its possible that you having issues with reflections. Which IR head are you using? You can try to put some paper between the IR head and the meter to diffuse the light a little. Or try some more positions with the meter head. When I was testing the code, I experienced that the official tooling was able to handles more 'noise' than my code.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>
I have a similar problem.
We have a Kamstrup MultiCAL 66C. According to the specifications, it works with: 300 baud req /300 baud reply, 1 start bit, 7 data bits, equal parity, 2 stop bits.
How can I change this because if I change this in kamstrup_meter.py to baud rate = 300, parity = serial.PARITY_EVEN, bytesize = serial.SEVENBITS,
I get this error within 4 seconds :
Traceback (most recent call last):
File "/tmp/test/kamstrup-402-mqtt/daemon.py", line 92, in
What do I need to change to make the communication work properly?
It looks like you don't receive any data from the meter since the received Message array is empty.
You are using an invalid parameter name. See https://pyserial.readthedocs.io/en/latest/pyserial_api.html
It should be serial.sevenbits.
From: Obelix74Git @.> Sent: Friday, December 16, 2022 10:13:47 PM To: matthijsvisser/kamstrup-402-mqtt @.> Cc: Matthijs @.>; Comment @.> Subject: Re: [matthijsvisser/kamstrup-402-mqtt] Cannot extract meter value - Kamstrup Multical 401 (Issue #7)
Sorry verkeerde error. This is the correct error.
Traceback (most recent call last): File "/opt/test/kamstrup-402-mqtt/daemon.py", line 92, in main() File "/opt/test/kamstrup-402-mqtt/daemon.py", line 88, in main daemon = KamstrupDaemon() File "/opt/test/kamstrup-402-mqtt/daemon.py", line 69, in init self.heat_meter = kamstrup(serial_cfg["com_port"], kamstrup_cfg["parameters"]) File "/opt/test/kamstrup-402-mqtt/kamstrup_meter.py", line 97, in init bytesize = serial.SEVENTBITS, AttributeError: module 'serial' has no attribute 'SEVENTBITS'
— Reply to this email directly, view it on GitHubhttps://github.com/matthijsvisser/kamstrup-402-mqtt/issues/7#issuecomment-1355617360, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AK4J3SUNSEYUU66QVUD3IFDWNTLQXANCNFSM6AAAAAAQ53QGB4. You are receiving this because you commented.Message ID: @.***>
Did you guys get this working? I have a 401, and put the meter over the reader at the bottom right. It seems to be seated properly, and tried all kinds of positions, but no reading. I also clicked the enter/play button on the reader.
For info I am using this reader, as it was suggested by someone. It should be working I think? https://www.aliexpress.com/item/1005003509520122.html
Did you guys get this working? I have a 401, and put the meter over the reader at the bottom right. It seems to be seated properly, and tried all kinds of positions, but no reading. I also clicked the enter/play button on the reader.
For info I am using this reader, as it was suggested by someone. It should be working I think? https://www.aliexpress.com/item/1005003509520122.html
Hello Alekslyse. I got it working with for the 401 meter. I used the following code: https://github.com/matthijsberk/M401-irreader See for more information: https://github.com/matthijsberk/M401-irreader/issues/2
I hope you vcan help me. I have a Kamstrup Multical 401 and trying to use your script. I have tried to place de IR head at every possible way at the meter but the following warning keeps appearing. In MQTT i see the topic but no values.
[2022-10-05 21:27:18 daemon.py init: 41 - INFO - initializing daemon] [2022-10-05 21:27:18 mqtt_handler.py connect: 43 - INFO - Connected to MQTT at: 192.168.2.98:1883] [2022-10-05 21:27:18 mqtt_handler.py connect: 45 - INFO - with username pi, QoS level = 1 and retain = False] [2022-10-05 21:27:18 kamstrup_meter.py close: 126 - DEBUG - Closed serial port] [2022-10-05 21:27:18 kamstrup_meter.py open: 118 - DEBUG - Opened serial port] [2022-10-05 21:27:20 kamstrup_meter.py rd: 131 - DEBUG - Rx timeout] [2022-10-05 21:27:20 kamstrup_meter.py readparameter: 198 - WARNING - No response from meter] [2022-10-05 21:27:22 kamstrup_meter.py rd: 131 - DEBUG - Rx timeout] [2022-10-05 21:27:22 kamstrup_meter.py readparameter: 198 - WARNING - No response from meter] [2022-10-05 21:27:24 kamstrup_meter.py rd: 131 - DEBUG - Rx timeout] [2022-10-05 21:27:24 kamstrup_meter.py readparameter: 198 - WARNING - No response from meter] [2022-10-05 21:27:26 kamstrup_meter.py rd: 131 - DEBUG - Rx timeout] [2022-10-05 21:27:26 kamstrup_meter.py readparameter: 198 - WARNING - No response from meter] [2022-10-05 21:27:26 kamstrup_meter.py close: 126 - DEBUG - Closed serial port] [2022-10-05 21:27:26 mqtt_handler.py publish: 55 - INFO - Publishing 'kamstrup/values' '{}' to 192.168.2.98:1883] [2022-10-05 21:27:26 daemon.py run: 84 - INFO - Waiting 1 minute(s) for the next meter readout]
This is my configuration file:
mqtt: host: 192.168.2.98 port: 1883 client: kamstrup402 topic: kamstrup qos: 1 retain: False authentication: True username: pi password: [password] serial_device: com_port: /dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0 kamstrup: parameters:
i hope anyone has an idea what i am doing wrong. Thanks in advance.