[TapoControl] - Control Tapo Smart WiFi-Devices with Openhab - Official Support Thread

I have 2x P110 smart plugs and 2x L510 bulbs which were working fine for months until the last couple of days and now I’m getting an ‘unknown api error’ in OH.
I was on OH3 so I’ve now upgraded to OH4 thinking that might fix it but no joy. I’ve also uninstalled and reinstalled the binding and the devices. The Bridge device looks ok and is logged in but none of the other devices are working
I’ve set the loglevel to trace and this is the relevant output I’m seeing in the logs every 30 seconds for one of the L510 bulbs:

2023-08-27 16:40:37.008 [TRACE] [pocontrol.internal.device.TapoDevice] - (tapocontrol:L510:1c44df9275:95d53394aa) schedulerAction
2023-08-27 16:40:37.010 [TRACE] [ntrol.internal.api.TapoDeviceHttpApi] - (tapocontrol:L510:1c44df9275:95d53394aa) not logged in
2023-08-27 16:40:37.012 [DEBUG] [pocontrol.internal.device.TapoDevice] - (tapocontrol:L510:1c44df9275:95d53394aa) tried to query DeviceInfo but not loggedIn
2023-08-27 16:40:37.019 [TRACE] [rol.internal.api.TapoDeviceConnector] - (tapocontrol:L510:1c44df9275:95d53394aa) sending login to url 'http://192.168.0.16/app'
2023-08-27 16:40:37.021 [TRACE] [ntrol.internal.api.TapoDeviceHttpApi] - (tapocontrol:L510:1c44df9275:95d53394aa) create handhsake with payload: {"method":"handshake","params":{"key":"-----BEGIN PUBLIC KEY-----[REDACTED]-----END PUBLIC KEY-----\n"},"requestTimeMils":1693150837021}
2023-08-27 16:40:37.024 [TRACE] [ntrol.internal.api.TapoDeviceHttpApi] - (tapocontrol:L510:1c44df9275:95d53394aa) sendRequest to 'http://192.168.0.16/app' with cookie ''
2023-08-27 16:40:37.035 [DEBUG] [ntrol.internal.api.TapoDeviceHttpApi] - (tapocontrol:L510:1c44df9275:95d53394aa) device returns errorcode '1003'
2023-08-27 16:40:37.039 [TRACE] [ntrol.internal.api.TapoDeviceHttpApi] - (tapocontrol:L510:1c44df9275:95d53394aa) not logged in
2023-08-27 16:40:37.041 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tapocontrol:L510:1c44df9275:95d53394aa' changed from OFFLINE (COMMUNICATION_ERROR): unknown api error (-1) to UNKNOWN: unknown api error (-1)
2023-08-27 16:40:37.045 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tapocontrol:L510:1c44df9275:95d53394aa' changed from UNKNOWN: unknown api error (-1) to OFFLINE (COMMUNICATION_ERROR): unknown api error (-1)

I’d appreciate any help or advice to fix this - wondering if Tapo have changed something in the API as per posts above.
thanks
Mark

I assume all of us are also following the HA discussions?-)
https://hothardware.com/news/researchers-discover-vulnerabilities-in-tp-link-smart-bulbs-to-steal-passwords

Thx for the links. Seem’s that there could be a solution in sight.
But i need time to implement it.
Currently i’m in holidays and already started to rewrite core code for the binding.
So if i’m back from holidays i can start to implement the new protocol. I think this can take a few weeks.
So keep patient and don’t update your devices except you’re affraid abour the security issues.

2 Likes

I am also facing an “communication_error (1003)” since yesterday on my P100 plugs.
As far as I understood the issue is related to an Tapo FW update.

Is there any workaround know? (other than just using the tapo app until the binding is fixed…)?

Regards

No currently there is no workaround.
But i work on a solution.

1 Like

@Bigdesaster Here is a suggestion to make life easier for new users: device discovery should use the “device name” as recorded in the App, instead of the “device type”

I’ve tried the jar file org.openhab.binding.tapocontrol-4.1.0-SNAPSHOT.jar on a OH 4.0.3 (on Raspberry 4B) but it doesn’t work.
I obtain this message on console:
Unresolved requirement: Import-Package: javax.measure; version="[2.2.0,3.0.0)"
I want to test the H100 and T110 functionalities if possible.
Thanks in advance
[Edit] Resolved installing also OH 4.1.0-SNAPSHOT :blush:

