hahomematic: no longer connecting to HomeMatic CCU2 after upgrade to 1.43.1 (internal error)

I agree to the following

  • I have read the documentation
  • I am aware of the latest release notes
  • The Backend (CCU/Homegear/…) is working as expected and connected devices are controllable by its own UI.
  • I am running the latest version of the custom_component (and Home Assistant)

The problem

After upgrading from 1.41.0 to 1.43.1 I get this in my logs:

Oct 01 19:50:28 sru-pi hass[8368]: 2023-10-01 19:50:28.909 WARNING (MainThread) [hahomematic.central] CHECK_CONNECTION failed: No clients exist. Trying to create clients for server WhoMatic
Oct 01 19:50:29 sru-pi hass[8368]: 2023-10-01 19:50:29.953 WARNING (MainThread) [hahomematic.central] CREATE_CLIENTS failed: No connection to interface WhoMatic-VirtualDevices [Unable to connect POST method 'CCU.getAuthEnabled' failed: internal error:
Oct 01 19:50:29 sru-pi hass[8368]: couldn't read file "/lib/libsecuritylevel.tcl": no such file or directory
Oct 01 19:50:29 sru-pi hass[8368]:     while executing
Oct 01 19:50:29 sru-pi hass[8368]: "source "/lib/libsecuritylevel.tcl""
Oct 01 19:50:29 sru-pi hass[8368]:     (file "/www/api/methods/ccu/getauthenabled.tcl" line 10)
Oct 01 19:50:29 sru-pi hass[8368]:     invoked from within
Oct 01 19:50:29 sru-pi hass[8368]: "source [file join $env(DOCUMENT_ROOT) "api/methods/$method(SCRIPT_FILE)"]".]
Oct 01 19:50:31 sru-pi hass[8368]: 2023-10-01 19:50:31.183 WARNING (MainThread) [hahomematic.central] CREATE_CLIENTS failed: No connection to interface WhoMatic-BidCos-RF [Unable to connect POST method 'CCU.getAuthEnabled' failed: internal error:
Oct 01 19:50:31 sru-pi hass[8368]: couldn't read file "/lib/libsecuritylevel.tcl": no such file or directory
Oct 01 19:50:31 sru-pi hass[8368]:     while executing
Oct 01 19:50:31 sru-pi hass[8368]: "source "/lib/libsecuritylevel.tcl""
Oct 01 19:50:31 sru-pi hass[8368]:     (file "/www/api/methods/ccu/getauthenabled.tcl" line 10)
Oct 01 19:50:31 sru-pi hass[8368]:     invoked from within
Oct 01 19:50:31 sru-pi hass[8368]: "source [file join $env(DOCUMENT_ROOT) "api/methods/$method(SCRIPT_FILE)"]".]
Oct 01 19:50:32 sru-pi hass[8368]: 2023-10-01 19:50:32.454 WARNING (MainThread) [hahomematic.central] CREATE_CLIENTS failed: No connection to interface WhoMatic-HmIP-RF [Unable to connect POST method 'CCU.getAuthEnabled' failed: internal error:
Oct 01 19:50:32 sru-pi hass[8368]: couldn't read file "/lib/libsecuritylevel.tcl": no such file or directory
Oct 01 19:50:32 sru-pi hass[8368]:     while executing
Oct 01 19:50:32 sru-pi hass[8368]: "source "/lib/libsecuritylevel.tcl""
Oct 01 19:50:32 sru-pi hass[8368]:     (file "/www/api/methods/ccu/getauthenabled.tcl" line 10)
Oct 01 19:50:32 sru-pi hass[8368]:     invoked from within
Oct 01 19:50:32 sru-pi hass[8368]: "source [file join $env(DOCUMENT_ROOT) "api/methods/$method(SCRIPT_FILE)"]".]

I guess it’s a problem with one of the python libraries so I already tried to find where it tries to source either /lib/libsecuritylevel.tcl or /www/api/methods/ccu/getauthenabled.tcl but wasn’t able to find anything. Also no files with these names are located anywhere on the harddrive. Any help wpuld be appreciated - und wenn’s einfacher ist gerne auch auf Deutsch 😉

What version of HomematicIP (local) has the issue?

1.33.0

What was the last working version of HomematicIP (local)?

1.41.0

What type of installation are you running?

Home Assistant Core

What type of installation are you running for your homematic backend?

CCU2

Which version of your homematic backend are you running?

2.61.7

What hardware are you running for your system?

Pi4

Which config details do you use

  • Username and password
  • TLS
  • callback data (see)

Which interfaces do you use?

  • Homematic IP
  • Homematic (Bidcos-RF)
  • Groups (Heating-Group)
  • BidCos-Wired (HM-Wired)

Diagnostics information

No response

Anything in the logs that might be useful for us? The log (full log) is the best source to support trouble shooting!

see above ;)

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 9 months ago
  • Comments: 21 (1 by maintainers)

Most upvoted comments

Oh wow, danke für die schnelle Hilfe und vor allem die Info, dass das an der CCU2 liegt.

Ich habe jetzt also mal

  • meine CCU2 vom Strom getrennt und wieder angesteckt -> no change
  • Firmware nochmal neu aufgespielt -> no change

Dann bin ich mit SSH auf die CCU und habe da nachgesehen ob und wenn ja wo die Dateien liegen.

Ergebnis:

  • die /www/api/methods/ccu/getauthenabled.tcl ist da und würde gerne auch die /lib/libsecuritylevel.tcl sourcen
  • nur leider ist die /lib/libsecuritylevel.tcl NICHT vorhanden. Also so gar nicht.

Sprich: It’s a bug, not a feature, da die Datei anscheinend gar nicht in der Firmware 2.61.7 drin ist. Ich hab’ schon versucht, mal direkt in das UBIFS-Image aus dem Firmware-Archiv reinzusehen um auszuschließen, dass das nicht ein Fehler beim Entpacken der Firmware auf der CCU2 ist. Aber leider brauche ich dazu ein halbwegs aktuelles Linux x86_64 system und da habe ich gerade nur ARM hier rumstehen - und da fehlt das MTDRAM Kernel-Modul 😦

Hotfix / Workaround

Für den Moment habe ich es so gelöst, dass ich

  1. per SSH auf die CCU2 bin
  2. das UBIFS per mount -o remount,rw / read/write gemountet habe
  3. die von der CCU2 zuerst aufgerufene Datei via vi /www/api/methods/ccu/getauthenabled.tcl wie folgt geändert habe:
##
# CCU.getAuthEnabled
#
# Checks if service authentication is enabled or disabled.
# Return value:         1: Authentication enabled
#                       0: Authentication disabled
#
##

# source "/lib/libsecuritylevel.tcl"

# if { [SEC_getAuthEnabled] } {
  		jsonrpc_response 1
# } else {
# 		jsonrpc_response 0
# }

Sprich: alles ausser jsonrpc_response 1 auskommentiert.

  1. Jetzt klappt’s auch wieder mit der CCU und custom_homematic 😉
  2. Abschließend getestet, ob das Ganze auch Reboot-fest ist. Ist es.

Conclusion:

Ich mache dann halt doch mal das Upgrade auf CCU3 / RaspiMatic 😕

Danke nochmal!

Bitte versuch noch mal die 1.43.2b3.

Danke nochmal @SukramJ für den schnellen Support und Bereitstellung einer Lösung. 👍

1.43.2b3 läuft bei mir auch soweit wieder alles flüssig. Gerne zeitnah das update auf 1.43.2 freigeben. Und an dieser stelle auch ein großes Dankeschön für den tollen Support!