scs / smartmeter-datacollector

Smart Meter Data Collector
Other
57 stars 23 forks source link

Support LGE450 with different baudrates #28

Closed gcey closed 2 years ago

gcey commented 2 years ago

Currently "smartmeter_datacollector/smartmeter/lge450.py" assumes, that each L+G E450 meter communicates with 2400 bps:

class LGE450(SerialHdlcDlmsMeter):
    def __init__(self, port: str, decryption_key: Optional[str] = None) -> None:
        serial_config = SerialConfig(
            port=port,
            baudrate=2400,
            data_bits=serial.EIGHTBITS,
            parity=serial.PARITY_EVEN,
            stop_bits=serial.STOPBITS_ONE,
            termination=LGE450.HDLC_FLAG

But e.g. my L+G E450 meter (from Wiener Netze) communicates with 9600 bps over its optical IR interface. smartmeter-datacollector should be configurable accordingly.