Is there a possibility to add also the Tapo T315 to the list of discovered devices? It’s a T/H sensor like the T310 (it has only a mini display integreted to see the values).
Thanks in advance

@moody_blue
currently i’m struggeling with the klap protocol. If this will work i’m planning to integrate udp-discovery. Maybe then i can take this change.

@saxxing
if it has the same data as T310 this would be no problem. Please post trace log for the t315 so i can be sure of this.

If this implies that the bridge is no longer necessary it will be a major plus. I also have some Kasa plugs and they do not need a bridge.

From TRACE log for tapocontrol I found this (changed some sensible infos with *):

16:35:17.163 [DEBUG] [ol.internal.TapoChildDiscoveryService] - (tapocontrol:H100:cafd9929a8) Discovered unsupportet ThingType 'tapocontrol:T315'
[…]

{"parent_device_id":"*","hw_ver":"1.0","fw_ver":"1.7.0 Build 230424 Rel.170332","device_id":"*","mac":"*","type":"SMART.TAPOSENSOR","model":"T315","hw_id":"+","oem_id":"*","specs":"EU","category":"subg.trigger.temp-hmdt-sensor","bind_count":1,"status_follow_edge":false,"status":"online","lastOnboardingTimestamp":1682698085,"rssi":-47,"signal_level":3,"jamming_rssi":-114,"jamming_signal_level":1,"at_low_battery":false,"temp_unit":"celsius","current_temp":23.4,"current_humidity":72,"current_temp_exception":0,"current_humidity_exception":12,"battery_percentage":100,"nickname":"*","avatar":"sensor_t315","report_interval":8,"region":"*"}

[…]
Is this useful?

@moody_blue
No thats wrong. Bridge will be necessary because it stores the credentials. They are still needed to communicate with devices.

@saxxing
yes should be okay. Uploaded a new version to my “compiled_addons-git” where T315 is already integrated.
It has already perparation for the new protocol (which is not implemenented) . So core-code is completely revised and not fully tested.
So you’re free to test it. Note: P300-Socket-Strip is actually not supported.

Is there already a solution?

So i got the solution just at this moment.
Uploaded the newest jar to my oh3_compile-addons repository.
Working for my new L530E Smart-Bulb i bought from the donations from here.
The 530E HW-Rev 1 is still working with old protocol.

At the moment it is necesarry to select the protocol manually in advanced settings of the device.
So if yout get an communication error (1003) then try to change the protocol.

2 Likes

i’m sorry but i cannot make it work.
i’ve tried to:

  • uninstall TapoControl Binding - reboot - copy org.openhab.binding.tapocontrol-4.1.0-SNAPSHOT.jar to addons folder and it won’t work (missing handler). in fact i cannot see it when adding manually the thing…
    the error i get is:
2023-09-26 09:19:08.527 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.tapocontrol-4.1.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.tapocontrol [298]

(the jar i get is 444kb)

  • copy org.openhab.binding.tapocontrol-4.1.0-SNAPSHOT.jar ewith the TapoControl Binding installed, and i see online my tapo devices but with no advanced option to chose the protocol and “api -1 error”

any idea?

Is it only working with OH4.1 or also with stable 4.0.3?

I am on openHAB 4.0.3 and unfortunately the new version does not work for me either.

2023-09-28 22:04:23.259 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.tapocontrol-4.1.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.tapocontrol [306]
  Unresolved requirement: Import-Package: javax.measure; version="[2.2.0,3.0.0)"

	at org.eclipse.osgi.container.Module.start(Module.java:463) ~[org.eclipse.osgi-3.18.0.jar:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:445) ~[org.eclipse.osgi-3.18.0.jar:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) ~[?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) ~[?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) ~[?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) ~[?:?]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) ~[?:?]

Javax.measure has to be included in pom.xml for addons in v4.1. I think this is temporary.

Added the javax.measure in my pom. Should now work with 4.0

1 Like

Perfect - thank you! It works now.

as a sumary:

  1. Put the new file org.openhab.binding.tapocontrol-4.1.0-SNAPSHOT.jar download from github in my addon-folder.
  2. changed the configuration of my P100 SmartPlugs to Secured KLAP HTTP Protocol in advanced settings of the thing
  3. thing is directly back online!

Thx again, much appreciated.