Git Product home page Git Product logo

amshan-homeassistant's People

Contributors

sveip avatar toreamun avatar wrt54g avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amshan-homeassistant's Issues

Timeout reading data when setting up integration (Tibber Pulse)

Describe the bug

I am not able to connect Tibber Pulse to Amshan through Home Assistant with MQTT Broker.

I can acces 10.133.70.1 fine. If I only use the home assistant IP as mqtt_url, I get the error MQTTErr:-8 0 c. If I instead add my home assistant login before in username:password@host format, it seems to work. Pressing only "Send" does nothing, but if I press "Apply" as well the Pulse restarts, and connects to wifi (never turns solid green as the guide says, but light blue).

When I then try to add it to the Ams Han meter integration, I get the error "Timeout reading data"

Anyone have an idea where I go wrong? This feels like a PEBKAC issue, but I have tried for several days, and are not getting anywhere.

Debug log

When listening to MQTT topic i get endless lines of this


 Message 350 received on pulse at 22:03:

b"Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command '~\xa0*A\x08\x83\x13\x04\x13\xe6\xe7''''''''''''''''"

QoS: 0 - Retain: false
Message 349 received on pulse at 22:03:

b"Debug: Unknown command '~\xa0*A\x08\x83\x13\x04\x13\xe6\xe7'"

QoS: 0 - Retain: false
Message 348 received on pulse at 22:03:

Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: WiFi ps enabled''''''''''''''

QoS: 0 - Retain: false
Message 347 received on pulse at 22:03:

Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: 

QoS: 0 - Retain: false
Message 346 received on pulse at 22:03:

Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: 

QoS: 0 - Retain: false
Message 345 received on pulse at 22:03:

b"Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command '~\xa0*A\x08\x83\x13\x04\x13\xe6\xe7'''''''''''''''"

QoS: 0 - Retain: false
Message 344 received on pulse at 22:03:

b'~\xa0*A\x08\x83\x13\x04\x13\xe6\xe7\x00\x0f@\x00\x00\x00\x00\x01\x01\x02\x03\t\x06\x01\x00\x01\x07\x00\xff\x06\x00\x00\x10c\x02\x02\x0f\x00\x16\x1b=p~'

QoS: 0 - Retain: false
Message 343 received on pulse at 22:03:

Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: WiFi ps enabled'''''''''''''

QoS: 0 - Retain: false


