danielperna84 / hahomematic

Python 3 Interface for Home Assistant to interact with HomeMatic devices
MIT License
136 stars 21 forks source link

CCU sensors sometimes unavailable after HA restart #437

Closed breti closed 2 years ago

breti commented 2 years ago

DONT'T DELETE THIS. Please answer all questions as good as possible.

Make sure you have read the documentation at https://github.com/danielperna84/custom_homematic#custom_homematic.

Make sure you are running the latest version of hahomematic or it's custom_component (and Home Assistant) before reporting an issue.

custom_component/hahomematic version (if applicable): 1.2.2

Home Assistant version (if applicable): 2022.5.1

CCU version:

Problem-relevant configuration:

Do you use tls? n Do you use callback? n Do you use username and password? y Which interfaces do you use? BidCoS-RF

Describe the bug A clear and concise description of what the bug is.

Sometimes after restarting Home Assistant all CCU sensors (number of service messages, number of alarms, duty cycle etc.) are "unavailable". Everything else works - I can control actuators and get values from sensors like door contacts.

The whole thing has occurred several times with different versions, but is not really reproducible. Currently the error exists again after I updated from HA 2022.5.0 to 2022.5.1 yesterday. Is there any information I can collect that can be helpful in debugging before I restart HA?

In the log I do not see any messages from the Homematic component.

To Reproduce random after restart of HA

Screenshots (if applicable)

grafik

grafik

Relevant HA log entries (full log) There's nothing logged related to HM

Diagnostic Information (available on every device)

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2022.5.1",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.9.9",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Berlin",
    "os_name": "Linux",
    "os_version": "5.10.108",
    "supervisor": "2022.05.0",
    "host_os": "Home Assistant OS 7.6",
    "docker_version": "20.10.9",
    "chassis": "vm",
    "run_as_root": true
  },
  "custom_components": {
    "dwd_weather": {
      "version": "1.2.19",
      "requirements": [
        "simple_dwd_weatherforecast==1.1.2",
        "markdownify==0.6.5"
      ]
    },
    "homematicip_local": {
      "version": "1.2.2",
      "requirements": [
        "hahomematic==1.2.2"
      ]
    },
    "xiaomi_cloud_map_extractor": {
      "version": "v2.1.5",
      "requirements": [
        "pillow",
        "pybase64",
        "python-miio",
        "requests",
        "pycryptodome"
      ]
    },
    "scheduler": {
      "version": "v0.0.0",
      "requirements": []
    },
    "hacs": {
      "version": "1.24.5",
      "requirements": [
        "aiogithubapi>=21.11.0"
      ]
    },
    "onkyo": {
      "version": "2021.10.5",
      "requirements": [
        "onkyo-eiscp==1.2.7"
      ]
    },
    "frontier_silicon": {
      "version": "2022.3.3",
      "requirements": [
        "afsapi==0.2.3rc2"
      ]
    },
    "smartthinq_sensors": {
      "version": "0.12.12",
      "requirements": [
        "pycountry>=20.7.3",
        "xmltodict>=0.12.0"
      ]
    },
    "presence_simulation": {
      "version": "1.16",
      "requirements": []
    },
    "browser_mod": {
      "version": "1.5.3",
      "requirements": []
    },
    "fontawesome": {
      "version": "2.1.5",
      "requirements": []
    },
    "emulated_hue": {
      "version": "2022.4.0",
      "requirements": [
        "aiohttp_cors==0.7.0"
      ]
    },
    "simpleicons": {
      "version": "v2.0.0",
      "requirements": [
        "simpleicons==6.16.0"
      ]
    }
  },
  "integration_manifest": {
    "domain": "homematicip_local",
    "name": "Homematic(IP) Local",
    "config_flow": true,
    "documentation": "https://github.com/danielperna84/custom_homematic",
    "issue_tracker": "https://github.com/danielperna84/hahomematic/issues",
    "requirements": [
      "hahomematic==1.2.2"
    ],
    "ssdp": [
      {
        "manufacturer": "EQ3",
        "manufacturerURL": "http://www.homematic.com"
      }
    ],
    "zeroconf": [],
    "homekit": {},
    "dependencies": [],
    "codeowners": [
      "@danielperna84",
      "@SukramJ"
    ],
    "iot_class": "local_push",
    "loggers": [
      "hahomematic"
    ],
    "version": "1.2.2",
    "is_built_in": false
  },
  "data": {
    "config": {
      "entry_id": "35822aacb390d7028935d6c727a3c230",
      "version": 1,
      "domain": "homematicip_local",
      "title": "ccu",
      "data": {
        "instance_name": "ccu",
        "host": "de838cd8-raspberrymatic",
        "username": "**REDACTED**",
        "password": "**REDACTED**",
        "tls": false,
        "verify_tls": false,
        "callback_host": null,
        "callback_port": null,
        "json_port": null,
        "interface": {
          "BidCos-RF": {
            "port": 2001
          },
          "HmIP-RF": {
            "port": 2010
          }
        }
      },
      "options": {},
      "pref_disable_new_entities": false,
      "pref_disable_polling": false,
      "source": "user",
      "unique_id": "172.30.33.3",
      "disabled_by": null
    },
    "platform_stats": {
      "climate": 6,
      "light": 4,
      "switch": 14,
      "sensor": 27,
      "binary_sensor": 55
    },
    "devices": [
      "HM-CC-TC",
      "HM-CC-VD",
      "HM-LC-Dim1PWM-CV",
      "HM-LC-Dim1T-FM",
      "HM-LC-Sw1-FM",
      "HM-LC-Sw1-Pl",
      "HM-LC-Sw2-FM",
      "HM-PB-4-WM",
      "HM-PB-6-WM55",
      "HM-PBI-4-FM",
      "HM-RC-12",
      "HM-Sec-RHS",
      "HM-Sec-SCo",
      "HM-Sec-SD-2",
      "HM-Sec-SD-2-Team",
      "HM-Sen-MDIR-SM",
      "HM-Sen-MDIR-WM55"
    ]
  }
}

