P110 via TapoControl provides unknown API error (-1)

  • Platform information:
    • Hardware: Synology: DS918+
    • OS: Synology: DSM 7.1.1-42962 Update 6 / Docker
    • Java Runtime Environment: irrelevant as I use docker with latest openhab 4.1
    • openHAB version: 4.1
  • Issue of the topic: I get a “unknown API error (-1)” upon creating thing P110 (cloud bridget setup correctly and working)
  • Please post configurations (if applicable):
    This is a completely new setup of openhab 4.1 on my synology docker as currently all attempts of migration from 3.2. to 4.1 failed (see other topic here: Upgrade from 3.2 to 4.1 -> web requests from local network to 8080 are denied - #34 by hheckner

I setup successfully the tapo binding:

I successfully added all 3 P110 devices via cloud discovery.

My assumption is that I recently did a firmware upgrade of the P110 to Version 1.2.3 Build 230425 Rel. 142542

and this causes the API problem

Why I am thinking this?
Because I had one P110 not yet upgraded and then the error was different:
After hitting save it said that for the given MAC adress of this very device I need to check the IP adress (which was obviously correct as I had it copied from the TAPO App on my iphone). After doing the firmware update (via TAPO App on Iphone) the same error unknown API -1 was returned for this device.

  • If logs where generated please post these here using code fences:
    events.log: (extract)
2023-12-29 08:43:05.797 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tapocontrol:P110:c8d1653801' changed from UNKNOWN: unknown api error (-1) to OFFLINE (COMMUNICATION_ERROR): unknown api error (-1)
2023-12-29 08:43:35.808 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tapocontrol:P110:c8d1653801' changed from OFFLINE (COMMUNICATION_ERROR): unknown api error (-1) to UNKNOWN: unknown api error (-1)
2023-12-29 08:43:35.809 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tapocontrol:P110:c8d1653801' changed from UNKNOWN: unknown api error (-1) to OFFLINE (COMMUNICATION_ERROR): unknown api error (-1)
2023-12-29 08:44:05.819 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tapocontrol:P110:c8d1653801' changed from OFFLINE (COMMUNICATION_ERROR): unknown api error (-1) to UNKNOWN: unknown api error (-1)
2023-12-29 08:44:05.821 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tapocontrol:P110:c8d1653801' changed from UNKNOWN: unknown api error (-1) to OFFLINE

openhab.log:

2023-12-29 08:06:05.771 [WARN ] [ntext.named.DiscriminatingNameMapper] - Failed to get hostname, using 'localhost'
java.net.UnknownHostException: oh: oh: Name or service not known
	at java.net.InetAddress.getLocalHost(InetAddress.java:1671) ~[?:?]
	at shaded.org.eclipse.aether.internal.impl.synccontext.named.DiscriminatingNameMapper.getHostname(DiscriminatingNameMapper.java:100) [bundleFile:?]
	at shaded.org.eclipse.aether.internal.impl.synccontext.named.DiscriminatingNameMapper.<init>(DiscriminatingNameMapper.java:83) [bundleFile:?]
	at shaded.org.eclipse.aether.internal.impl.synccontext.named.SimpleNamedLockFactorySelector.<clinit>(SimpleNamedLockFactorySelector.java:60) [bundleFile:?]
	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) [?:?]
	at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [?:?]
	at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) [?:?]
	at java.lang.reflect.Constructor.newInstance(Constructor.java:480) [?:?]
	at shaded.org.eclipse.aether.impl.DefaultServiceLocator$Entry.newInstance(DefaultServiceLocator.java:176) [bundleFile:?]
	at shaded.org.eclipse.aether.impl.DefaultServiceLocator$Entry.getInstances(DefaultServiceLocator.java:151) [bundleFile:?]
	at shaded.org.eclipse.aether.impl.DefaultServiceLocator$Entry.getInstance(DefaultServiceLocator.java:137) [bundleFile:?]
	at shaded.org.eclipse.aether.impl.DefaultServiceLocator.getService(DefaultServiceLocator.java:296) [bundleFile:?]
	at shaded.org.eclipse.aether.internal.impl.synccontext.DefaultSyncContextFactory.initService(DefaultSyncContextFactory.java:70) [bundleFile:?]
	at shaded.org.eclipse.aether.impl.DefaultServiceLocator$Entry.newInstance(DefaultServiceLocator.java:181) [bundleFile:?]
	at shaded.org.eclipse.aether.impl.DefaultServiceLocator$Entry.getInstances(DefaultServiceLocator.java:151) [bundleFile:?]
	at shaded.org.eclipse.aether.impl.DefaultServiceLocator$Entry.getInstance(DefaultServiceLocator.java:137) [bundleFile:?]
	at shaded.org.eclipse.aether.impl.DefaultServiceLocator.getService(DefaultServiceLocator.java:296) [bundleFile:?]
	at shaded.org.eclipse.aether.internal.impl.DefaultMetadataResolver.initService(DefaultMetadataResolver.java:124) [bundleFile:?]
	at shaded.org.eclipse.aether.impl.DefaultServiceLocator$Entry.newInstance(DefaultServiceLocator.java:181) [bundleFile:?]
	at shaded.org.eclipse.aether.impl.DefaultServiceLocator$Entry.getInstances(DefaultServiceLocator.java:151) [bundleFile:?]
	at shaded.org.eclipse.aether.impl.DefaultServiceLocator$Entry.getInstance(DefaultServiceLocator.java:137) [bundleFile:?]
	at shaded.org.eclipse.aether.impl.DefaultServiceLocator.getService(DefaultServiceLocator.java:296) [bundleFile:?]
	at shaded.org.apache.maven.repository.internal.DefaultVersionResolver.initService(DefaultVersionResolver.java:108) [bundleFile:?]
	at shaded.org.eclipse.aether.impl.DefaultServiceLocator$Entry.newInstance(DefaultServiceLocator.java:181) [bundleFile:?]
	at shaded.org.eclipse.aether.impl.DefaultServiceLocator$Entry.getInstances(DefaultServiceLocator.java:151) [bundleFile:?]
	at shaded.org.eclipse.aether.impl.DefaultServiceLocator$Entry.getInstance(DefaultServiceLocator.java:137) [bundleFile:?]
	at shaded.org.eclipse.aether.impl.DefaultServiceLocator.getService(DefaultServiceLocator.java:296) [bundleFile:?]
	at shaded.org.eclipse.aether.internal.impl.DefaultRepositorySystem.initService(DefaultRepositorySystem.java:145) [bundleFile:?]
	at shaded.org.eclipse.aether.impl.DefaultServiceLocator$Entry.newInstance(DefaultServiceLocator.java:181) [bundleFile:?]
	at shaded.org.eclipse.aether.impl.DefaultServiceLocator$Entry.getInstances(DefaultServiceLocator.java:151) [bundleFile:?]
	at shaded.org.eclipse.aether.impl.DefaultServiceLocator$Entry.getInstance(DefaultServiceLocator.java:137) [bundleFile:?]
	at shaded.org.eclipse.aether.impl.DefaultServiceLocator.getService(DefaultServiceLocator.java:296) [bundleFile:?]
	at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.newRepositorySystem(AetherBasedResolver.java:1232) [bundleFile:?]
	at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.<init>(AetherBasedResolver.java:171) [bundleFile:?]
	at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.<init>(AetherBasedResolver.java:158) [bundleFile:?]
	at org.ops4j.pax.url.mvn.internal.Activator.updated(Activator.java:182) [bundleFile:?]
	at org.ops4j.pax.url.mvn.internal.Activator$OptionalConfigAdminHelper$1.updated(Activator.java:271) [bundleFile:?]
	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189) [bundleFile:?]
	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152) [bundleFile:?]
	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85) [bundleFile:?]
	at org.apache.felix.cm.impl.ConfigurationManager$UpdateConfiguration.run(ConfigurationManager.java:1418) [bundleFile:?]
	at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:122) [bundleFile:?]
	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:84) [bundleFile:?]
	at java.lang.Thread.run(Thread.java:840) [?:?]
