Norwegian HAN sensors

Thanks for using this module.
1.The energy sensors should appear after 1-2 hours. It’s only transitted once an hour, and if that package is corrupt, no data will be read until the next transmitted hourly package. That beeing said, if it does not appear, please enable debug and create an issue with the logs and raw package attached.
2. This I will have a look into and resolve. Great input!

As for the obis list, I am aware of that page, and are already at the bottom of the README.md

I have put up a Pull request for v1.8 with your suggested changes. Could you please test it and report?

I see the changes are for kaifa_se
I am in Norway and I set up it to use kaifa

My mistake: it is ams_active_power_import that is not available. this should be updated every 2 and 10 seconds.

I have enabled debug as following in configuration.yalm

logger:
  default: warning
  logs:
    custom_components.ams: debug

The debug lines you show should give you some logs. None of the changes I put up are for kafa_se. It affects all parsers. There are also a different issue fixed in this code. A missing meter type.

Ok.

With 1.8.0 I see now 14 devices, the old 13 plus a new " AMS energy meter" collecting all the sensors.
For now I disabled the old 13 devices not needed.

Still I do not see the ams_active_power_import. I collected the log from 1.7.2 and 1.8.0.

Missing ams_active_power_import in kaifa meter · Issue #61 · turbokongen/hass-AMS (github.com)

You need to remove the integration, stop homeassistsant, then start homeassistant (restart will use cache) and install th AMS reader again.
Then all the old devices will be removed, and replaced with one device with all 13 sensor in it.

I confirm 1 device is correctly implemented now.
I still miss the sensor ams_active_power_import (I only see 13 sensors, should be 14)

Fixed in v.1.8. Thank you.

Hi, I wonder if there are more modules than the ones listed as supported.

From the current list here GitHub - turbokongen/hass-AMS: Custom component reading AMS through MBus adapter into HomeAssistant only one module is available to order.
The other 2 are not longer available.

Anyone with experience with other modules, specially one that includes USB interface?

Thanks

Hello, I finally got my MBus device, same used by @janna

together with this USB to TTL converter

But I must admit I am little bit lost how to proceed further and troubleshoot.
I have installed @turbokongen implementation through HACS and configured this:

ams:
  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: 'aidon_se' # Optional, defaults to 'auto'

I run HomeAssistant in a raspberry pi3b+, and I can see in the logs that /dev/ttyUSB0 module is detected.

But this is all, i don’t know what is next step. I don’t see any new sensors populated, should they be populated automatically?

Maybe my HAN Port is not activated? (My El company says the have activated it).
Or maybe I did connections wrong from HANPort to MBUS?
I tried to follow @janna picture from previous post.

I have an Aidon 6534 from a swedish electricity company. They provide documentation in this document which I understand is compatible with @turbokongen implementation as it is based in Norwegian standard, am I wrong?

Any tip is very welcomed.

Thanks!

@adrianfp I still use the same device as described in post 8. Connection between HAN-port and MBUS should be pretty straight forward. According to the Aidon documentation it seems to be exactly the same as in Norway: MBUS-signal on pin 1 of RJ45-connector and GND on pin 2.
When cable is connected between HAN-port MBUS-device, if you have access to a multimeter, you should be able to measure the voltage on the connecting screws. I don’t have an Aidon meter, but on my Kamstrup meter the voltage is about 24V dropping to around 18V every 10 second when meter sends data. In your case “data” is one of the lists decribed in Aidon documentation and voltage should drop every 2.5 second.
If there is no voltage, I think either HAN-port is not enabled or there is something wrong with cable or RJ45 connector. If you measure voltage and voltage drop every 2.5 second, Han-port is working and you should look closer on the connection between MBUS and the USB to TTL serial converter. Maybe you have switched the Rx/Tx the wrong way.

Hi @janna, thanks a lot for your quick reply and for taking time to go through the input I provided, really appreciated, thanks!

Very good idea to check RJ45 with multimeter to confirm port activation. Unfortunately I realized that my multimeter is dead and have to buy a new one.

On the other hand I tried different connections from the HanPort side, and only one of them makes the LED to be ON. This gives me some confidence that the RJ45 is sending some signal, but still need to confirm with multimeter.

I am not sure about the connections I did to USB2TTL device, I tried to copy what I observed in your previou post picture. I have something like this:

This is what you are using, right?

USB2TTL Tx — MBUS board Rx
USB2TTL Rx — MBUS board Tx

Thanks again!