Expected behavior A clear and concise description of what you expected to happen.

Additional context Add any other context about the problem here.

SukramJ commented 2 years ago

As long as i could see. This is only related to system variables. Or am i wrong? This is something that has been reported with versions < 1.1.4, but should not happen with versions >= 1.1.4.

Please update to 1.3.0. If issue still exists add the following to the configuration.yaml:

logger:
  default: info
  logs:
    hahomematic: debug
    custom_components.homematicip_local: debug

[EDIT] updated 1.2.2 to 1.1.4

SukramJ commented 2 years ago

What do you restart? HA only or the whole HAOS (with RaspberryMatic-Addon)?

breti commented 2 years ago

Yes, you're right, it affects all system variables sensors. I've restarted HA, not HAOS/VM.

I've just updated to 1.3.1 and HA 2022.5.2. Now the error has disappeared again for the time being.

grafik

Since I don't know when it will occur again, enabling debugging is difficult. I guess enabling that now and letting it run until further notice is not an option because it floods the logfile?

SukramJ commented 2 years ago

Yes, permanent debugging is a mess. Maybe INFO is enough. Please close this issue for now and reopen it if the issue re-occures.

breti commented 2 years ago

OK. Thanks.

breti commented 2 years ago

Same again with 1.5.4. I'm still unable to reproduce this issue so I have no debug logs.

SukramJ commented 2 years ago

Thanks for the update.

breti commented 2 years ago

I've just updated to HA 2022.6.0 and custom_homematic to 1.7.2. After restarting HA, all system var sensors were unavailable again. Everything else is working fine.

grafik

Logging configuration was:

logger:
  default: info
  logs:
    hahomematic: debug
    custom_components.homematicip_local: debug

Hope you find something helpful in the log. home-assistant.log config_entry-homematicip_local-35822aacb390d7028935d6c727a3c230.json(2).txt

SukramJ commented 2 years ago

That was helpful, but i need to add more debug logging to the next version.

SukramJ commented 2 years ago

I havent't found a cause, but was able to identify where logging must be intensified. Please update to 1.7.3 before next HA update. Another debug session should give more insights.

breti commented 2 years ago

Updated to HA 2022.6.1 and custom_homematic 1.7.3. No Sys Var issue this time.

SukramJ commented 2 years ago

So far i haven't done anything to fix this issue. I just extended debug loggging. Ich think next HA update will be there soon.

SukramJ commented 2 years ago

Please update to >= 1.8.4 before updating HA to 2022.6.2

breti commented 2 years ago

Updated to Homematic(IP) Local 1.8.4 and Home Assistant Core 2022.6.2. Again no issue.

breti commented 2 years ago

Updated to Homematic(IP) Local 1.8.5 and Home Assistant Core 2022.6.3. Issue is back again. Logs attached.

config_entry-homematicip_local-35822aacb390d7028935d6c727a3c230.json(1).txt home-assistant.log

SukramJ commented 2 years ago

Looks like your platform setup (sensor, binary_sensor) is somehow delayed. This might be the root cause why sometimes SVs are available and sometimes not.

1.8.6 should cover a delayed platform start.

breti commented 2 years ago

Thanks a lot. I'll try and report back.

breti commented 2 years ago

Updated to Homematic(IP) Local 1.8.6 and Home Assistant Core 2022.6.4. No issue.

breti commented 2 years ago

Updated to Home Assistant Core 2022.6.5 without any issues.

SukramJ commented 2 years ago

Thanks for your support. Please close this issue for now and reopen it if the issue re-occurs.

breti commented 2 years ago

OK. Thanks for fixing!