toreamun / amshan-homeassistant

Home Assistant integrasjon for strømmålere (AMS/HAN/P1). Integrasjonen støter både streaming (serieport/TCP-IP) og MQTT (Tibber Pulse, energyintelligence.se etc)
MIT License
146 stars 9 forks source link

Sweden Aidon 6534 #61

Closed karllinder closed 1 year ago

karllinder commented 1 year ago

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
Gartom commented 1 year ago

Did you solve this or do you still have issues? I also have an Aidon 6534 with the Aidon 6442 s HAN interface and my setup is working, using a standard FDTI USB-to-serial cable connected to my NAS that is hosting my Home Assistant server.

karllinder commented 1 year ago

Hi!

I have an ESPHome that runs a serial to tcp forwarder, guess that is causing the issue. And from ESPHome version 2023.07 it did completely stop. I guess I have to do a different set-up with serial cable to solve this. Thanks, closing this case.