Message 326 received on pulse at 22:03:

Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: Unknown command 'Debug: WiFi ps enabled''''

QoS: 0 - Retain: false 

Proxy Tibber Pulse MQTT data up to Tibber API?

When reconfiguring Tibber Pulse to send to a local MQTT server (for HA), the Tibber integration is lost because the data is no longer sent to Tibber. Would it be technically possible to make a MQTT proxy that forwards the Tibber pulse data to the Tibber API? This way it would be possible to keep both the HA integration and the Tibber integration working.

Has anyone looked at what it would take to send the ams MQTT data to the Tibber API? Is there any login and/or certificates we can't access?

Support entity categories

Home Assistant Core 2021.11 introduces two new concepts to make managing devices easier, device configuration URL and entity categories. The integration should support entity categories and mark sensors like meter id, manufacturer and obos version as diagnostics.

AmsToMqttBridge in Raw data (bytes) mode

Hello.

Thank you for a good integration :-)

Swapped a Tibber Pulse(running local) with an AmsToMqttBridge in Raw data (bytes) mode.

Expected that the AmsToMqttBridge in Raw data (bytes) mode should present the data in the same format, but it differs.

IN MQTT Explorer:

Tibber Pulse data:
��+!�#���� �� ���7
����
�Kamstrup_V0001 �����
�57065672813xxxxx ���`���
�6841131BN2431xxxxx �������� ������� ������� �������� �������S ���3���K ���G��� ��� ���� ���4���� ���H����F

AmsToMqttBridge "Raw data (bytes) mode" data:
02190A0E4B616D73747275705F563030303109060101000005FF0A103537303635363732383133373631313509060101600101FF0A1236383431313331424E32343331303130343009060101010700FF06000000BD09060101020700FF060000000009060101030700FF060000000009060101040700FF0600000104090601011F0700FF060000004C09060101330700FF060000005109060101470700FF060000000909060101200700FF1200EE09060101340700FF1200EC09060101480700FF1200EC

The amshan integration is timing out during configuration.

Meter manufacturer: Kamstrup
Meter type: 6841131BN243101040
OBIS List version identifier: Kamstrup_V0001

Entity ID changes

After a restart of HA I sometimes get different Entity ID, normally it should be "lgf" but it sometimes gets "none"

I am using this module with firmware, 3.3
https://energyintelligence.se/shop/product/p1-till-mqtt-adapter

image

After a restart it will fix itself
image

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2022.12.8",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.10.7",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Stockholm",
    "os_name": "Linux",
    "os_version": "5.15.80",
    "supervisor": "2022.11.2",
    "host_os": "Home Assistant OS 9.4",
    "docker_version": "20.10.19",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {
    "hacs": {
      "version": "1.29.0",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "amshan": {
      "version": "2022.10.2",
      "requirements": [
        "amshan[serial]==2.0.5"
      ]
    }
  },
  "integration_manifest": {
    "domain": "amshan",
    "name": "AMS HAN meter",
    "version": "2022.10.2",
    "config_flow": true,
    "documentation": "https://github.com/toreamun/amshan-homeassistant",
    "issue_tracker": "https://github.com/toreamun/amshan-homeassistant/issues",
    "codeowners": [
      "@toreamun"
    ],
    "requirements": [
      "amshan[serial]==2.0.5"
    ],
    "after_dependencies": [
      "mqtt"
    ],
    "iot_class": "local_push",
    "is_built_in": false
  },
  "data": {
    "config_entry": {
      "entry_id": "81aaaaa1bxxxf12936bbb1e0000f5250",
      "version": 3,
      "domain": "amshan",
      "title": "Elm\u00e4taren",
      "data": {
        "connection_type": "hass_mqtt",
        "connection": {
          "mqtt_topics": "Elmataren/+"
        }
      },
      "options": {
        "scale_factor": 1.0
      },
      "pref_disable_new_entities": false,
      "pref_disable_polling": false,
      "source": "user",
      "unique_id": null,
      "disabled_by": null
    }
  }
}

Scale value problem for cumulative data

  • Kamstrup 6841138AN243101090 (Kamstrup_V0001) in Sweden
  • Binary data captured directly on the meter and sent unaltered via MQTT

With the default config dialog scale value of 1 all sensors report correctly (power, current, voltage) except the cumulative values that in my case would need a scale value of 0.1. E.g. the meter has used 38062 kWh in total (as read on the display) but the "Cumulative hourly active import energy (A+) (Q1+Q4)" reports 380620 kWh. As this is the sensor I would like to use as the total consumption for the Energy dashboard in HA this setup does not currently work for this meter.

Not sure what the best solution would be but if the meter reports "incorrect" values maybe more than one scale value is needed in the configuration dialog? I.e. one general scale value and one for the cumulative measurements?

For now I've changed the scale values in sensor.py to fit my needs as a workaround.

HA 2021.12 oppdateringer

EntityCategory enum skal benyttes for entity_category fra HA 2021.12.
SensorStateClass enum skal benyttes for state_class.
SensorDeviceClass enum skal benyttes for device_class.

Timeout reading data

Hi! and thanks for the amazing worker!
I am running into trouble on the last step of set-up. Using a tibber puls(han). I am getting the strings on the topic both in homasitent and separate mqtt client.
Any tips on the next step of troubleshooting? the log does not produce any useful pointer so I might be looking in the wrong place.

Screenshot 2022-08-31 at 21 58 09

Timeout when trying to read from Kamstrup via MQTT (amsleser, k-pow)

Version of the custom_component

2022.4.0

Configuration

The MQTT data looks like this
{"id":"xx","name":"amsleser","up":7059,"t":1650649460,"vcc":3.309,"rssi":-75,"temp":-127.00,"data":{"lv":"","id":"","type":"","P":1091,"Q":0,"PO":0,"QO":423,"I1":0.37,"I2":3.97,"I3":1.32,"U1":230.00,"U2":233.00,"U3":234.00,"PF":0.93,"PF1":0.83,"PF2":0.92,"PF3":0.97,"tPI":27086.02,"tPO":0.00,"tQI":20.90,"tQO":9414.54,"rtc":1650649460}}

Describe the bug

I have a K-Pow module with AMSLeser 2.1 on it, it delivers JSON data to MQTT.
When I try to use the amshan integration, I get a mesage that says timeout:

billede

Is it not compatible?

Debug log

No logs

Problem with Energyintelligence P1

Version of the custom_component

2022.4.0

Configuration

//configuration.yaml
//********************
//# Loads default set of integrations. Do not remove.
//default_config:
//
//# Text to speech
//tts:
// - platform: google_translate
//
//automation: !include automations.yaml
//script: !include scripts.yaml
//scene: !include scenes.yaml
//
//logger:
// default: info
// logs:
// custom_components.amshan: debug

Describe the bug

I have a set up with the energy meter Landis+Gyr E360 and have then connected a P1-reader from Energyintelligence.se.
When I configure my Mosquitto to listen to topic "esp32_C45130/raw/#" my P1-reader it receives messages.
For example:
"Message 459 received on esp32_C45130/raw/Current/Instant/L1/value at 11:33 AM:
004.5
QoS: 0 - Retain: false"

And

"Message 907 received on esp32_C45130/raw/raw at 11:35 AM:
/LGF5E360

0-0:1.0.0(220627103550W)
1-0:1.8.0(00000153.252kWh)
1-0:2.8.0(00000070.244
kWh)
1-0:3.8.0(00000013.973kVArh)
1-0:4.8.0(00000026.544
kVArh)
1-0:1.7.0(0000.000kW)
1-0:2.7.0(0003.531
kW)
1-0:3.7.0(0000.209kVAr)
1-0:4.7.0(0000.000
kVAr)
1-0:21.7.0(0000.000kW)
1-0:22.7.0(0001.003
kW)
1-0:41.7.0(0000.000kW)
1-0:42.7.0(0000.392
kW)
1-0:61.7.0(0000.000kW)
1-0:62.7.0(0002.135
kW)
1-0:23.7.0(0000.000kVAr)
1-0:24.7.0(0000.215
kVAr)
1-0:43.7.0(0000.584kVAr)
1-0:44.7.0(0000.000
kVAr)
1-0:63.7.0(0000.000kVAr)
1-0:64.7.0(0000.160
kVAr)
1-0:32.7.0(237.7V)
1-0:52.7.0(235.1
V)
1-0:72.7.0(238.1V)
1-0:31.7.0(004.3
A)
1-0:51.7.0(003.0A)
1-0:71.7.0(009.0
A)
!0C6A
QoS: 0 - Retain: false"

But when I try to configure AMS HAN meter via MQTT I get the error "Timeout reading data". Have tried whit different topics but the same error message for all:
esp32_C45130/raw
esp32_C45130/raw/raw
esp32_C45130/
esp32_C45130/#
esp32_C45130/raw/#
esp32_C45130/raw/raw/#

Debug log

This is all I can find when searching for amshan in the logs:

2022-06-27 13:54:17 DEBUG (MainThread) [custom_components.amshan.config_flow] Timout waiting 12 seconds for meter measure.
2022-06-27 13:54:29 DEBUG (MainThread) [custom_components.amshan.config_flow] Timout waiting 12 seconds for meter measure.
2022-06-27 13:54:41 DEBUG (MainThread) [custom_components.amshan.config_flow] Timout waiting 12 seconds for meter measure.
2022-06-27 13:54:53 DEBUG (MainThread) [custom_components.amshan.config_flow] Timout waiting 12 seconds for meter measure.
2022-06-27 13:55:05 DEBUG (MainThread) [custom_components.amshan.config_flow] Timout waiting 12 seconds for meter measure.
2022-06-27 13:55:17 DEBUG (MainThread) [custom_components.amshan.config_flow] Timout waiting 12 seconds for meter measure.

Add lastMeterProduction and lastMeterConsumption from Tibber Pulse

Is your feature request related to a problem?
Eg. during power outages, or if the Pulse is down/need to be rebooted for any reason, the shorter term data (hour and accumulated) are lost so any calculations based on these gives faulty statistics.

Describe the solution you'd like
Being able to use lastMeterProduction and lastMeterConsumption as is available in the API, would give erroneous short term statistics but correct long term statistics.

Describe alternatives you've considered
I could use the Tibber Developer API to give me these, but the I would lose the MQTT setup and be reliable on Tibber.

Additional context
The net meter is an Landis+Gyr E360.

Power outage 20.00-21.00
image

Power outage around 04.00 and the Pulse was unavailable and needed rebooting (which I did in the morning).
image

Kamstrup and tibber pulse, error setup

Version of the custom_component

Configuration

![amshan setup error](https://user-images.githubusercontent.com/16886605/194852754-e61850e5-9295-4bf4-937b-72c84a218257.jpg)
![amshan tibber topic](https://user-images.githubusercontent.com/16886605/194852720-b5f82268-9d7c-435c-8a79-77e7bb04e74c.jpg)
![mqtt tibber topic event some data](https://user-images.githubusercontent.com/16886605/194852730-6dd7f1de-fb04-42b4-a718-3fb8bf3f87fe.jpg)
![mqtt tibber topic events](https://user-images.githubusercontent.com/16886605/194852733-1496bd79-6f1c-4e5d-b87f-436d417a26f2.jpg)

Describe the bug

Timeout when trying to setup Pulse with MQTT

Debug log


2022-10-10 12:56:06.004 DEBUG (MainThread) [custom_components.amshan.config_flow] Timout waiting 12 seconds for meter measure.
2022-10-10 12:56:18.005 DEBUG (MainThread) [custom_components.amshan.config_flow] Timout waiting 12 seconds for meter measure.
2022-10-10 12:56:22.117 DEBUG (MainThread) [custom_components.amshan.metercon] Got payload without HDLC framing from topic pulse/publish: 44656275673a204e6f2048414e2064617461
2022-10-10 12:56:34.122 DEBUG (MainThread) [custom_components.amshan.config_flow] Timout waiting 12 seconds for meter measure.
2022-10-10 12:56:46.124 DEBUG (MainThread) [custom_components.amshan.config_flow] Timout waiting 12 seconds for meter measure.
2022-10-10 12:56:53.992 DEBUG (MainThread) [custom_components.amshan.config_flow] Timout waiting 12 seconds for meter measure.
2022-10-10 12:57:01.378 DEBUG (MainThread) [custom_components.amshan.metercon] Ignore JSON in payload without HDLC framing from topic pulse/publish: {'status': {'rssi': -65, 'ch': 4, 'ssid': 'XXXXXXXXX', 'usbV': '1.22', 'Vin': '23.78', 'Vcap': '4.48', 'Vbck': '4.65', 'Build': '1.1.15', 'Hw': 'F', 'bssid': '5eaf97399954', 'ID': 'e831cd1bad10', 'Uptime': 3962, 'mqttcon': 0, 'pubcnt': 3, 'rxcnt': 0, 'wificon': 6, 'wififail': 0, 'bits': 71, 'cSet': 33, 'Ic': 3.36, 'crcerr': 0, 'cAx': 1.270452, 'cB': 13, 'heap': 212012, 'baud': 2400, 'meter': 'Unknown', 'ntc': 18.78, 's/w': 16.956, 'ct': 1034, 'dtims': 19}}
2022-10-10 12:57:01.382 DEBUG (MainThread) [custom_components.amshan.metercon] Got payload without HDLC framing from topic pulse/publish: 44656275673a204e6f2048414e2064617461
2022-10-10 12:57:13.386 DEBUG (MainThread) [custom_components.amshan.config_flow] Timout waiting 12 seconds for meter measure.
2022-10-10 12:57:25.389 DEBUG (MainThread) [custom_components.amshan.config_flow] Timout waiting 12 seconds for meter measure.
2022-10-10 12:57:37.391 DEBUG (MainThread) [custom_components.amshan.config_flow] Timout waiting 12 seconds for meter measure.
2022-10-10 12:57:38.644 DEBUG (MainThread) [custom_components.amshan.metercon] Got payload without HDLC framing from topic pulse/publish: 44656275673a204e6f2048414e2064617461
2022-10-10 12:57:50.649 DEBUG (MainThread) [custom_components.amshan.config_flow] Timout waiting 12 seconds for meter measure.


Ukjent feil MQTT

Version of the custom_component

Configuration

Add your logs here.

Describe the bug

A clear and concise description of what the bug is.
Hei
Prøver legge inn MQTT topic, men den bare timer ut med unknown error,
Er det fordi det er passord på mqtt, eller er det en annen grunn?

Debug log


Add your logs here.

Option to change units

Hi! Just started using this integration together with local Tibber Pulse through MQTT, seems to be working great! Thanks for your awesome work here!

Would you consider adding an option to choose kW and kVAR instead of W and VAR as units?

Thanks again!

Amsleser (AmsToMqttBridge) timeout

Version of the custom_component

2022.10.2

Configuration

Kaifa MA105H2E -> POW-U+ (amsleser.no) -> MQTT payload type: Raw data (bytes) -> mosquitto broker in home assistant -> amshan

Describe the bug

Possibly same as #44, but not quite same debug message.

Trying to integrate amshan in home assistant using a POW-U+ reader from amsleser.no with AmsToMqttBridge, gives a timeout error as shown in picture below:

bilde

Using the payload type: Raw data (bytes) as mqtt setup in AmsToMqttBridge software.
Debug info pasted below.

Let me know if you need any other debug info, or if this is a problem with the format from the AmsToMqttBridge software.

Debug log


2022-10-16 20:26:56.672 DEBUG (MainThread) [custom_components.amshan.metercon] Got payload without HDLC framing from topic amsreader: 3032303130363030303030323341
2022-10-16 20:26:58.623 DEBUG (MainThread) [custom_components.amshan.metercon] Got payload without HDLC framing from topic amsreader: 3032303130363030303030323431
2022-10-16 20:27:00.993 DEBUG (MainThread) [custom_components.amshan.metercon] Got payload without HDLC framing from topic amsreader: 303230393039303734423436344435463330333033313039313033363339333733303336333333313334333033313330333633323334333033373039303834443431333133303335343833323435303630303030303233363036303030303030303030363030303030303030303630303030303042333036303030303041363130363030303030393132
2022-10-16 20:27:02.665 DEBUG (MainThread) [custom_components.amshan.metercon] Got payload without HDLC framing from topic amsreader: 3032303130363030303030323434
2022-10-16 20:27:04.668 DEBUG (MainThread) [custom_components.amshan.metercon] Got payload without HDLC framing from topic amsreader: 3032303130363030303030323337
2022-10-16 20:27:06.659 DEBUG (MainThread) [custom_components.amshan.metercon] Got payload without HDLC framing from topic amsreader: 3032303130363030303030323343

Tibber Pulse ikke tilgjengelig lenger.

Jeg får ikke kontakt med Pulse via Mosquitto lenger, verken med sertifikater, anonym login eller noe som helst.

MQTT conf:
acl_file /share/mosquitto/accesscontrollist
listener 1885
cafile /share/mosquitto/ca.crt
keyfile /share/mosquitto/client.key
certfile /share/mosquitto/client.crt
allow_anonymous true
require_certificate false
log_timestamp_format %Y-%m-%dT%H:%M:%S

MQTT tillater ikke lenger helt anonym pålogging og krever en form for innlogging, dette er mest trolig ikke mulig med Pulse siden den ikke har mulighet for å sende brukernavn og passord via webui og SSL ikke fungerer såvidt jeg kan se.

Meter message codes in documentation

Is your feature request related to a problem? Please describe.
Getting error codes that I do not know what mean:

Logger: custom_components.amshan.sensor
Source: custom_components/amshan/sensor.py:537
Integration: AMS HAN meter (documentation, issues)
First occurred: 11:06:32 (52 occurrences)
Last logged: 11:20:31

Could not decode meter message: 44656275673a20576946692070732064697361626c65
Could not decode meter message: 44656275673a205769466920707320656e61626c6564

Describe the solution you'd like
Add meter message code "translation" in documentation?

Describe alternatives you've considered
Follow issue on similar error, and solution was suggested to be external power, but that does not help. So to be able to decode error message would be a great start.

Additional context
Using Tibber Pulse v1 og Kaifa MA105H2E måler

Aidon older protocol support. (Was: OSS-support not working properly)

Version of the custom_component

Configuration

2022-10-07 23 19 13 homeassistant 10baa6edf38f

Describe the bug

Fails to parse input from OSS

Debug log

2022-10-07 23:53:32.288 INFO (MainThread) [han.meter_connection] SmartMeterMessageProtocol[0]: Smart meter connected to Serial<id=0x7f949c3cd0, open=True>(port='/dev/serial/by-id/usb-FTDI_FT231X_USB_UART_DO01XS4J-if00-port0', baudrate=115200, bytesize=8, parity='N', stopbits=1.0, timeout=0, xonxoff=False, rtscts=False, dsrdtr=False)
2022-10-07 23:53:32.979 DEBUG (MainThread) [han.hdlc] Found flag sequence in frame hunt mode
2022-10-07 23:53:32.982 DEBUG (MainThread) [han.hdlc] Frame of expected length 42 received with good checksum.
2022-10-07 23:53:32.983 INFO (MainThread) [han.meter_connection] Reader <han.hdlc.HdlcFrameReader object at 0x7f949c3b20> selected.
2022-10-07 23:53:32.997 DEBUG (MainThread) [custom_components.amshan.config_flow] Decoded measure data is missing required info.
2022-10-07 23:53:35.334 DEBUG (MainThread) [han.hdlc] Found flag sequence. Too short frame (2 bytes). Discard frame: 0d0a
2022-10-07 23:53:35.335 DEBUG (MainThread) [han.hdlc] Found flag sequence in frame hunt mode
2022-10-07 23:53:37.912 DEBUG (MainThread) [han.hdlc] Found flag sequence. Too short frame (2 bytes). Discard frame: 0d0a
2022-10-07 23:53:37.912 DEBUG (MainThread) [han.hdlc] Found flag sequence in frame hunt mode
2022-10-07 23:53:41.524 DEBUG (MainThread) [han.hdlc] Found flag sequence. Too short frame (2 bytes). Discard frame: 0d0a
2022-10-07 23:53:41.525 DEBUG (MainThread) [han.hdlc] Found flag sequence in frame hunt mode
2022-10-07 23:53:42.820 DEBUG (MainThread) [han.hdlc] Found flag sequence. Too short frame (2 bytes). Discard frame: 0d0a
2022-10-07 23:53:42.821 DEBUG (MainThread) [han.hdlc] Found flag sequence in frame hunt mode
2022-10-07 23:53:45.001 DEBUG (MainThread) [custom_components.amshan.config_flow] Timout waiting 12 seconds for meter measure.
2022-10-07 23:53:45.398 DEBUG (MainThread) [han.hdlc] Found flag sequence. Too short frame (2 bytes). Discard frame: 0d0a
2022-10-07 23:53:45.399 DEBUG (MainThread) [han.hdlc] Found flag sequence in frame hunt mode
2022-10-07 23:53:47.961 DEBUG (MainThread) [han.hdlc] Found flag sequence. Too short frame (2 bytes). Discard frame: 0d0a
2022-10-07 23:53:47.977 DEBUG (MainThread) [han.hdlc] Found flag sequence in frame hunt mode
2022-10-07 23:53:51.546 DEBUG (MainThread) [han.hdlc] Found flag sequence. Too short frame (2 bytes). Discard frame: 0d0a
2022-10-07 23:53:51.589 DEBUG (MainThread) [han.hdlc] Found flag sequence in frame hunt mode
2022-10-07 23:53:52.902 DEBUG (MainThread) [han.hdlc] Found flag sequence. Too short frame (2 bytes). Discard frame: 0d0a
2022-10-07 23:53:52.903 DEBUG (MainThread) [han.hdlc] Found flag sequence in frame hunt mode
2022-10-07 23:53:55.463 DEBUG (MainThread) [han.hdlc] Found flag sequence. Too short frame (2 bytes). Discard frame: 0d0a
2022-10-07 23:53:55.464 DEBUG (MainThread) [han.hdlc] Found flag sequence in frame hunt mode
2022-10-07 23:53:57.003 DEBUG (MainThread) [custom_components.amshan.config_flow] Timout waiting 12 seconds for meter measure.
2022-10-07 23:53:57.817 DEBUG (MainThread) [han.hdlc] Found flag sequence. Too short frame (2 bytes). Discard frame: 0d0a
2022-10-07 23:53:57.832 DEBUG (MainThread) [han.hdlc] Found flag sequence in frame hunt mode
2022-10-07 23:54:01.448 DEBUG (MainThread) [han.hdlc] Found flag sequence. Too short frame (2 bytes). Discard frame: 0d0a
2022-10-07 23:54:01.449 DEBUG (MainThread) [han.hdlc] Found flag sequence in frame hunt mode
2022-10-07 23:54:02.969 DEBUG (MainThread) [han.hdlc] Found flag sequence. Too short frame (2 bytes). Discard frame: 0d0a
2022-10-07 23:54:02.970 DEBUG (MainThread) [han.hdlc] Found flag sequence in frame hunt mode
2022-10-07 23:54:05.322 DEBUG (MainThread) [han.hdlc] Found flag sequence. Too short frame (2 bytes). Discard frame: 0d0a
2022-10-07 23:54:05.323 DEBUG (MainThread) [han.hdlc] Found flag sequence in frame hunt mode
2022-10-07 23:54:07.900 DEBUG (MainThread) [han.hdlc] Found flag sequence. Too short frame (2 bytes). Discard frame: 0d0a
2022-10-07 23:54:07.901 DEBUG (MainThread) [han.hdlc] Found flag sequence in frame hunt mode
2022-10-07 23:54:09.006 DEBUG (MainThread) [custom_components.amshan.config_flow] Timout waiting 12 seconds for meter measure.
2022-10-07 23:54:11.516 DEBUG (MainThread) [han.hdlc] Found flag sequence. Too short frame (2 bytes). Discard frame: 0d0a
2022-10-07 23:54:11.517 DEBUG (MainThread) [han.hdlc] Found flag sequence in frame hunt mode
2022-10-07 23:54:21.008 DEBUG (MainThread) [custom_components.amshan.config_flow] Timout waiting 12 seconds for meter measure.
2022-10-07 23:54:33.011 DEBUG (MainThread) [custom_components.amshan.config_flow] Timout waiting 12 seconds for meter measure.
2022-10-07 23:54:33.025 DEBUG (MainThread) [han.meter_connection] SmartMeterMessageProtocol[0]: Connection to Serial<id=0x7f949c3cd0, open=True>(port='/dev/serial/by-id/usb-FTDI_FT231X_USB_UART_DO01XS4J-if00-port0', baudrate=115200, bytesize=8, parity='N', stopbits=1.0, timeout=0, xonxoff=False, rtscts=False, dsrdtr=False) closed

Raw data from serial port

# xxd /dev/ttyUSB0
0000000: 7ea0 2a41 0883 1304 13e6 e700 0f40 0000  ~.*A.........@..
0000010: 0000 0101 0203 0906 0100 0107 00ff 0600  ................
0000020: 0004 3c02 020f 0016 1ba0 567e 0d0a 7ea1  ..<.......V~..~.
0000030: 0b41 0883 13fa 7ce6 e700 0f40 0000 0000  .A....|....@....
0000040: 010c 0202 0906 0101 0002 81ff 0d0a 0b41  ...............A
0000050: 4944 4f4e 5f56 3030 3031 0202 0906 0000  IDON_V0001......
0000060: 6001 00ff 0d0a 1037 3335 3939 3932 3839  `......735999289
0000070: 3633 3739 3035 3102 0209 0600 0060 0107  6379051......`..
0000080: ff0d 0a04 3635 3235 0203 0906 0100 0107  ....6525........
0000090: 00ff 0600 0004 3302 020f 0016 1b02 0309  ......3.........
00000a0: 0601 0002 0700 ff06 0000 0000 0202 0f00  ................
00000b0: 161b 0203 0906 0100 0307 00ff 0600 0008  ................
00000c0: e402 020f 0016 1d02 0309 0601 0004 0700  ................
00000d0: ff06 0000 0000 0202 0f00 161d 0203 0906  ................
00000e0: 0100 1f07 00ff 10ff af02 020f ff16 2102  ..............!.
00000f0: 0309 0601 0047 0700 ff10 0040 0202 0fff  .....G.....@....
0000100: 1621 0203 0906 0100 2007 00ff 1209 7902  .!...... .....y.
0000110: 020f ff16 2302 0309 0601 0034 0700 ff12  ....#......4....
0000120: 0954 0202 0fff 1623 0203 0906 0100 4807  .T.....#......H.
0000130: 00ff 1209 4302 020f ff16 2348 e77e 0d0a  ....C.....#H.~..
0000140: 7ea0 2a41 0883 1304 13e6 e700 0f40 0000  ~.*A.........@..
0000150: 0000 0101 0203 0906 0100 0107 00ff 0600  ................
0000160: 0004 8902 020f 0016 1b54 f67e 0d0a 7ea0  .........T.~..~.
0000170: 2a41 0883 1304 13e6 e700 0f40 0000 0000  *A.........@....
0000180: 0101 0203 0906 0100 0107 00ff 0600 0004  ................
0000190: 8202 020f 0016 1bd6 807e 0d0a 7ea0 2a41  .........~..~.*A
00001a0: 0883 1304 13e6 e700 0f40 0000 0000 0101  .........@......
00001b0: 0203 0906 0100 0107 00ff 0600 0004 8002  ................
00001c0: 020f 0016 1b6d b77e 0d0a 7ea1 0b41 0883  .....m.~..~..A..
00001d0: 13fa 7ce6 e700 0f40 0000 0000 010c 0202  ..|....@........
00001e0: 0906 0101 0002 81ff 0d0a 0b41 4944 4f4e  ...........AIDON
00001f0: 5f56 3030 3031 0202 0906 0000 6001 00ff  _V0001......`...
0000200: 0d0a 1037 3335 3939 3932 3839 3633 3739  ...7359992896379
0000210: 3035 3102 0209 0600 0060 0107 ff0d 0a04  051......`......
0000220: 3635 3235 0203 0906 0100 0107 00ff 0600  6525............
0000230: 0004 7f02 020f 0016 1b02 0309 0601 0002  ................
0000240: 0700 ff06 0000 0000 0202 0f00 161b 0203  ................
0000250: 0906 0100 0307 00ff 0600 0009 9202 020f  ................
0000260: 0016 1d02 0309 0601 0004 0700 ff06 0000  ................
0000270: 0000 0202 0f00 161d 0203 0906 0100 1f07  ................
0000280: 00ff 10ff a802 020f ff16 2102 0309 0601  ..........!.....
0000290: 0047 0700 ff10 0045 0202 0fff 1621 0203  .G.....E.....!..
00002a0: 0906 0100 2007 00ff 1209 7d02 020f ff16  .... .....}.....
00002b0: 2302 0309 0601 0034 0700 ff12 0959 0202  #......4.....Y..
00002c0: 0fff 1623 0203 0906 0100 4807 00ff 1209  ...#......H.....
00002d0: 4402 020f ff16 231e bf7e 0d0a 7ea0 2a41  D.....#..~..~.*A
00002e0: 0883 1304 13e6 e700 0f40 0000 0000 0101  .........@......
00002f0: 0203 0906 0100 0107 00ff 0600 0004 9702  ................
0000300: 020f 0016 1bbc c57e 0d0a 7ea0 2a41 0883  .......~..~.*A..
0000310: 1304 13e6 e700 0f40 0000 0000 0101 0203  .......@........
0000320: 0906 0100 0107 00ff 0600 0004 8102 020f  ................
0000330: 0016 1bb8 287e 0d0a 7ea0 2a41 0883 1304  ....(~..~.*A....
0000340: 13e6 e700 0f40 0000 0000 0101 0203 0906  .....@..........
0000350: 0100 0107 00ff 0600 0004 8102 020f 0016  ................
0000360: 1bb8 287e 0d0a 7ea1 0b41 0883 13fa 7ce6  ..(~..~..A....|.
0000370: e700 0f40 0000 0000 010c 0202 0906 0101  ...@............
0000380: 0002 81ff 0d0a 0b41 4944 4f4e 5f56 3030  .......AIDON_V00
0000390: 3031 0202 0906 0000 6001 00ff 0d0a 1037  01......`......7
00003a0: 3335 3939 3932 3839 3633 3739 3035 3102  359992896379051.
00003b0: 0209 0600 0060 0107 ff0d 0a04 3635 3235  .....`......6525
00003c0: 0203 0906 0100 0107 00ff 0600 0004 8102  ................
00003d0: 020f 0016 1b02 0309 0601 0002 0700 ff06  ................
00003e0: 0000 0000 0202 0f00 161b 0203 0906 0100  ................
00003f0: 0307 00ff 0600 0009 8902 020f 0016 1d02  ................
0000400: 0309 0601 0004 0700 ff06 0000 0000 0202  ................
0000410: 0f00 161d 0203 0906 0100 1f07 00ff 10ff  ................
0000420: a902 020f ff16 2102 0309 0601 0047 0700  ......!......G..
0000430: ff10 0045 0202 0fff 1621 0203 0906 0100  ...E.....!......
0000440: 2007 00ff 1209 7d02 020f ff16 2302 0309   .....}.....#...
0000450: 0601 0034 0700 ff12 0956 0202 0fff 1623  ...4.....V.....#
0000460: 0203 0906 0100 4807 00ff 1209 4102 020f  ......H.....A...
0000470: ff16 23b3 1e7e 0d0a 7ea0 2a41 0883 1304  ..#..~..~.*A....
0000480: 13e6 e700 0f40 0000 0000 0101 0203 0906  .....@..........
0000490: 0100 0107 00ff 0600 0004 8602 020f 0016  ................
00004a0: 1ba0 ef7e 0d0a 7ea0 2a41 0883 1304 13e6  ...~..~.*A......
00004b0: e700 0f40 0000 0000 0101 0203 0906 0100  ...@............
00004c0: 0107 00ff 0600 0004 9202 020f 0016 1b1f  ................
00004d0: 357e 0d0a 7ea0 2a41 0883 1304 13e6 e700  5~..~.*A........
00004e0: 0f40 0000 0000 0101 0203 0906 0100 0107  .@..............
00004f0: 00ff 0600 0004 a602 020f 0016 1b23 8c7e  .............#.~
0000500: 0d0a 7ea1 0b41 0883 13fa 7ce6 e700 0f40  ..~..A....|....@
0000510: 0000 0000 010c 0202 0906 0101 0002 81ff  ................
0000520: 0d0a 0b41 4944 4f4e 5f56 3030 3031 0202  ...AIDON_V0001..
0000530: 0906 0000 6001 00ff 0d0a 1037 3335 3939  ....`......73599
0000540: 3932 3839 3633 3739 3035 3102 0209 0600  92896379051.....
0000550: 0060 0107 ff0d 0a04 3635 3235 0203 0906  .`......6525....
0000560: 0100 0107 00ff 0600 0004 8502 020f 0016  ................
0000570: 1b02 0309 0601 0002 0700 ff06 0000 0000  ................
0000580: 0202 0f00 161b 0203 0906 0100 0307 00ff  ................
0000590: 0600 0009 8802 020f 0016 1d02 0309 0601  ................
00005a0: 0004 0700 ff06 0000 0000 0202 0f00 161d  ................
00005b0: 0203 0906 0100 1f07 00ff 10ff a802 020f  ................
00005c0: ff16 2102 0309 0601 0047 0700 ff10 0046  ..!......G.....F
00005d0: 0202 0fff 1621 0203 0906 0100 2007 00ff  .....!...... ...
00005e0: 1209 7d02 020f ff16 2302 0309 0601 0034  ..}.....#......4
00005f0: 0700 ff12 0958 0202 0fff 1623 0203 0906  .....X.....#....
0000600: 0100 4807 00ff 1209 4202 020f ff16 23d6  ..H.....B.....#.
0000610: fc7e 0d0a 7ea0 2a41 0883 1304 13e6 e700  .~..~.*A........
0000620: 0f40 0000 0000 0101 0203 0906 0100 0107  .@..............
0000630: 00ff 0600 0004 a302 020f 0016 1b80 7c7e  ..............|~
0000640: 0d0a 7ea0 2a41 0883 1304 13e6 e700 0f40  ..~.*A.........@
0000650: 0000 0000 0101 0203 0906 0100 0107 00ff  ................
0000660: 0600 000c 5602 020f 0016 1bce 367e 0d0a  ....V.......6~..

No detection of closed connection with ser2net

Version of the AMSHAN

The version is 2022.4.0

Configuration

LGF E360 -> Homebrew adapter from hanporten.se -> Raspberry-pi with GPIO -> ser2net -> wifi -> Homeassistant OS in virtual machine -> Amshan v 2022.4.0

Describe the bug

After restart of the Rasperry pi it does not seem like the plugin detects that the connection is closed and does not start again (or the timeout is very long). A reload of the plugin fixes the issue.

MQTT feiler

Etter problemer med leser og ny måler, får jeg ikke satt opp MQTT forbindelse. Virket før jeg fjernet integrasjonen, men etter å ha lagt den til på nytt, kommer det bare unknown error når jeg prøver legge den til. Har forsøkt flere versjoner. Mulig problemet ligger i HA, men finner ikke noe fornuftig i loggene. Bruker pow-u fra amsleser.no. Dette virket før måler ble skiftet. Noen tips hvor jeg skal begynne lete etter feil? Det kommer data til MQTT i HA når jeg lytter på emnet

Wrong values Aidon 6540

I get wrong values on power and current, I havn't measured what I use now, but I'm closer to 1700w than 17w
Using tibber pulse with MQTT

2022-10-03 15:23:00.486 DEBUG (MainThread) [custom_components.amshan.metercon] Got valid frame of expected length with correct checksum from topic pulse/publish: 7ea10b41088313fa7ce6e7000f4000000000010c020209060101000281ff0a0b4149444f4e5f5630303031020209060000600100ff0a1037333539393932393032303831323036020209060000600107ff0a0436353430020309060100010700ff060000001102020f00161b020309060100020700ff060000000002020f00161b020309060100030700ff060000000002020f00161d020309060100040700ff060000000f02020f00161d0203090601001f0700ff10000002020fff1621020309060100470700ff10000002020fff1621020309060100200700ff12094402020fff1623020309060100340700ff12094102020fff1623020309060100480700ff12094b02020fff16233cda7e
2022-10-03 15:23:00.497 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Aidon', 'list_ver_id': 'AIDON_V0001', 'meter_id': '7359992902081206', 'meter_type': '6540', 'active_power_import': 17, 'active_power_export': 0, 'reactive_power_import': 0, 'reactive_power_export': 15, 'current_l1': 0, 'current_l3': 0, 'voltage_l1': 237.2, 'voltage_l2': 236.9, 'voltage_l3': 237.9}
2022-10-03 15:23:00.497 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Aidon', 'list_ver_id': 'AIDON_V0001', 'meter_id': '7359992902081206', 'meter_type': '6540', 'active_power_import': 17, 'active_power_export': 0, 'reactive_power_import': 0, 'reactive_power_export': 15, 'current_l1': 0, 'current_l3': 0, 'voltage_l1': 237.2, 'voltage_l2': 236.9, 'voltage_l3': 237.9}
2022-10-03 15:23:00.498 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992902081206-voltage_l2 with state 236.9
2022-10-03 15:23:00.498 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992902081206-active_power_export with state 0
2022-10-03 15:23:00.499 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992902081206-meter_id with state 7359992902081206
2022-10-03 15:23:00.499 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992902081206-reactive_power_export with state 15
2022-10-03 15:23:00.499 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992902081206-current_l1 with state 0
2022-10-03 15:23:00.500 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992902081206-voltage_l1 with state 237.2
2022-10-03 15:23:00.500 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992902081206-meter_type with state 6540
2022-10-03 15:23:00.500 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992902081206-current_l3 with state 0
2022-10-03 15:23:00.501 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992902081206-reactive_power_import with state 0
2022-10-03 15:23:00.501 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992902081206-meter_manufacturer with state Aidon
2022-10-03 15:23:00.501 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992902081206-active_power_import with state 17
2022-10-03 15:23:00.501 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992902081206-list_ver_id with state AIDON_V0001
2022-10-03 15:23:00.502 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992902081206-voltage_l3 with state 237.9
2022-10-03 15:23:02.150 DEBUG (MainThread) [custom_components.amshan.metercon] Message with timestamp 2022-10-03 13:23:02.150718+00:00, QOS 0, retain flagg False, and payload length 44 received from topic pulse/publish from subscription to topic pulse/publish
2022-10-03 15:23:02.151 DEBUG (MainThread) [custom_components.amshan.metercon] Got valid frame of expected length with correct checksum from topic pulse/publish: 7ea02a410883130413e6e7000f40000000000101020309060100010700ff060000001102020f00161bb20d7e
2022-10-03 15:23:02.153 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Aidon', 'active_power_import': 17}
2022-10-03 15:23:02.154 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Aidon', 'active_power_import': 17}
2022-10-03 15:23:02.154 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992902081206-meter_manufacturer with state Aidon
2022-10-03 15:23:02.154 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992902081206-active_power_import with state 17

current
power

Sweden Aidon 6534

Hi

I have a Aidon 6534 that I would like to get working.
It´s getting data from a ESPHome with streamserver, per documentation.

On the ESP i have another reader for the AMS, i that way I can see it´s not updated in the same intervall.
(https://www.hjemmeautomasjon.no/forums/topic/5141-han-til-home-assistant-over-esphome/)

Version of the custom_component

Latest version of component - 2022.10.2

Configuration

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2023.2.5",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.10.7",
    "docker": true,
    "arch": "aarch64",
    "timezone": "Europe/Stockholm",
    "os_name": "Linux",
    "os_version": "5.15.84-v8",
    "supervisor": "2023.01.1",
    "host_os": "Home Assistant OS 9.5",
    "docker_version": "20.10.22",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {
    "hacs": {
      "version": "1.30.1",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "amshan": {
      "version": "2022.10.2",
      "requirements": [
        "amshan[serial]==2.0.5"
      ]
    },
  },
  "integration_manifest": {
    "domain": "amshan",
    "name": "AMS HAN meter",
    "version": "2022.10.2",
    "config_flow": true,
    "documentation": "https://github.com/toreamun/amshan-homeassistant",
    "issue_tracker": "https://github.com/toreamun/amshan-homeassistant/issues",
    "codeowners": [
      "@toreamun"
    ],
    "requirements": [
      "amshan[serial]==2.0.5"
    ],
    "after_dependencies": [
      "mqtt"
    ],
    "iot_class": "local_push",
    "is_built_in": false
  },
  "data": {
    "config_entry": {
      "entry_id": "089ae0560814395e6088d33a52f5fe93",
      "version": 3,
      "domain": "amshan",
      "title": "Aidon  (network)",
      "data": {
        "connection_type": "network_tcpip",
        "connection": {
          "host": "192.168.1.11",
          "port": 6638
        }
      },
      "options": {},
      "pref_disable_new_entities": false,
      "pref_disable_polling": false,
      "source": "user",
      "unique_id": null,
      "disabled_by": null
    }
  }
}

Describe the bug

Issue is that data is getting to HA, but sensor in HA seams not be updated in the same interval as on the ESPHome AMS sensor.
In the log there are gaps, see below.

I guess you whant to see the raw data, is it possibel to view this via Home Assistant? Have only remote access to the installation, at the moment.
I guess the issue can be both from the ESP device to HA and in HA.

Debug log

2023-02-20 11:53:12.054 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Aidon', 'active_power_import': 246}
2023-02-20 11:53:12.055 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Aidon', 'active_power_import': 246}
2023-02-20 11:53:12.057 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-meter_manufacturer with state Aidon
2023-02-20 11:53:12.058 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-active_power_import with state 246
2023-02-20 11:53:14.551 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Aidon', 'active_power_import': 245}
2023-02-20 11:53:14.552 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Aidon', 'active_power_import': 245}
2023-02-20 11:53:14.552 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-meter_manufacturer with state Aidon
2023-02-20 11:53:14.554 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-active_power_import with state 245
2023-02-20 11:53:17.049 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Aidon', 'active_power_import': 245}
2023-02-20 11:53:17.050 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Aidon', 'active_power_import': 245}
2023-02-20 11:53:17.050 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-meter_manufacturer with state Aidon
2023-02-20 11:53:17.051 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-active_power_import with state 245
2023-02-20 11:54:04.554 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Aidon', 'active_power_import': 244}
2023-02-20 11:54:04.554 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Aidon', 'active_power_import': 244}
2023-02-20 11:54:04.555 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-meter_manufacturer with state Aidon
2023-02-20 11:54:04.556 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-active_power_import with state 244
2023-02-20 13:16:52.400 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Aidon', 'active_power_import': 229}
2023-02-20 13:16:52.401 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Aidon', 'active_power_import': 229}
2023-02-20 13:16:52.402 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-meter_manufacturer with state Aidon
2023-02-20 13:16:52.402 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-active_power_import with state 229
2023-02-20 14:33:32.448 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Aidon', 'active_power_import': 268}
2023-02-20 14:33:32.449 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Aidon', 'active_power_import': 268}
2023-02-20 14:33:32.449 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-meter_manufacturer with state Aidon
2023-02-20 14:33:32.450 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-active_power_import with state 268
2023-02-20 14:34:52.446 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Aidon', 'active_power_import': 225}
2023-02-20 14:34:52.448 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Aidon', 'active_power_import': 225}
2023-02-20 14:34:52.449 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-meter_manufacturer with state Aidon
2023-02-20 14:34:52.449 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-active_power_import with state 225
2023-02-20 14:34:54.942 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Aidon', 'active_power_import': 225}
2023-02-20 14:34:54.943 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Aidon', 'active_power_import': 225}
2023-02-20 14:34:54.944 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-meter_manufacturer with state Aidon
2023-02-20 14:34:54.944 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-active_power_import with state 225
2023-02-20 14:34:57.444 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Aidon', 'active_power_import': 225}
2023-02-20 14:34:57.444 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Aidon', 'active_power_import': 225}
2023-02-20 14:34:57.445 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-meter_manufacturer with state Aidon
2023-02-20 14:34:57.446 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-active_power_import with state 225
2023-02-20 14:35:32.449 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Aidon', 'active_power_import': 222}
2023-02-20 14:35:32.450 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Aidon', 'active_power_import': 222}
2023-02-20 14:35:32.450 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-meter_manufacturer with state Aidon
2023-02-20 14:35:32.451 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-active_power_import with state 222
2023-02-20 14:35:34.946 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Aidon', 'active_power_import': 221}
2023-02-20 14:35:34.946 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Aidon', 'active_power_import': 221}
2023-02-20 14:35:34.947 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-meter_manufacturer with state Aidon
2023-02-20 14:35:34.948 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-active_power_import with state 221
2023-02-20 14:35:37.446 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Aidon', 'active_power_import': 221}
2023-02-20 14:35:37.446 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Aidon', 'active_power_import': 221}
2023-02-20 14:35:37.447 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-meter_manufacturer with state Aidon
2023-02-20 14:35:37.448 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-active_power_import with state 221
2023-02-20 14:38:12.451 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Aidon', 'active_power_import': 263}
2023-02-20 14:38:12.452 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Aidon', 'active_power_import': 263}
2023-02-20 14:38:12.453 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-meter_manufacturer with state Aidon
2023-02-20 14:38:12.454 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-active_power_import with state 263
2023-02-20 14:38:14.948 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Aidon', 'active_power_import': 263}
2023-02-20 14:38:14.949 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Aidon', 'active_power_import': 263}
2023-02-20 14:38:14.949 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-meter_manufacturer with state Aidon
2023-02-20 14:38:14.950 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-active_power_import with state 263
2023-02-20 15:29:04.979 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Aidon', 'active_power_import': 220}
2023-02-20 15:29:04.981 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Aidon', 'active_power_import': 220}
2023-02-20 15:29:04.982 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-meter_manufacturer with state Aidon
2023-02-20 15:29:04.983 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-active_power_import with state 220
2023-02-20 15:30:54.976 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Aidon', 'active_power_import': 220}
2023-02-20 15:30:54.977 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Aidon', 'active_power_import': 220}
2023-02-20 15:30:54.978 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-meter_manufacturer with state Aidon
2023-02-20 15:30:54.978 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-active_power_import with state 220
2023-02-20 15:30:57.477 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Aidon', 'active_power_import': 220}
2023-02-20 15:30:57.478 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Aidon', 'active_power_import': 220}
2023-02-20 15:30:57.478 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-meter_manufacturer with state Aidon
2023-02-20 15:30:57.479 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-active_power_import with state 220
2023-02-20 15:31:37.480 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Aidon', 'active_power_import': 717}
2023-02-20 15:31:37.480 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Aidon', 'active_power_import': 717}
2023-02-20 15:31:37.481 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-meter_manufacturer with state Aidon
2023-02-20 15:31:37.482 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Aidon-7359992905160861-active_power_import with state 717

Hourly usage is «off by one hour» compared to elhub.no

Version of the custom_component

v2022.10.2

Configuration

(This is from «Download diagnostics» on the integration, I can provide other configs if needed)

Configuration
{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2022.12.8",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.10.7",
    "docker": true,
    "arch": "aarch64",
    "timezone": "Europe/Oslo",
    "os_name": "Linux",
    "os_version": "5.15.76-v8",
    "supervisor": "2022.11.2",
    "host_os": "Home Assistant OS 9.4",
    "docker_version": "20.10.19",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {
    "nordpool": {
      "version": "0.0.9",
      "requirements": [
        "nordpool>=0.2"
      ]
    },
    "pyscript": {
      "version": "1.3.3",
      "requirements": [
        "croniter==1.3.4",
        "watchdog==2.1.6"
      ]
    },
    "amshan": {
      "version": "2022.10.2",
      "requirements": [
        "amshan[serial]==2.0.5"
      ]
    },
    "ics_calendar": {
      "version": "3.1.6",
      "requirements": [
        "ics>=0.7.2",
        "recurring_ical_events>=1.0.2b0",
        "icalendar>=4.1.0"
      ]
    },
    "hacs": {
      "version": "1.29.0",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    }
  },
  "integration_manifest": {
    "domain": "amshan",
    "name": "AMS HAN meter",
    "version": "2022.10.2",
    "config_flow": true,
    "documentation": "https://github.com/toreamun/amshan-homeassistant",
    "issue_tracker": "https://github.com/toreamun/amshan-homeassistant/issues",
    "codeowners": [
      "@toreamun"
    ],
    "requirements": [
      "amshan[serial]==2.0.5"
    ],
    "after_dependencies": [
      "mqtt"
    ],
    "iot_class": "local_push",
    "is_built_in": false
  },
  "data": {
    "config_entry": {
      "entry_id": "54d49b908b692129f9bb84c37b7195d0",
      "version": 3,
      "domain": "amshan",
      "title": "Kaifa  (mqtt)",
      "data": {
        "connection_type": "hass_mqtt",
        "connection": {
          "mqtt_topics": "pulse/publish"
        }
      },
      "options": {},
      "pref_disable_new_entities": false,
      "pref_disable_polling": false,
      "source": "user",
      "unique_id": null,
      "disabled_by": null
    }
  }
}

Describe the bug

It seems my hourly usage is off by one. Comparing my usage in HA Energy Dashboard towards elhub.no I consistently see hour N in HA is hour N-1 in elhub.no (e.g. hour 01.00-02.00 in HA is hour 00.00-01.00 in elhub.no). The actual values seems correct if I just shift everything one hour. I have attached screenshots from HA and elhub.no, and comparing the two graphs they are the same if we just skip the leftmost hour in HA.

If you give me any pointers on where to start and what to check, I’m happy to debug this myself (including code changes). I’m just not well versed enough in HA to know where to start looking and what could cause this.

Debug log

Debug log

This is the debug log from a reboot when amshan starts to load, and a minute or so in. I can provide longer logs if needed, but what came after this seemed to mostly repeat the patterns captured here.

2022-12-26 09:39:52.347 INFO (MainThread) [homeassistant.setup] Setting up amshan
2022-12-26 09:39:52.348 INFO (MainThread) [homeassistant.setup] Setup of domain amshan took 0.0 seconds
2022-12-26 09:39:52.390 DEBUG (MainThread) [custom_components.amshan.metercon] Try to subscribe to 1 MQTT topic(s): {'pulse/publish'}
2022-12-26 09:39:52.599 DEBUG (MainThread) [custom_components.amshan.metercon] Successfully subscribed to 1 MQTT topic(s): {'pulse/publish'}
2022-12-26 09:39:52.600 DEBUG (MainThread) [custom_components.amshan] Configured ConnectionType.MQTT receiver.
2022-12-26 09:39:52.608 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.amshan
2022-12-26 09:39:52.610 DEBUG (MainThread) [custom_components.amshan.sensor] Sensor async_setup_entry starting.
2022-12-26 09:39:52.610 DEBUG (MainThread) [custom_components.amshan.sensor] Sensor async_setup_entry ended.
2022-12-26 09:39:52.612 DEBUG (MainThread) [custom_components.amshan.sensor] Processing loop starting.
2022-12-26 09:39:52.613 DEBUG (MainThread) [custom_components.amshan] async_setup_entry complete.
2022-12-26 09:39:52.640 INFO (MainThread) [homeassistant.bootstrap] Home Assistant initialized in 52.65s
2022-12-26 09:39:52.640 INFO (MainThread) [homeassistant.core] Starting Home Assistant
2022-12-26 09:39:52.658 INFO (MainThread) [custom_components.hacs] Stage changed: startup
2022-12-26 09:39:52.712 WARNING (MainThread) [homeassistant.components.netatmo] Webhook not registered - https and port 443 is required to register the webhook
2022-12-26 09:39:52.792 INFO (MainThread) [custom_components.hacs] Loading removed repositories
2022-12-26 09:39:52.838 INFO (MainThread) [homeassistant.components.automation.julelys_pa] Initialized trigger Julelys på
2022-12-26 09:39:52.838 INFO (MainThread) [homeassistant.components.automation.julelys_av] Initialized trigger Julelys av
2022-12-26 09:39:52.838 INFO (MainThread) [homeassistant.components.automation.vaskeromsdor_apnet] Initialized trigger Vaskeromsdør åpnet
2022-12-26 09:39:52.838 INFO (MainThread) [homeassistant.components.automation.vaskeromsdor_lukket] Initialized trigger Vaskeromsdør lukket
2022-12-26 09:39:52.839 INFO (MainThread) [homeassistant.components.automation.panelovn_soverom_pa] Initialized trigger Panelovn soverom på
2022-12-26 09:39:52.839 INFO (MainThread) [homeassistant.components.automation.panelovn_soverom_av] Initialized trigger Panelovn soverom av
2022-12-26 09:39:52.839 INFO (MainThread) [homeassistant.components.automation.varmekabler_pa_billigste_8_timer] Initialized trigger Varmekabler bad på billigste 12 timer
2022-12-26 09:39:52.839 INFO (MainThread) [homeassistant.components.automation.varmekabler_av_dyreste_timer] Initialized trigger Varmekabler av dyreste timer
2022-12-26 09:39:52.839 INFO (MainThread) [homeassistant.components.automation.varmekabler_vaskerom_pa_billigste_12_timer] Initialized trigger Varmekabler vaskerom på billigste 12 timer
2022-12-26 09:39:53.090 INFO (MainThread) [custom_components.hacs] Loading known repositories
2022-12-26 09:39:57.231 DEBUG (MainThread) [custom_components.amshan.metercon] Message with timestamp 2022-12-26 08:39:57.230674+00:00, QOS 0, retain flagg False, and payload length 41 received from topic pulse/publish from subscription to topic pulse/publish
2022-12-26 09:39:57.232 DEBUG (MainThread) [custom_components.amshan.metercon] Got valid frame of expected length with correct checksum from topic pulse/publish: 7ea027010201105a87e6e7000f40000000090c07e60c1a01092736ff800000020106000011417d3e7e
2022-12-26 09:39:57.232 DEBUG (MainThread) [custom_components.amshan.metercon] Message with timestamp 2022-12-26 08:39:57.232594+00:00, QOS 0, retain flagg False, and payload length 41 received from topic pulse/publish from subscription to topic pulse/publish
2022-12-26 09:39:57.233 DEBUG (MainThread) [custom_components.amshan.metercon] Got valid frame of expected length with correct checksum from topic pulse/publish: 7ea027010201105a87e6e7000f40000000090c07e60c1a01092738ff80000002010600001146e3477e
2022-12-26 09:39:57.422 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Kaifa', 'meter_datetime': datetime.datetime(2022, 12, 26, 9, 39, 54), 'active_power_import': 4417}
2022-12-26 09:39:57.422 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Kaifa', 'meter_datetime': datetime.datetime(2022, 12, 26, 9, 39, 54), 'active_power_import': 4417}
2022-12-26 09:39:57.428 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Kaifa', 'meter_datetime': datetime.datetime(2022, 12, 26, 9, 39, 56), 'active_power_import': 4422}
2022-12-26 09:39:57.429 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Kaifa', 'meter_datetime': datetime.datetime(2022, 12, 26, 9, 39, 56), 'active_power_import': 4422}
2022-12-26 09:39:57.483 INFO (SyncWorker_1) [homeassistant.loader] Loaded ffmpeg from homeassistant.components.ffmpeg
2022-12-26 09:39:57.662 INFO (MainThread) [homeassistant.setup] Setting up ffmpeg
2022-12-26 09:39:57.833 INFO (MainThread) [homeassistant.setup] Setup of domain ffmpeg took 0.2 seconds
2022-12-26 09:39:58.829 DEBUG (MainThread) [custom_components.amshan.metercon] Message with timestamp 2022-12-26 08:39:58.828864+00:00, QOS 0, retain flagg False, and payload length 41 received from topic pulse/publish from subscription to topic pulse/publish
2022-12-26 09:39:58.830 DEBUG (MainThread) [custom_components.amshan.metercon] Got valid frame of expected length with correct checksum from topic pulse/publish: 7ea027010201105a87e6e7000f40000000090c07e60c1a0109273aff80000002010600001145c3777e
2022-12-26 09:39:58.870 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Kaifa', 'meter_datetime': datetime.datetime(2022, 12, 26, 9, 39, 58), 'active_power_import': 4421}
2022-12-26 09:39:58.871 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Kaifa', 'meter_datetime': datetime.datetime(2022, 12, 26, 9, 39, 58), 'active_power_import': 4421}
2022-12-26 09:39:58.887 INFO (MainThread) [custom_components.hacs] Starting recurring background task for downloaded repositories
2022-12-26 09:39:58.889 INFO (MainThread) [custom_components.hacs] Stage changed: running
2022-12-26 09:40:00.733 DEBUG (MainThread) [custom_components.amshan.metercon] Message with timestamp 2022-12-26 08:40:00.733791+00:00, QOS 0, retain flagg False, and payload length 123 received from topic pulse/publish from subscription to topic pulse/publish
2022-12-26 09:40:00.735 DEBUG (MainThread) [custom_components.amshan.metercon] Got valid frame of expected length with correct checksum from topic pulse/publish: 7ea079010201108093e6e7000f40000000090c07e60c1a01092800ff800000020d09074b464d5f30303109103639373036333134303630323134383509084d41333034483345060000152b060000000006000000000600000217060000053106000058d6060000553106000009260600000000060000091823c47e
2022-12-26 09:40:00.747 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Kaifa', 'meter_datetime': datetime.datetime(2022, 12, 26, 9, 40), 'list_ver_id': 'KFM_001', 'meter_id': '6970631406021485', 'meter_type': 'MA304H3E', 'active_power_import': 5419, 'active_power_export': 0, 'reactive_power_import': 0, 'reactive_power_export': 535, 'current_l1': 1.329, 'current_l2': 22.742, 'current_l3': 21.809, 'voltage_l1': 234.2, 'voltage_l2': 0.0, 'voltage_l3': 232.8}
2022-12-26 09:40:00.747 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Kaifa', 'meter_datetime': datetime.datetime(2022, 12, 26, 9, 40), 'list_ver_id': 'KFM_001', 'meter_id': '6970631406021485', 'meter_type': 'MA304H3E', 'active_power_import': 5419, 'active_power_export': 0, 'reactive_power_import': 0, 'reactive_power_export': 535, 'current_l1': 1.329, 'current_l2': 22.742, 'current_l3': 21.809, 'voltage_l1': 234.2, 'voltage_l2': 0.0, 'voltage_l3': 232.8}
2022-12-26 09:40:00.748 DEBUG (MainThread) [custom_components.amshan.sensor] Ignore unhandled measure_id meter_datetime
2022-12-26 09:40:00.748 DEBUG (MainThread) [custom_components.amshan.sensor] Register new entities for measures: ['reactive_power_import_total', 'meter_id', 'list_ver_id', 'voltage_l2', 'current_l3', 'active_power_export', 'current_l2', 'voltage_l1', 'reactive_power_export', 'active_power_import', 'active_power_export_total', 'reactive_power_export_total', 'reactive_power_import', 'meter_manufacturer', 'active_power_import_total', 'voltage_l3', 'meter_type', 'current_l1']
2022-12-26 09:40:00.861 DEBUG (MainThread) [custom_components.amshan.sensor] Restored state from 2022-12-25 22:00:11.218224+00:00 for sensor Kaifa-6970631406021485-reactive_power_import_total is too old to be used
2022-12-26 09:40:00.862 DEBUG (MainThread) [custom_components.amshan.sensor] Restored state from 2022-12-25 22:00:11.217764+00:00 for sensor Kaifa-6970631406021485-active_power_export_total is too old to be used
2022-12-26 09:40:00.863 DEBUG (MainThread) [custom_components.amshan.sensor] Use restored state from 2022-12-26 08:00:10.636371+00:00 for sensor Kaifa-6970631406021485-reactive_power_export_total
2022-12-26 09:40:00.863 DEBUG (MainThread) [custom_components.amshan.sensor] Use restored state from 2022-12-26 08:00:10.636714+00:00 for sensor Kaifa-6970631406021485-active_power_import_total
2022-12-26 09:40:02.099 DEBUG (MainThread) [custom_components.amshan.metercon] Message with timestamp 2022-12-26 08:40:02.098956+00:00, QOS 0, retain flagg False, and payload length 41 received from topic pulse/publish from subscription to topic pulse/publish
2022-12-26 09:40:02.101 DEBUG (MainThread) [custom_components.amshan.metercon] Got valid frame of expected length with correct checksum from topic pulse/publish: 7ea027010201105a87e6e7000f40000000090c07e60c1a01092802ff80000002010600001144e5677e
2022-12-26 09:40:02.107 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Kaifa', 'meter_datetime': datetime.datetime(2022, 12, 26, 9, 40, 2), 'active_power_import': 4420}
2022-12-26 09:40:02.109 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Kaifa', 'meter_datetime': datetime.datetime(2022, 12, 26, 9, 40, 2), 'active_power_import': 4420}
2022-12-26 09:40:02.110 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Kaifa-6970631406021485-active_power_import with state 4420
2022-12-26 09:40:02.111 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Kaifa-6970631406021485-meter_manufacturer with state Kaifa
2022-12-26 09:40:04.067 DEBUG (MainThread) [custom_components.amshan.metercon] Message with timestamp 2022-12-26 08:40:04.067693+00:00, QOS 0, retain flagg False, and payload length 41 received from topic pulse/publish from subscription to topic pulse/publish
2022-12-26 09:40:04.069 DEBUG (MainThread) [custom_components.amshan.metercon] Got valid frame of expected length with correct checksum from topic pulse/publish: 7ea027010201105a87e6e7000f40000000090c07e60c1a01092804ff800000020106000011394ac87e
2022-12-26 09:40:04.077 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Kaifa', 'meter_datetime': datetime.datetime(2022, 12, 26, 9, 40, 4), 'active_power_import': 4409}
2022-12-26 09:40:04.077 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Kaifa', 'meter_datetime': datetime.datetime(2022, 12, 26, 9, 40, 4), 'active_power_import': 4409}
2022-12-26 09:40:04.077 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Kaifa-6970631406021485-active_power_import with state 4409
2022-12-26 09:40:04.078 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Kaifa-6970631406021485-meter_manufacturer with state Kaifa
2022-12-26 09:40:06.336 DEBUG (MainThread) [custom_components.amshan.metercon] Message with timestamp 2022-12-26 08:40:06.336474+00:00, QOS 0, retain flagg False, and payload length 41 received from topic pulse/publish from subscription to topic pulse/publish
2022-12-26 09:40:06.338 DEBUG (MainThread) [custom_components.amshan.metercon] Got valid frame of expected length with correct checksum from topic pulse/publish: 7ea027010201105a87e6e7000f40000000090c07e60c1a01092806ff8000000201060000113878db7e
2022-12-26 09:40:06.347 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Kaifa', 'meter_datetime': datetime.datetime(2022, 12, 26, 9, 40, 6), 'active_power_import': 4408}
2022-12-26 09:40:06.347 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Kaifa', 'meter_datetime': datetime.datetime(2022, 12, 26, 9, 40, 6), 'active_power_import': 4408}
2022-12-26 09:40:06.348 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Kaifa-6970631406021485-active_power_import with state 4408
2022-12-26 09:40:06.349 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Kaifa-6970631406021485-meter_manufacturer with state Kaifa
2022-12-26 09:40:07.492 INFO (MainThread) [homeassistant.components.light] Setting up light.twinkly
2022-12-26 09:40:07.496 INFO (MainThread) [homeassistant.components.light] Setting up light.twinkly
2022-12-26 09:40:07.616 INFO (MainThread) [homeassistant.components.twinkly.light] Twinkly '192.168.1.26' is now available
2022-12-26 09:40:07.630 INFO (MainThread) [homeassistant.components.twinkly.light] Twinkly '192.168.1.35' is now available
2022-12-26 09:40:08.005 DEBUG (MainThread) [custom_components.amshan.metercon] Message with timestamp 2022-12-26 08:40:08.005417+00:00, QOS 0, retain flagg False, and payload length 41 received from topic pulse/publish from subscription to topic pulse/publish
2022-12-26 09:40:08.007 DEBUG (MainThread) [custom_components.amshan.metercon] Got valid frame of expected length with correct checksum from topic pulse/publish: 7ea027010201105a87e6e7000f40000000090c07e60c1a01092808ff80000002010600001134351c7e
2022-12-26 09:40:08.015 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Kaifa', 'meter_datetime': datetime.datetime(2022, 12, 26, 9, 40, 8), 'active_power_import': 4404}
2022-12-26 09:40:08.016 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Kaifa', 'meter_datetime': datetime.datetime(2022, 12, 26, 9, 40, 8), 'active_power_import': 4404}
2022-12-26 09:40:08.016 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Kaifa-6970631406021485-active_power_import with state 4404
2022-12-26 09:40:08.017 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Kaifa-6970631406021485-meter_manufacturer with state Kaifa
2022-12-26 09:40:10.330 DEBUG (MainThread) [custom_components.amshan.metercon] Message with timestamp 2022-12-26 08:40:10.330644+00:00, QOS 0, retain flagg False, and payload length 398 received from topic pulse/publish from subscription to topic pulse/publish
2022-12-26 09:40:10.335 DEBUG (MainThread) [custom_components.amshan.metercon] Ignore JSON in payload without HDLC framing from topic pulse/publish: {'status': {'rssi': -65, 'ch': 6, 'ssid': '42-IoT', 'usbV': '1.35', 'Vin': '14.34', 'Vcap': '4.43', 'Vbck': '4.56', 'Build': '1.1.10', 'Hw': 'F', 'bssid': '245a4c1c2bcd', 'ID': 'fcf5c45540bc', 'Uptime': 471840, 'mqttcon': 0, 'pubcnt': 60, 'rxcnt': 60, 'wificon': 0, 'wififail': 0, 'bits': 68, 'cSet': 103, 'Ic': 0.0, 'crcerr': 0, 'cAx': 1.041766, 'cB': 14, 'heap': 212120, 'baud': 2400, 'meter': 'Kaifa', 'ntc': 22.07, 's/w': 0.0, 'ct': 0, 'dtims': 1214}}
2022-12-26 09:40:10.622 DEBUG (MainThread) [custom_components.amshan.metercon] Message with timestamp 2022-12-26 08:40:10.622287+00:00, QOS 0, retain flagg False, and payload length 123 received from topic pulse/publish from subscription to topic pulse/publish
2022-12-26 09:40:10.624 DEBUG (MainThread) [custom_components.amshan.metercon] Got valid frame of expected length with correct checksum from topic pulse/publish: 7ea079010201108093e6e7000f40000000090c07e60c1a0109280aff800000020d09074b464d5f30303109103639373036333134303630323134383509084d4133303448334506000011330600000000060000000006000002120600000526060000499506000045ff06000009260600000000060000091b12877e
2022-12-26 09:40:10.630 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Kaifa', 'meter_datetime': datetime.datetime(2022, 12, 26, 9, 40, 10), 'list_ver_id': 'KFM_001', 'meter_id': '6970631406021485', 'meter_type': 'MA304H3E', 'active_power_import': 4403, 'active_power_export': 0, 'reactive_power_import': 0, 'reactive_power_export': 530, 'current_l1': 1.318, 'current_l2': 18.837, 'current_l3': 17.919, 'voltage_l1': 234.2, 'voltage_l2': 0.0, 'voltage_l3': 233.1}
2022-12-26 09:40:10.631 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Kaifa', 'meter_datetime': datetime.datetime(2022, 12, 26, 9, 40, 10), 'list_ver_id': 'KFM_001', 'meter_id': '6970631406021485', 'meter_type': 'MA304H3E', 'active_power_import': 4403, 'active_power_export': 0, 'reactive_power_import': 0, 'reactive_power_export': 530, 'current_l1': 1.318, 'current_l2': 18.837, 'current_l3': 17.919, 'voltage_l1': 234.2, 'voltage_l2': 0.0, 'voltage_l3': 233.1}
2022-12-26 09:40:10.631 DEBUG (MainThread) [custom_components.amshan.sensor] Ignore unhandled measure_id meter_datetime
2022-12-26 09:40:10.631 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Kaifa-6970631406021485-meter_id with state 6970631406021485
2022-12-26 09:40:10.631 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Kaifa-6970631406021485-list_ver_id with state KFM_001
2022-12-26 09:40:10.632 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Kaifa-6970631406021485-voltage_l2 with state 0.0
2022-12-26 09:40:10.632 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Kaifa-6970631406021485-current_l3 with state 17.919
2022-12-26 09:40:10.633 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Kaifa-6970631406021485-active_power_export with state 0
2022-12-26 09:40:10.633 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Kaifa-6970631406021485-current_l2 with state 18.837
2022-12-26 09:40:10.633 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Kaifa-6970631406021485-voltage_l1 with state 234.2
2022-12-26 09:40:10.634 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Kaifa-6970631406021485-reactive_power_export with state 530
2022-12-26 09:40:10.635 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Kaifa-6970631406021485-active_power_import with state 4403
2022-12-26 09:40:10.636 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Kaifa-6970631406021485-reactive_power_import with state 0
2022-12-26 09:40:10.636 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Kaifa-6970631406021485-meter_manufacturer with state Kaifa
2022-12-26 09:40:10.636 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Kaifa-6970631406021485-voltage_l3 with state 233.1
2022-12-26 09:40:10.637 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Kaifa-6970631406021485-meter_type with state MA304H3E
2022-12-26 09:40:10.637 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Kaifa-6970631406021485-current_l1 with state 1.318
2022-12-26 09:40:12.291 DEBUG (MainThread) [custom_components.amshan.metercon] Message with timestamp 2022-12-26 08:40:12.291324+00:00, QOS 0, retain flagg False, and payload length 41 received from topic pulse/publish from subscription to topic pulse/publish
2022-12-26 09:40:12.292 DEBUG (MainThread) [custom_components.amshan.metercon] Got valid frame of expected length with correct checksum from topic pulse/publish: 7ea027010201105a87e6e7000f40000000090c07e60c1a0109280cff80000002010600001136513a7e
2022-12-26 09:40:12.302 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Kaifa', 'meter_datetime': datetime.datetime(2022, 12, 26, 9, 40, 12), 'active_power_import': 4406}
2022-12-26 09:40:12.302 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Kaifa', 'meter_datetime': datetime.datetime(2022, 12, 26, 9, 40, 12), 'active_power_import': 4406}
2022-12-26 09:40:12.302 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Kaifa-6970631406021485-active_power_import with state 4406
2022-12-26 09:40:12.303 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Kaifa-6970631406021485-meter_manufacturer with state Kaifa
2022-12-26 09:40:14.260 DEBUG (MainThread) [custom_components.amshan.metercon] Message with timestamp 2022-12-26 08:40:14.260441+00:00, QOS 0, retain flagg False, and payload length 41 received from topic pulse/publish from subscription to topic pulse/publish
2022-12-26 09:40:14.262 DEBUG (MainThread) [custom_components.amshan.metercon] Got valid frame of expected length with correct checksum from topic pulse/publish: 7ea027010201105a87e6e7000f40000000090c07e60c1a0109280eff8000000201060000113a86f27e
2022-12-26 09:40:14.268 DEBUG (MainThread) [custom_components.amshan.sensor] Decoded meter message: {'meter_manufacturer': 'Kaifa', 'meter_datetime': datetime.datetime(2022, 12, 26, 9, 40, 14), 'active_power_import': 4410}
2022-12-26 09:40:14.269 DEBUG (MainThread) [custom_components.amshan.sensor] Received meter measures: {'meter_manufacturer': 'Kaifa', 'meter_datetime': datetime.datetime(2022, 12, 26, 9, 40, 14), 'active_power_import': 4410}
2022-12-26 09:40:14.269 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Kaifa-6970631406021485-active_power_import with state 4410
2022-12-26 09:40:14.270 DEBUG (MainThread) [custom_components.amshan.sensor] Update sensor Kaifa-6970631406021485-meter_manufacturer with state Kaifa

Screenshot 2022-12-26 at 09 23 49

Screenshot 2022-12-26 at 09 24 09

AmsToMqttBridge og MQTT

Jeg får ikke fullført konfigurasjonen AMSHAN. Den ender i timeout etter at jeg har lagt inn mqtt topic

Jeg bruker AmsToMqttBridge (samme som amsleser.no benytter seg av) og er på fw v2.1.1
Der benytter jeg meg av MQTT payload Raw data (bytes).

Til info, så har jeg enfase, og ikke den mer normale tre fase inn i bo enheten min. Det kan om mulig endre litt på melding som blir sendt ut fra HAN porten?

Her er et utklipp av homeassistant loggen:
2022-04-18 14:28:02 DEBUG (MainThread) [custom_components.amshan.metercon] Got payload without HDLC framing from topic power_ams: 37454130424132423231313345444141453645373030304630303030303030303043303745363034313230313044314330304646383030303030303231393041304534423631364437333734373237353730354635363330333033303331303930363031303130303030303546463041313033353337333033363335333633373332333733313335333333333332333033373039303630313031363030313031464630413132333633383336333133313331333134323445333233343332333133303331333033343330303930363031303130313037303046463036303030303031384330393036303130313032303730304646303630303030303030303039303630313031303330373030464630363030303030303030303930363031303130343037303046463036303030303030373230393036303130313146303730304646303630303030303044313030303030303030303930363031303132303037303046463132303045303030303030303030323331413745

Manufacturer is missing from entity_id from release 2021.12.3

Entity_id of the integration has historically been prefixed with manufacturer and should still be. This was changed by a mistake when the name was changed not to include manufacturer as part of using a SensorEntityDescription base class in release 2021.12.3. See commit f43b2f3

This issue affects new installations.

Verdier som sendes fra måler akkumulert hver time bør lagres

Verdier som sendes fra måler akkumulert hver time bør lagres slik at de kan benyttes med omstart uten å måtte vente inntil 1 time på ny måling. Når verdiene hentes frem ved oppstart må det sjekkes at verdiene ikke er foreldet før de kan benyttes.

Følgende sendes kun hver time:

  • Cumulative hourly active import energy (A+) (Q1+Q4)
  • Cumulative hourly active export energy (A-)( Q2+Q3)
  • Cumulative hourly reactive import energy (R+) ( Q1+Q2)
  • Cumulative hourly reactive export energy (R-) (Q3+Q4)

Støtte for å motta data fra MQTT (Tibber etc.)

Den finnes noen AMS han-port adaptere som videresender data til MQTT (f.eks Tibber Pulse). Ved å støtte å motta data fra MQTT i tillegg til serieport og TCP/IP vil også integrasjonen kunne benyttes med slike adaptere.

Implementasjonen bør støtte å lese binære data både med og uten HDLC-frame (flag-sequence, header, checksum etc).

Se https://github.com/iotux/ElWiz#oppsett-av-pulse for konfigurering av MQTT for Tibber Pulse.

MQTT timeout when configuring integration

I'm trying to enable the integration, (version 2022.4.0) using Ams2MQTTBridge 2.1.7.

I have configured my Ams reader to send Raw data (bytes) and see the data coming in every couple of seconds, like this:

amsleser 0101020309060100010700FF0600000AE002020F00161B
amsleser 0101020309060100010700FF0600000AD602020F00161B
amsleser 0101020309060100010700FF0600000AE002020F00161B
amsleser 0109020209060101000281FF0A0B4149444F4E5F5630303031020209060000600100FF0A1037333539393932383939343832303535020209060000600107FF0A0436353135020309060100010700FF0600000ADC02020F00161B020309060100020700FF060000000002020F00161B020309060100030700FF060000000002020F00161D020309060100040700FF060000007402020F00161D0203090601001F0700FF10007602020FFF1621020309060100200700FF12094302020FFF1623
amsleser 0101020309060100010700FF0600000ADA02020F00161B
amsleser 0101020309060100010700FF0600000ADC02020F00161B
amsleser 0101020309060100010700FF0600000AEA02020F00161B
amsleser 0109020209060101000281FF0A0B4149444F4E5F5630303031020209060000600100FF0A1037333539393932383939343832303535020209060000600107FF0A0436353135020309060100010700FF0600000AE802020F00161B020309060100020700FF060000000002020F00161B020309060100030700FF060000000002020F00161D020309060100040700FF060000007602020F00161D0203090601001F0700FF10007602020FFF1621020309060100200700FF12094902020FFF1623
amsleser 0101020309060100010700FF0600000AF202020F00161B

But when trying to add the integration I get a timeout while waiting for MQTT topic:

Screenshot from 2022-10-01 13-07-27

I have been using the reader for a long time using MQTT "raw values" and an integration sensor. That is working just fine, but using this integration seems to be an even better solution.

Power factor as separate sensor?

I have just reconfigured my Tibber Pulse to publish to my own MQTT server, and started using the amshan integration in HA.

When I accessed the data from the Pulse via the HA Tibber integration, I also had access to the power factor (aka cos(ϕ)), but that value is not reported by the amshan integration. The power factor is useful e.g. in order to estimate the L2 current, which is not reported by the Aidon.

From the sensors I have available, it seems the power factor can be calculated as math.cos(math.atan( sensor.aidon_reactive_power_export / sensor.aidon_active_power_import )) (if there's only resistive load, the factor should be 1.0).

I'm not an electrician, so I don't understand why the nominator would be export while the denominator would be import. But the sensor.aidon_reactive_power_import is just 0.

If the calculation of the power factor is correct, maybe it could be made available as a sensor as well?

Støtte for svenske AMS målere

Sverige er i ferd med å fase inn AMS-målere. Energiföretagen har laget Branschrekommendation för lokalt kundgränssnitt för elmätare.

Aidon sin spesifikasjon er publisert.

Tibber Pulse har støtte for flere svenske målere. Spesifikasjonen for Aidon er tilgjengelig. Det hadde vært veldig nyttig å få tak i spesifikasjonen for Kaifa/Nuri, Kamstrup, Landis+Gyr/Embriq og eventuelle andre svenske målere.

Hjelpe til testing og testdata fra noen med svensk måler hadde også vært veldig nyttig. Det er også nødvendig med en svenskspråklig som kan oversette https://github.com/toreamun/amshan-homeassistant/blob/master/custom_components/amshan/translations/en.json

Change how entity id is created

Entity ID is now based on entity name. This is a too strong binding that makes it difficult to change names. This also makes entity id a bit long in some cases.

Entity id should be based on meter manufacturer and measure id.

Existing sensor entity id should be migrated at startup using HA entity migration functionality.

Unit measurement log warnings

I have been getting these Warnings in the log for some reason. Not sure if its a known issue or not.

`
Logger: homeassistant.components.sensor
Source: components/sensor/init.py:980
Integration: Sensor (documentation, issues)
First occurred: January 26, 2023 at 16:48:53 (8 occurrences)
Last logged: January 26, 2023 at 16:48:53

Entity sensor.ams_han_pf2 (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using native unit of measurement '' which is not a valid unit for the device class ('power_factor') it is using; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+mqtt%22
Entity sensor.ams_han_pf1 (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using native unit of measurement '' which is not a valid unit for the device class ('power_factor') it is using; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+mqtt%22
Entity sensor.ams_han_pf (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using native unit of measurement '' which is not a valid unit for the device class ('power_factor') it is using; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+mqtt%22
Entity sensor.ams_han_qo (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using native unit of measurement 'VAr' which is not a valid unit for the device class ('reactive_power') it is using; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+mqtt%22
Entity sensor.ams_han_q (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using native unit of measurement 'VAr' which is not a valid unit for the device class ('reactive_power') it is using; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+mqtt%22
`

AMSHAN Stopped Working after update to Home Assistant 2023.6.0

AMSHAN Stopped Working after update to Home Assistant 2023.6.0

2023-06-08 14:17:46.806 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/han/meter_connection.py", line 353, in connect_loop
await wait(
File "/usr/local/lib/python3.11/asyncio/tasks.py", line 415, in wait
raise TypeError("Passing coroutines is forbidden, use tasks explicitly.")
TypeError: Passing coroutines is forbidden, use tasks explicitly.
2023-06-08 14:17:46.817 WARNING (MainThread) [py.warnings] /usr/local/lib/python3.11/asyncio/base_events.py:1907: RuntimeWarning: coroutine 'Event.wait' was never awaited
handle = self._ready.popleft()
2023-06-08 14:17:46.829 WARNING (MainThread) [py.warnings] /usr/local/lib/python3.11/asyncio/base_events.py:1907: RuntimeWarning: coroutine 'ConnectionManager._try_connect' was never awaited
handle = self._ready.popleft()

Cannot setup with socat

Version of the custom_component

amshan 2021.8.0
HA 2021.8.0

HW (/dev/ttyUSB0): https://www.aliexpress.com/item/32719562958.html?spm=a2g0s.9042311.0.0.c8314c4dpbv1pv

Add your logs here.

GUI configuration:
https://www.jottacloud.com/s/00643aade031e2a4226b56ba0c793a0c52c

Followed by:

2021-08-06 22:17:59 INFO (MainThread) [amshan.meter_connection[] SmartMeterFrameContentProtocol[3]: Smart meter connected to host 192.168.69.107 and port 1234

PS: no debug logs even with config:

logger:
  default: info
  logs:
    homeassistant.components.zwave_js: debug
    custom_components.amshan: debug

Describe the bug

Am i using socat wrong? Ive tried multiple combinations but the component fails to succeed.

root@rpi-zero:~# socat /dev/ttyUSB0,b57600,rawer TCP-LISTEN:1234,reuseaddr
2021/08/06 22:14:00 socat[20415] E write(7, 0x196b2a8, 1): Broken pipe
root@rpi-zero:~# socat /dev/ttyUSB0,b115200,raw TCP-LISTEN:1234,reuseaddr
2021/08/06 22:14:30 socat[20486] E write(7, 0x19562a8, 1): Broken pipe
root@rpi-zero:~# socat -d tcp-listen:1234,fork /dev/ttyUSB0,raw,echo=0,b115200
2021/08/06 22:16:30 socat[20653] E write(6, 0x4842f0, 1): Broken pipe

Measurement during power outage not correct

Version of the custom_component

2022.10.2

Configuration

I can't find any configuration file in the amshan folder that is not "default". What configuration is expected to be listed here?

Describe the bug

When there is a power outage, my Home Assistant server will continue to run as it is installed on my NAS that has a UPS backup. The connection to the power meter HAN port is through a standard FTDI USB-to-serial cable with some basic interface electronics. During a power outage, the amshan integration reports a consumption of 4046W:
bild

Debug log

I don't have any logs at this moment, the plan is to "force" the issue by turning off the main power and get debug logs, at some time when I feel like it. 🙂

TCP port number range should be 0-65535

TCP port numbers are represented by a 16-bit unsigned integer (0-65535). amshan incorrectly uses 65353 as the upper limit.

Version of the custom_component

Configuration

Add your logs here.

Describe the bug

A clear and concise description of what the bug is.

Debug log


Add your logs here.

Could not decode meter message

The sensor for current consumption keeps dropping out (unavailable), and the logs are flooded with errors saying it cannot decode meter message. I'm using a Tibber Pulse.

Version of the custom_component

2022.10.2

Configuration

Where can I find the yaml configurations??

Describe the bug

The debug log is full of warnings from amshan that it cannot decode meter message. It seems that the same meter messages are repeated thoughout the warnings.

It seems it cannot receive all consumption calls, because accumulated consumption calculated from consumption reported from the Tibber Pulse is far lower than actual consumption from Elvia app.



## Debug log


2022-12-10 13:52:41.315 WARNING (MainThread) [custom_components.amshan.sensor] Could not decode meter message: 44656275673a2043617020766f6c7461676520637269746963616c21
2022-12-10 13:53:24.094 WARNING (MainThread) [custom_components.amshan.sensor] Could not decode meter message: 44656275673a205769466920707320656e61626c6564
2022-12-10 13:53:58.252 WARNING (MainThread) [custom_components.amshan.sensor] Could not decode meter message: 44656275673a2043617020766f6c74616765206c6f7721
2022-12-10 13:54:11.165 WARNING (MainThread) [custom_components.amshan.sensor] Could not decode meter message: 44656275673a2043617020766f6c7461676520637269746963616c21
2022-12-10 13:54:53.565 WARNING (MainThread) [custom_components.amshan.sensor] Could not decode meter message: 44656275673a205769466920707320656e61626c6564
2022-12-10 13:55:26.394 WARNING (MainThread) [custom_components.amshan.sensor] Could not decode meter message: 44656275673a2043617020766f6c74616765206c6f7721
2022-12-10 13:55:41.875 WARNING (MainThread) [custom_components.amshan.sensor] Could not decode meter message: 44656275673a2043617020766f6c7461676520637269746963616c21

Support new reactive power device class and var unit

HA 2022.2 adds a device class for reactive power and a new unit type var.

Reactive power sensors currently uses device class power and unit kvar. These sensors should be changed to use SensorDeviceClass.REACTIVE_POWER and POWER_VOLT_AMPERE_REACTIVE. Sensor configuration should be migrated.

Scale factor

Thanks for a great plugin, this is by far the cleanest AMS HAN solution I have looked at.

In my home, the Energy Meter (a Aidon 6540) is not connected directly to main power, but through a current transformer with a reduction factor of 50. I believe this setup is common when you have a large main fuse (in my case 125A).

The data output of the HAN port is also reduced by a factor of 50.

Is it possible to add a config variable for scaling the data that is read, this has to be done for all currents, power and energy measurements?

Thanks,
Magnus

Integration hangs at startup after MQTT setup

Integration may sometime "hang" at startup after MQTT has been successfully added. The integration will continue as normal if restarted.

This seems to be an issue related to HASS MQTT. No messages are received from the topic by the integration. Messages are received as normal by the MQTT integration (received messages are not visible in the listen to topic debug panel in MQTT config due to a bug in MQTT integration when displaying binary messages, but can be seen as a warning from MQTT in the log).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.