danielperna84 / hahomematic

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

no devices after re-install "Homematic(IP) local" custom component (via HACS) #589

Closed bsafh closed 2 years ago

bsafh commented 2 years ago

DONT'T DELETE THIS.

Please answer all questions as good as possible.

Language: english/german both

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

Make sure you have read the release notes at https://github.com/danielperna84/custom_homematic/releases. yes

Make sure you are running the latest version of the custom_component (and Home Assistant) before reporting an issue. yes

custom_component version (if applicable): 1.14.2

known last working custom_component version (if applicable): 1.14.2

Home Assistant version (if applicable): 2022.8.4 (supervised mode on debian in qemu-vm, raspberrymatic as addon (docker)

CCU version:

Problem-relevant configuration:

Do you use tls? no Do you use callback? no Do you use username and password? yes Which interfaces do you use (hmip/bidcos/wired)? bidcos Identifying Homematic RF-Hardware: ......HmRF: RPI-RF-MOD/HB-RF-ETH@192.168.80.31, HmIP: RPI-RF-MOD/HB-RF-ETH@192.168.80.31, OK Updating Homematic RF-Hardware: RPI-RF-MOD: 4.4.22, not necessary, OK

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

After a crash, I had to re-.install the custom component via HACS. After that, all my HM devices are gone. The old entities are still there, though.

To Reproduce Steps to reproduce the behavior: 1) delete custom component 2) install custom component via HACS 3) configure as before 4) look for devices - all gone

Screenshots (if applicable)

image image image image image

image

Relevant HA log entries (full log) Logger: hahomematic.central_unit Source: runner.py:119 First occurred: 21:39:32 (220 occurrences) Last logged: 22:07:03

check_connection: No clients exist. Trying to create clients for server RaspberryMatic _create_clients: Interface: BidCos-RF is not available for backend. _create_clients: Interface: VirtualDevices is not available for backend. _create_clients: Interface: HmIP-RF is not available for backend.

Logger: hahomematic.json_rpc_client Source: runner.py:119 First occurred: 21:39:32 (660 occurrences) Last logged: 22:07:03

_do_login: Unable to open session: {'name': 'JSONRPCError', 'code': 501, 'message': 'invalid credentials or too many sessions'} _post_script: Error while logging in via JSON-RPC. _post: Error while logging in via JSON-RPC.

Logger: pyhomematic._hm Source: components/homematic/entity.py:269 First occurred: 21:39:31 (56 occurrences) Last logged: 22:07:01

ServerThread.jsonRpcLogin: Unable to open session.

Logger: homeassistant.components.climate Source: components/homematic/climate.py:71 Integration: Klima (documentation, issues) First occurred: 21:39:32 (2 occurrences) Last logged: 21:39:32

Error adding entities for domain climate with platform homematic Error while setting up homematic platform for climate Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 673, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 776, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 532, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 570, in _async_write_ha_state state = self._stringify_state(available) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 538, in _stringify_state if (state := self.state) is None: File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 217, in state if self.hvac_mode is None: File "/usr/src/homeassistant/homeassistant/components/homematic/climate.py", line 71, in hvac_mode if self.target_temperature <= self._hmdevice.OFF_VALUE + 0.5: TypeError: '<=' not supported between instances of 'str' and 'float'

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: hahomematic.central_unit Source: custom_components/homematicip_local/control_unit.py:109 Integration: Homematic(IP) Local (documentation, issues) First occurred: 21:39:29 (3 occurrences) Last logged: 21:39:32

_create_clients: Interface: BidCos-RF is not available for backend. _create_clients: Interface: VirtualDevices is not available for backend. _create_clients: Interface: HmIP-RF is not available for backend.

Logger: pyhomematic._hm Source: /usr/local/lib/python3.10/site-packages/pyhomematic/_hm.py:429 First occurred: 21:39:21 (3 occurrences) Last logged: 21:39:22

RPCFunctions.addDeviceNames: Unable to open session.


**Diagnostic Information (available on every device)**

see attached file config_entry-homematicip_local-b5165bd08fa134951e7e41c00d77edbf.json.txt



**Expected behavior**
Re-populate all devices and entities from RaspberryMatic after re-install of the custom component.

**Additional context**
Add any other context about the problem here.

why is there a "too many sessions" error in the log?

can I do anything about that???
bsafh commented 2 years ago

one more diagnose file

config_entry-homematicip_local-b5165bd08fa134951e7e41c00d77edbf.json (1).txt

SukramJ commented 2 years ago

What are you trying to do? Do you migrate from Homematic (core) to Homematic(IP) local? See hints in this discussion how people migrate. Your log is a mixture Homematic (core) and Homematic(IP) local entries, and that is not helpful. For better analysis you should disable/delete the old integration.

The root cause of your trouble is that, something messed up with your ccu The CCU allows a very limit pool of session (~4), and i only can say for Homematic(IP) local that we need one session. Other sessions might be blocked by the old integration or other clients like apps or the WebUI. There also might be some stale session, that haven't been released in the past.