Caused by: java.net.UnknownHostException: oh: Name or service not known
	at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) ~[?:?]
	at java.net.InetAddress$PlatformNameService.lookupAllHostAddr(InetAddress.java:934) ~[?:?]
	at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1543) ~[?:?]
	at java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:852) ~[?:?]
	at java.net.InetAddress.getAllByName0(InetAddress.java:1533) ~[?:?]
	at java.net.InetAddress.getLocalHost(InetAddress.java:1666) ~[?:?]
	... 44 more
2023-12-29 08:06:32.685 [INFO ] [org.openhab.core.Activator          ] - Starting openHAB 4.1.0 (build Release Build)
2023-12-29 08:06:40.268 [WARN ] [org.openhab.core.net.NetUtil        ] - Found multiple local interfaces - ignoring 172.17.0.1
2023-12-29 08:06:40.269 [WARN ] [org.openhab.core.net.NetUtil        ] - Found multiple local interfaces - ignoring 192.168.178.32
2023-12-29 08:06:41.767 [INFO ] [.core.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
2023-12-29 08:06:51.875 [INFO ] [e.automation.internal.RuleEngineImpl] - Rule engine started.
2023-12-29 08:07:29.575 [WARN ] [.io.rest.auth.internal.TokenResource] - Couldn't find a user with a session matching the provided refresh_token
2023-12-29 08:07:29.577 [WARN ] [.io.rest.auth.internal.TokenResource] - Token issuing failed: invalid_grant
2023-12-29 08:09:27.364 [INFO ] [p.auth.internal.AuthorizePageServlet] - First user account created: openhab
2023-12-29 08:09:45.019 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Time zone set to 'Europe/Berlin'.
2023-12-29 08:09:45.020 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Locale set to 'de_DE'.
2023-12-29 08:11:12.610 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Location set to '48.11299733852165,11.627633571624756'.
2023-12-29 08:13:06.479 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'avmfritz:fritzbox:192_168_178_1' to inbox.
2023-12-29 08:13:25.939 [INFO ] [nternal.manager.ShellyManagerServlet] - Shelly Manager gestartet und erreichbar unter http(s)://172.21.0.1:8080/shelly/manager
2023-12-29 08:13:33.980 [WARN ] [.transport.servlet.ServletController] - Can't find the request for http://192.168.178.32:8080/rest/addons/binding-upnpcontrol's Observer 
2023-12-29 08:13:35.053 [INFO ] [basic.internal.servlet.WebAppServlet] - Stopped Basic UI
2023-12-29 08:13:35.980 [WARN ] [.transport.servlet.ServletController] - Can't find the request for http://192.168.178.32:8080/rest/addons/binding-upnpcontrol's Observer 
2023-12-29 08:14:37.991 [WARN ] [.transport.servlet.ServletController] - Can't find the request for http://192.168.178.32:8080/rest/addons/binding-upnpcontrol's Observer 
2023-12-29 08:14:38.333 [WARN ] [service.internal.HttpServiceDisabled] - Http service has already been stopped
2023-12-29 08:14:38.949 [INFO ] [org.openhab.core.Activator          ] - Starting openHAB 4.1.0 (build Release Build)
2023-12-29 08:14:39.108 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Time zone set to 'Europe/Berlin'.
2023-12-29 08:14:39.120 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Location set to '48.11299733852165,11.627633571624756'.
2023-12-29 08:14:39.121 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Locale set to 'de_DE'.
2023-12-29 08:14:39.989 [WARN ] [.transport.servlet.ServletController] - Can't find the request for http://192.168.178.32:8080/rest/addons/binding-upnpcontrol's Observer 
2023-12-29 08:14:41.372 [WARN ] [org.openhab.core.net.NetUtil        ] - Found multiple local interfaces - ignoring 172.17.0.1
2023-12-29 08:14:41.373 [WARN ] [org.openhab.core.net.NetUtil        ] - Found multiple local interfaces - ignoring 192.168.178.32
2023-12-29 08:14:44.529 [INFO ] [.core.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
2023-12-29 08:14:48.363 [INFO ] [nternal.manager.ShellyManagerServlet] - Shelly Manager gestartet und erreichbar unter http(s)://172.21.0.1:8080/shelly/manager
2023-12-29 08:14:48.375 [WARN ] [core.karaf.internal.FeatureInstaller] - Could not determine addons folder, its content or the list of installed repositories!
2023-12-29 08:14:48.377 [INFO ] [core.karaf.internal.FeatureInstaller] - Some .kar files are not installed yet. Delaying add-on installation by 15s.
2023-12-29 08:14:54.407 [INFO ] [e.automation.internal.RuleEngineImpl] - Rule engine started.
2023-12-29 08:15:00.379 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'upnpcontrol:upnpserver:00113297-ede6-0011-e6ed-e6ed97321100' to inbox.
2023-12-29 08:22:04.111 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'shelly:shellyplusplug:64b7080c918c' to inbox.
2023-12-29 08:22:34.291 [INFO ] [y.internal.handler.ShellyBaseHandler] - shellyplusplugs-64b7080c918c: INFO: Neue Firmware verfügbar: aktuelle Version: 0.13.0-, neue Version: 1.1.0
2023-12-29 08:28:23.912 [WARN ] [l.internal.handler.UpnpServerHandler] - Cannot serve media from server heckner_storage, no renderer selected
2023-12-29 08:29:07.576 [WARN ] [uth.internal.AbstractAuthPageServlet] - Authentication failed from 192.168.178.105: Wrong password for user openhab
2023-12-29 08:29:15.463 [WARN ] [uth.internal.AbstractAuthPageServlet] - Authentication failed from 192.168.178.105: Wrong password for user openhab
2023-12-29 08:52:40.087 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'tapocontrol:P110:012b617b73:54AF977CC72F' to inbox.
2023-12-29 08:52:40.091 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'tapocontrol:P110:012b617b73:54AF977CBAB8' to inbox.
2023-12-29 08:52:40.095 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'tapocontrol:P110:012b617b73:54AF977CB69A' to inbox.

audit.log is empty.

Hi,

check this thread [TapoControl] - Control Tapo Smart WiFi-Devices with Openhab - Official Support Thread - #339 by Bize

I guess this an solve your problem. I recognize that the new add-on package doesn’t include this change.

Here the linnk to the TAPO Bindung, there is also a description how to install.

Thanks for your help. Is it a good idea to install OH3 versions to a OH4 setup?

OH3 addons are not compatible with OH4 addons.
But follow the link it looks like the title of the directory is misleading.
The github directory contains 4.0 and 4.1 jar files.

Don’t mix any version ! I read your post in the other channel - it’s easy to setup from the scratch. I don’t understand your mapping with the old add-on folder - please remove all files before if you use a folder from 3.x. For me it sounds like a version mix can be the result.

best you setup a new Docker Container, install oh4 there and - if you have map pathes then map these from the new container in parallel - then restore a backup (what you take before with openhab-cli) into the new container. For tapo you must download the 4.1. version and copy the file in the (mapped) /usr/share/openhab/addons folder. Then you can follow the steps for the replacement of the binding.

But I’m not sure if it helps really :-/

Remark from 2023-12-31 : After restart the service I have the problem that I must remove the standard Tapo control again - I guess problem is that the binding has the same version like the standard add-on version. After I remove the standard binding, clear the cache and temp folder and reboot it works. Here Openhab pick up the tapo json file and works with this binding.