@adrianfp That’s right. MBUS board TXD => USB2TTL Rx. There’s no need to connect MBUS RXD to USB2TTL Tx because nothing happens there :slight_smile:
I did some diving under my desk and disassembled my device. As you can see in the video linked the Tx1 led on MBUS board lights up every time data is sent from meter.
HAN-port-reader in action
Video was filmed at exactly 9 o’clock:
09:00:10 - Meter sending power-, current-, voltage values, etc.
09:00:15 - Meter sending hourly meter readings.
09:00:20 - Meter sending power-, current-, voltage values, etc.

On your MBUS device the Tx1 led should light up every 2.5 seconds if every connected cable is in the right place.

Thanks @janna for top class support!

Actually the problem was more simple, as usual in this situations better to re-check the basics. I had used the wrong pins from RJ45. What I though it was pin1 was in fact pin 8 :flushed:.

After fixing that, everything started working, Tx led blinking periodically and ams_* sensor values populated in my HA.

Now I have to play with the sensors and make some good and helpful visualization.

Hi.

Concerning working modules, I just connected this one;

USB to MBUS slave module MBUS master slave communication debugging bus monitor TSS721 No spontaneity Self collection.

Seems to have worked “straight out of the box”.

What I have of data so far (only been connected for 1 hour ish) are in image.

2 Likes

Ordered this one just now ! Ali doesn’t have the best delivery time, but hey, it’s cheap. I take it the adapter is still working? U have some cool graphs/automations using the values?

I read about some dude using his meter to build a regulator, keeping his totalt usage pr hour under a 5kWh (or whatever value) limit. But for that to be useful, one would have to update values pretty often during an hour, anyone have any experience with that?

Digger prosjektet, men trenger hjelp til en feilmelding (‘AttributeError’):

Log Details (ERROR)
Logger: root
Source: custom_components/ams/__init__.py:175
Integration: AMS Reader (documentation, issues)
First occurred: 6:43:26 PM (1 occurrences)
Last logged: 6:43:26 PM

Uncaught thread exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/config/custom_components/ams/__init__.py", line 261, in connect
    data = self.read_packet()
  File "/config/custom_components/ams/__init__.py", line 175, in read_packet
    buf = self._ser.read()
AttributeError: 'AmsHub' object has no attribute '_ser'

Ved å vise fullstendig logg ser jeg også disse tre linjene:

2022-09-20 18:43:26.890 DEBUG (MainThread) [custom_components.ams] config entry = OrderedDict([('serial_port', '/dev/ttyUSB0'), ('baudrate', 2400), ('parity', 'N'), ('meter_manufacturer', 'kamstrup')])
2022-09-20 18:43:26.894 DEBUG (MainThread) [custom_components.ams] Finish init of AMS
2022-09-20 18:43:26.893 ERROR (Thread-2 (connect)) [root] Uncaught thread exception

Det er vel den ‘AttributeError’-saken som skaper problemet, og jeg aner ikke hva det betyr.
Den kommer ved oppstart av systemet, og ikke noe mer å melde i loggen.

AMS-integrasjonen ligger i integrasjonslisten, men uten ‘device’ og ‘entities’. Jeg regner med den ikke har fått noen lesning fra strømmåleren ennå?

Mitt oppsett er som følger:
Raspberry Pi4 med Home Assistant operativsystem og en USB MBUS koblet mot HAN-porten til en Kamstrup strømmåler. Installerte HASS-AMS ved å opprette mappen “custom_components/ams” og legge alle filer fra tilsvarende mappe i GitHub-prosjektet der.

configuration.yaml

# AMS strømmåling
ams:
  serial_port: '/dev/ttyUSB0'
  baudrate: 2400
  parity: 'N'
  meter_manufacturer: 'kamstrup'
# Logging
logger:
  default: warning
  logs:
    custom_components.ams: debug

Prøv å slett det som er skrevet i configuration.yaml og legg den til via enheter og integrasjoner istedet. Mulig jeg har glemt å oppdatere noe kode når jeg la til støtte for tcp/ip.

Supert, det løste hele saken :slight_smile: Nå har jeg 1 device og 14 entities knyttet til integrasjonen. Tusen takk!!

Leser den kun en gang i timen, eller er det mulig å lese hvert 10 sekund slik man har oppdatert effektmåling og lettere kan holde seg til ønsket kapasitetsledd fra netteigeren?

Ser den oppdaterer hvert 10 sekund, så dette er digg :wink:

Vet du noe om jeg bør få Home Assistant til å skrive til en annen disk for å slippe slitasje på minnekortet som også operativsystemet kjører på i Raspberry Pi4?

Forbruket blir sendt ut en gang i timen. Effekten blir sendt hvert 10.sekund på kamstrup målere. Skal man ha realtime forbruk, må man lage template sensorer. Husker ikke om det ligger noen slike her på forumet. Hvis ikke så er hjemmeautomasjon.no full av det.

1 Like