Restart your CCU and ensure that your CCU/RaspberryMatic Addon is running without issues should be a first step.

bsafh commented 2 years ago

I have deleted the old standard Homematic integration before even installing the RaspberryMatic Addon and "Homematic(IP) local". And yes, I did reboot.

I cannot disabled or delete the old integration because it is not installed, I did delete it.

The CCU is the RaspberryMatic addon - that's a full raspberrymatic running as docker on the same debian as the HA docker (as AddOn in HA.

I never had a real hardware CCU.

The RaspberryMatic seems to run just fine, I cannot find any errors or system messages within the rapberrymatic.

As there is no old homematic integration in the system installed, what can cause the "too many session" and why do the HM-CC-DN-RT TRVs show ab as integration "Homematic" and not "Homematic(IP) local" even when there is NO old homematic intergration anywhere to be found within the system.

How can I check and verify that there are no remains of the old homematic integration left in HA?

bsafh commented 2 years ago

according to HA, there is no old homematic integration....

{
  "home_assistant": {
    "installation_type": "Home Assistant Supervised",
    "version": "2022.8.4",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.10.5",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Berlin",
    "os_name": "Linux",
    "os_version": "5.10.0-16-amd64",
    "supervisor": "2022.08.3",
    "host_os": "Debian GNU/Linux 11 (bullseye)",
    "docker_version": "20.10.17",
    "chassis": "vm",
    "run_as_root": true
  },
  "custom_components": {
    "hacs": {
      "version": "1.26.2",
      "requirements": [
        "aiogithubapi>=22.2.4"
      ]
    },
    "climate_group": {
      "version": "0.4.2",
      "requirements": []
    },
    "holidays": {
      "version": "1.8.0",
      "requirements": [
        "python-dateutil>=2.8.2",
        "holidays>=0.14.2"
      ]
    },
    "openwrt": {
      "version": "0.0.1",
      "requirements": []
    },
    "homematicip_local": {
      "version": "1.14.2",
      "requirements": [
        "hahomematic==2022.8.7"
      ]
    },
    "truenas": {
      "version": "1.0.1",
      "requirements": []
    },
    "nodered": {
      "version": "1.0.9",
      "requirements": []
    },
    "ai_thermostat": {
      "version": "0.9.3",
      "requirements": []
    },
    "browser_mod": {
      "version": "1.5.3",
      "requirements": []
    },
    "better_thermostat": {
      "version": "1.0.0-beta14",
      "requirements": []
    },
    "ferienapidotde": {
      "version": "0.2.3",
      "requirements": [
        "ferien-api==0.3.6"
      ]
    },
    "climate_scheduler": {
      "version": "0.1.0",
      "requirements": []
    },
    "webrtc": {
      "version": "v2.3.1",
      "requirements": []
    },
    "gismeteo": {
      "version": "2.5.0",
      "requirements": []
    },
    "frigate": {
      "version": "2.3",
      "requirements": []
    },
    "zha_toolkit": {
      "version": "v0.8.11",
      "requirements": []
    },
    "reversotts": {
      "version": "1.0.2",
      "requirements": [
        "pyttsreverso==0.4"
      ]
    },
    "picotts_remote": {
      "version": "1.0.1",
      "requirements": []
    },
    "scheduler": {
      "version": "v0.0.0",
      "requirements": []
    },
    "dwd_weather": {
      "version": "1.2.22",
      "requirements": [
        "simple_dwd_weatherforecast==1.1.5",
        "markdownify==0.6.5"
      ]
    },
    "shelly": {
      "version": "1.0.1",
      "requirements": [
        "pyShelly==1.0.2",
        "paho-mqtt==1.6.1",
        "websocket-client"
      ]
    },
    "opnsense": {
      "version": "0.1.0",
      "requirements": [
        "mac-vendor-lookup>=0.1.11"
      ]
    },
    "dwains_dashboard": {
      "version": "3.2.0",
      "requirements": []
    }
  },
  "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==2022.8.7"
    ],
    "ssdp": [
      {
        "manufacturer": "EQ3",
        "manufacturerURL": "http://www.homematic.com"
      }
    ],
    "zeroconf": [],
    "homekit": {},
    "dependencies": [],
    "codeowners": [
      "@danielperna84",
      "@SukramJ"
    ],
    "iot_class": "local_push",
    "loggers": [
      "hahomematic"
    ],
    "version": "1.14.2",
    "is_built_in": false
  },
  "data": {
    "config": {
      "entry_id": "b5165bd08fa134951e7e41c00d77edbf",
      "version": 1,
      "domain": "homematicip_local",
      "title": "RaspberryMatic",
      "data": {
        "instance_name": "RaspberryMatic",
        "host": "de838cd8-raspberrymatic",
        "username": "**REDACTED**",
        "password": "**REDACTED**",
        "tls": false,
        "verify_tls": false,
        "callback_host": null,
        "callback_port": null,
        "json_port": null,
        "interface": {
          "HmIP-RF": {
            "port": 2010
          },
          "BidCos-RF": {
            "port": 2001
          },
          "VirtualDevices": {
            "port": 9292,
            "path": "/groups"
          }
        }
      },
      "options": {},
      "pref_disable_new_entities": false,
      "pref_disable_polling": false,
      "source": "user",
      "unique_id": "unknown",
      "disabled_by": null
    },
    "platform_stats": {},
    "devices": []
  }
}
SukramJ commented 2 years ago

