Custom component reading AMS through MBus adapter into HomeAssistant
Custom component reading AMS through MBus adapter into HomeAssistant. Supports the new energy dashboard in Home-Assistant.
Works with the following Swedish and Norwegian meters:
Norway:
Sweden:
Not tested with, but should work:
Norway:
Sweden:
Not tested with, but should work:
Norway:
Sweden:
If it does not decode your data, please submit a ticket, and I will try to make a parser for your meter. If your meter type shown "unknown", please submit a ticket, and I will add your meter to the module.
Easiest method is to install via HACS. Then setup via Integrations config.
Or
ams
folder into your custom_components
folder.#Serial port example
ams:
protocol: serial # Required. The Protocol type for communications.
serial_port: '/dev/ttyUSB0' # Required. The serial port used to communicate through
baudrate: 2400 # Optional, defaults to '2400'
parity: 'N' # Optional, defaults to 'N'
meter_manufacturer: 'auto' # Optional, defaults to 'auto'
# TCP/IP config example
ams:
protocol: tcp_ip #Required. The protocol type for communications.
tcp_host: 192.168.2.11 # Required. The transmitting host address.
tcp_port: 8900 #Required. The transmitting host port.
meter_manufacturer: 'kamstrup' # Optional, defaults to 'auto'
All options:
protocol: Options are 'tcp_ip' or 'serial' This is option is required.
serial_port: Input your serial port to communicate through. Required if 'serial' is selected for 'protocol'.
baudrate: Input a custom baudrate. Default is 2400. This option in optional.
parity: Input a custom parity option. Default is 'N'. See https://github.com/pyserial/pyserial/blob/master/serial/serialutil.py#L79
tcp_host: Ip adress to host of meter data. Required if 'tcp_ip' is selected
tcp_port: Port at host of meter data. Required if 'tcp_ip' is selected.
meter_manufacturer: Set the meter manufacturer if 'auto' fails. This option is optional.
For meter_manufacturer
values the options are:
'auto' # This is default if nothing is specified.
'aidon'
'aidon_se' # Swedish aidon meter RF2 modules
'kamstrup'
'kaifa'
'kaifa_se' # Swedish kaifa meters
This will create sensors for each of the available usage data in the meter. The accumulative sensors will only be fully available after first read, and is transmitted from the meter 5 seconds past the hour. There seems to be a bug in the current Kamstrup firmware that the hour package is transmitted at xx:xx:55.
Latest information about OBIS for all the Norwegian meters: https://www.nek.no/info-ams-han-utviklere/
Latest information about Swedish standard for AMS: https://www.energiforetagen.se/globalassets/energiforetagen/det-erbjuder-vi/kurser-och-konferenser/elnat/branschrekommendation-lokalt-granssnitt-v2_0-201912.pdf
Improvements and suggestions are also welcome. Keep in mind, I am not a experienced programmer :) Enjoy