Skip to content

Custom component reading AMS through MBus adapter into HomeAssistant

Notifications You must be signed in to change notification settings

turbokongen/hass-AMS

Repository files navigation

hass-AMS - AMS Reader for Norwegian and Swedish AMS meters

logo

hacs_badge Buy Me A Coffee

Custom component reading AMS through MBus adapter into HomeAssistant. Supports the new energy dashboard in Home-Assistant.

Electricity meter hardware

Works with the following Swedish and Norwegian meters:

Kamstrup:

  • 6861111 tested by janna at homeassistant community forum
  • 6841121 tested by me
  • 6841131
  • 6841138A tested by NilsFA at homeassistant community forum
  • 6851121
  • 6851131

Kaifa:

Norway:

  • MA304H3E Thanks to @thomasja27 for testing 👍
  • MA105H2E Thanks for confirming: @Futrax

Sweden:

  • MA304H4 Thanks to @runlar for testing (Swedish version) 👍
  • MA304H4D

Not tested with, but should work:

  • MA304T4
  • MA304T3

Aidon:

Norway:

  • 6525 Thanks to @razzymoose for testing and providing patch 👍
  • 6515 Thanks to @maxgyver87 for fault finding and testing 👍
  • 6534 Thanks to @mariwing for testing and debugging 👍
  • 6483 Thanks @PerBob81 for confirming 👍

Sweden:

  • 6484 Thanks to @bo1jo for testing and debugging 👍

Not tested with, but should work:

Norway:

  • 6540
  • 6550

Sweden:

  • 6479

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.

Home-assistant installation

Easiest method is to install via HACS. Then setup via Integrations config.

Or

  1. Copy ams folder into your custom_components folder.
  2. Config by YAML setup or config by integrations in Home-assistant

YAML options

#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.

MBus interface hardware

Known working modules

Known NOT working modules

Technical documentation

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

Feedback

Improvements and suggestions are also welcome. Keep in mind, I am not a experienced programmer :) Enjoy