I cannot disabled or delete the old integration because it is not installed, I did delete it.

This is definitly not correct. These logs are from the old integration:

File "/usr/src/homeassistant/homeassistant/components/homematic/climate.py", line 71, in hvac_mode if self.target_temperature <= self._hmdevice.OFF_VALUE + 0.5: TypeError: '<=' not supported between instances of 'str' and 'float'

Logger: pyhomematic._hm Source: components/homematic/entity.py:269 First occurred: 21:39:31 (56 occurrences) Last logged: 22:07:01 ServerThread.jsonRpcLogin: Unable to open session. Logger: homeassistant.components.climate Source: components/homematic/climate.py:71 Integration: Klima (documentation, issues) First occurred: 21:39:32 (2 occurrences) Last logged: 21:39:32 Error adding entities for domain climate with platform homematic Error while setting up homematic platform for climate Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 673, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 776, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 532, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 570, in _async_write_ha_state state = self._stringify_state(available) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 538, in _stringify_state if (state := self.state) is None: File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 217, in state if self.hvac_mode is None: File "/usr/src/homeassistant/homeassistant/components/homematic/climate.py", line 71, in hvac_mode if self.target_temperature <= self._hmdevice.OFF_VALUE + 0.5: TypeError: '<=' not supported between instances of 'str' and 'float'

Logger: pyhomematic._hm Source: /usr/local/lib/python3.10/site-packages/pyhomematic/_hm.py:429 First occurred: 21:39:21 (3 occurrences) Last logged: 21:39:22 RPCFunctions.addDeviceNames: Unable to open session.

The old integration is still configured in configuration.yaml.

bsafh commented 2 years ago

OK... so when you delete the old homematic integration, as I did, the config stays in configuration.yaml.

OK, I removed that.

Does not help

Logger: hahomematic.central_unit
Source: runner.py:119
First occurred: 09:18:25 (24 occurrences)
Last logged: 09:20:59

check_connection: No clients exist. Trying to create clients for server RaspberryMatic
_create_clients: Interface: VirtualDevices is not available for backend.
_create_clients: Interface: BidCos-RF is not available for backend.
_create_clients: Interface: HmIP-RF is not available for backend.
Logger: hahomematic.json_rpc_client
Source: runner.py:119
First occurred: 09:18:25 (72 occurrences)
Last logged: 09:20:59

_do_login: Unable to open session: {'name': 'JSONRPCError', 'code': 501, 'message': 'invalid credentials or too many sessions'}
_post_script: Error while logging in via JSON-RPC.
_post: Error while logging in via JSON-RPC.
Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: hahomematic.json_rpc_client
Source: custom_components/homematicip_local/control_unit.py:642
Integration: Homematic(IP) Local (documentation, issues)
First occurred: 09:20:46 (8 occurrences)
Last logged: 09:20:46

_do_login: Unable to open session: {'name': 'JSONRPCError', 'code': 501, 'message': 'invalid credentials or too many sessions'}
_post_script: Error while logging in via JSON-RPC.
Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: hahomematic.central_unit
Source: custom_components/homematicip_local/control_unit.py:109
Integration: Homematic(IP) Local (documentation, issues)
First occurred: 09:18:24 (3 occurrences)
Last logged: 09:18:25

_create_clients: Interface: VirtualDevices is not available for backend.
_create_clients: Interface: BidCos-RF is not available for backend.
_create_clients: Interface: HmIP-RF is not available for backend.
Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: hahomematic.json_rpc_client
Source: custom_components/homematicip_local/control_unit.py:109
Integration: Homematic(IP) Local (documentation, issues)
First occurred: 09:18:24 (12 occurrences)
Last logged: 09:18:25

_do_login: Unable to open session: {'name': 'JSONRPCError', 'code': 501, 'message': 'invalid credentials or too many sessions'}
_post_script: Error while logging in via JSON-RPC.
_post: Error while logging in via JSON-RPC.

What else has to be removed/deleted/changed ?

or is there anything else within RaspberryMatic to change? The RaspberryMatic itself shows normal operation without any errors or warnings.

SukramJ commented 2 years ago

Did you restart RM? What about your credentials? Are there any special characters inside. Please add the RM Addon log.

SukramJ commented 2 years ago

Any updates?

SukramJ commented 2 years ago

Looks like this can be closed.