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

Please show the yaml (code-view) of the bridge thing. I’ll check that. If there is a username/password, just exchange it with username/password. For checking initialization it doesn’t matter if the login succeeds.

UID: tapocontrol:bridge:40c0159c96
label: Cloud-Login
thingTypeUID: tapocontrol:bridge
configuration:
  password: xxxxxx
  cloudDiscovery: false
  discoveryInterval: 60
  username: xxxxxx

Login is actually not working cause of the other issue. But the things will work even if bridge (cloud) is offline.
Issue is not only in bridge. Same issue with thing configuration:

UID: tapocontrol:P100:40c0159c96:C0C9E3Axxxx
label: Tapo P100 SmartPlug
thingTypeUID: tapocontrol:P100
configuration:
  ipAddress: 192.168.xxxx
  pollingInterval: 30
bridgeUID: tapocontrol:bridge:40c0159c96

I can’t reproduce that. I have downloaded latest snapshot (which is #3106, I’m not sure which build date #3103 has, the PR was merged 9 days ago and usually a build is done every night), installed the TapoControl binding and created a bridge. The JSON db looks like that:

{
  "tapocontrol:bridge:78f0d84e00": {
    "class": "org.openhab.core.thing.internal.ThingStorageEntity",
    "value": {
      "isBridge": true,
      "channels": [],
      "label": "Cloud-Login",
      "configuration": {
        "cloudDiscovery": false,
        "discoveryInterval": 60,
        "password": "yxc",
        "username": "ydxc"
      },
      "properties": {},
      "UID": "tapocontrol:bridge:78f0d84e00",
      "thingTypeUID": "tapocontrol:bridge"
    }
  }
}

which should not create any issues. I then edited it to provide a double (which may be the case in older installations)

{
  "tapocontrol:bridge:78f0d84e00": {
    "class": "org.openhab.core.thing.internal.ThingStorageEntity",
    "value": {
      "isBridge": true,
      "channels": [],
      "label": "Cloud-Login",
      "configuration": {
        "cloudDiscovery": false,
        "discoveryInterval": 60.0,
        "password": "yxc",
        "username": "ydxc"
      },
      "properties": {},
      "UID": "tapocontrol:bridge:78f0d84e00",
      "thingTypeUID": "tapocontrol:bridge"
    }
  }
}

and tried again and there is still no error.

I’ve only been using OpenHAB for a few days and I’m impacted by the “API rate limit” issue. After some debugging, it seems like the plugin is hard-coded to use the terminal UUID 0A950402-7224-46EB-A450-7362CDB902A2, which results in {"error_code":-20004,"msg":"API rate limit exceeded"} being returned by the API no matter what username/password you specify. I imagine this is because everyone’s TapoBridge plugin is using the same value.

If I change the UUID to something else, it succeeds:

I’ll see if I can come up with a PR to fix this, although if anyone else more familiar with the codebase wants to try, I’m happy to let them.

1 Like

@J-N-K
Every night could not be, cause i downloaded 3103 two or three days ago.
Then it could be that the core fix was merged after 3103 snapshot. let us review in a few days. :crazy_face:

@Poggs
Thank you for hour hint. :+1: .
I think that should be the reason. If yo are on the way to fix it you can do. Otherwise i can fix it tomorrow or the day after.

1 Like

I’ve fixed this by generating the terminal UUID when needed at login rather than having it hard-coded. I am not sure if this UUID needs to be kept the same across restarts or not, but it looks like it’s only ever used once in the code.

If we need to persist that value, it might be best to have it as configuration parameter, but I don’t have the knowledge to do that right now.

I’ve fixed this and a PR is at [tapobridge] Fix API Rate limit exceeded error by poggs · Pull Request #13468 · openhab/openhab-addons · GitHub. For anyone impatient, I’ve compiled a .jar against 3.4.0-SNAPSHOT which is at Release Compiled .jar with fix for openhab/openhab-addons#13465 · poggs/openhab-addons · GitHub

2 Likes

hello guys, i have another kind of issue that i’ve seen from some days. when changing colors of my lightbulb L530 from OH the bulb won’t change colors.
if i change the color from tapo app, it works, and only after this, if i again change the color from OH, now the color can be changed.

any idea on why?

@Poggs May I know how to just update the tapo or just use your version in openhabian? Thanks in advance!

Hi, I receive

device answers with errorcode -1003

on one P115, any idea what does that mean? I see that device going into Unknown state. However switching it on and off works but I don’t get the energy consumption.
I installed the jar compiled by @Poggs

The complete error log:

2022-10-06 11:17:50.900 [TRACE] [rol.internal.api.TapoDeviceConnector] - (tapocontrol:P115:TapoControlBridge:TapoP115_EBike) received result: {"result":{"device_id":"xxxxx","fw_ver":"1.0.16 Build 220624 Rel.171733","hw_ver":"1.0","type":"SMART.TAPOPLUG","model":"P115","mac":"34-60-F9-8B-0A-9A","hw_id":"xxxx","fw_id":"00000000000000000000000000000000","oem_id":"xxxx","ip":"192.168.4.198","time_diff":60,"ssid":"xxxx==","rssi":-46,"signal_level":3,"latitude":xxx,"longitude":xxx,"lang":"en_US","avatar":"plug","region":"Europe/Brussels","specs":"","nickname":"xxx==","has_set_location_info":true,"device_on":false,"on_time":0,"default_states":{"type":"last_states","state":null},"overheated":false},"error_code":0}

2022-10-06 11:17:50.901 [TRACE] [ntrol.internal.api.TapoDeviceHttpApi] - (tapocontrol:P115:TapoControlBridge:TapoP115_EBike) requestCompleted '{"error_code":-1003}'

2022-10-06 11:17:50.904 [DEBUG] [rol.internal.api.TapoDeviceConnector] - (tapocontrol:P115:TapoControlBridge:TapoP115_EBike) device answers with errorcode -1003 - json decode failed

2022-10-06 11:17:50.912 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tapocontrol:P115:TapoControlBridge:TapoP115_EBike' changed from UNKNOWN: json decode failed to ONLINE

2022-10-06 11:17:50.919 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tapocontrol:P115:TapoControlBridge:TapoP115_EBike' changed from ONLINE to UNKNOWN: json decode failed

2022-10-06 11:19:30.211 [DEBUG] [rol.internal.api.TapoDeviceConnector] - (tapocontrol:P115:TapoControlBridge:TapoP115_EBike) device answers with errorcode -1003 - json decode failed

2022-10-06 11:19:56.848 [TRACE] [ntrol.internal.api.TapoDeviceHttpApi] - (tapocontrol:P115:TapoControlBridge:TapoP115_EBike) sendAsncRequest to 'http://192.168.4.198/app?token=xxxx' with cookie 'TP_SESSIONID=2380970E20719A0351701705D0C89103'

2022-10-06 11:19:56.851 [TRACE] [rol.internal.api.TapoDeviceConnector] - (tapocontrol:P115:TapoControlBridge:TapoP115_EBike) DeviceConnetor_queryInfo from 'http://192.168.4.198/app?token=xxxx'

2022-10-06 11:19:56.853 [TRACE] [ntrol.internal.api.TapoDeviceHttpApi] - (tapocontrol:P115:TapoControlBridge:TapoP115_EBike) sendAsncRequest to 'http://192.168.4.198/app?token=xxxx' with cookie 'TP_SESSIONID=2380970E20719A0351701705D0C89103'

2022-10-06 11:19:56.855 [TRACE] [rol.internal.api.TapoDeviceConnector] - (tapocontrol:P115:TapoControlBridge:TapoP115_EBike) DeviceConnetor_getEnergyUsage from 'http://192.168.4.198/app?token=xxxx'

2022-10-06 11:19:56.856 [TRACE] [ntrol.internal.api.TapoDeviceHttpApi] - (tapocontrol:P115:TapoControlBridge:TapoP115_EBike) sendAsncRequest to 'http://192.168.4.198/app?token=xxxx' with cookie 'TP_SESSIONID=2380970E20719A0351701705D0C89103'

2022-10-06 11:19:56.949 [TRACE] [ntrol.internal.api.TapoDeviceHttpApi] - (tapocontrol:P115:TapoControlBridge:TapoP115_EBike) requestCompleted '{"error_code":0}'

2022-10-06 11:19:56.950 [TRACE] [rol.internal.api.TapoDeviceConnector] - (tapocontrol:P115:TapoControlBridge:TapoP115_EBike) received result: {"error_code":0}

Both problems fixed on 3.4.0.M3

Thank you very much

Ok, I see that this is because I blocked the internet acces, after enabling it for short time it is solved.
I made an NAT rule in my router to forward the UDP request on port 123 to my NTP server (which is hosted by my Ubiquity Edge Router X° and enabled the log, but I didn’t see any NTP requests coming from any of my 9 p115

I have two Tapo L920 Light Strips. I see updates in Event Log every 30 seconds although I have changed the Refresh Interval setting either to 0 (disable) or 60, 120, 180. I even then get every 30 seconds those updates and I really don’t need them :slight_smile: It does not even change physicaly in the meantime, it is always ON and when it is off, it says OFF (that is correct).

2022-10-18 13:18:34.077 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘TapoTPLink_Homeoffice_Schalter’ received command ON
2022-10-18 13:18:34.080 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘TapoTPLink_Homeoffice_Tisch_Schalter’ received command ON
2022-10-18 13:18:34.082 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item ‘TapoTPLink_Homeoffice_Schalter’ predicted to become ON
2022-10-18 13:18:34.086 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item ‘TapoTPLink_Homeoffice_Tisch_Schalter’ predicted to become ON
2022-10-18 13:19:04.079 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘TapoTPLink_Homeoffice_Schalter’ received command ON
2022-10-18 13:19:04.090 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘TapoTPLink_Homeoffice_Tisch_Schalter’ received command ON
2022-10-18 13:19:04.093 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item ‘TapoTPLink_Homeoffice_Schalter’ predicted to become ON
2022-10-18 13:19:04.096 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item ‘TapoTPLink_Homeoffice_Tisch_Schalter’ predicted to become ON
2022-10-18 13:19:34.079 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘TapoTPLink_Homeoffice_Schalter’ received command ON


Getting same issue Did the upgrade from config and tried with above mention methods. Please help.

1 Like

@Bigdesaster

Hi Chris, any chance to support the Tapo hub (H100) and the Tapo motion sensors (T100)

Hub:

Motion sensor:

Thanks!

@RobZe89 & @Asutosh_Sahu
You have to use at least the Snapshot M3 as mentioned above. Bevor there is an erro as well in the core (settings will be irgnored) an in the binding (API rate limit).

@black0fire7
As i see the sensors do not use WLAN, so they can’t communicate with oh directly. The hub maybe but i think it would not be like control a single device, if there will be an api to the sensors eg.
So i dont’t think so.

triggered events by the sensors are usually sent to and stored on the hub. So you are right, adding the hub to OH is enough if possible.

I am on 3.4.0.M3 official Release and rate limits are still ignored.

This log entry is from OH-core [openhab.event.ItemCommandEvent ] not from binding.
Can you set the the debug level for the binding to debug or trace and disable the polling?

Sure, here is a trace log file.
Tapocontrol_TraceLog.txt (56.6 KB)

I changed to 180 and also to 0 for the device tapocontrol:L920:50c8694c7a:259604a932 but both devices are getting updates every 30 seconds. So the event in openhab is triggered

2022-10-27 21:30:39.466 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'TapoTPLink_Homeoffice_Schalter' received command ON
2022-10-27 21:30:39.472 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'TapoTPLink_Homeoffice_Tisch_Schalter' received command ON
2022-10-27 21:30:39.476 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'TapoTPLink_Homeoffice_Schalter' predicted to become ON
2022-10-27 21:30:39.480 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'TapoTPLink_Homeoffice_Tisch_Schalter' predicted to become ON
2022-10-27 21:31:09.468 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'TapoTPLink_Homeoffice_Schalter' received command ON
2022-10-27 21:31:09.473 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'TapoTPLink_Homeoffice_Tisch_Schalter' received command ON
2022-10-27 21:31:09.476 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'TapoTPLink_Homeoffice_Schalter' predicted to become ON
2022-10-27 21:31:17.704 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tapocontrol:L920:50c8694c7a:259604a932' changed from ONLINE to UNKNOWN
2022-10-27 21:31:19.918 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tapocontrol:L920:50c8694c7a:259604a932' changed from UNKNOWN to ONLINE
2022-10-27 21:31:39.470 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'TapoTPLink_Homeoffice_Schalter' received command ON
2022-10-27 21:31:39.486 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'TapoTPLink_Homeoffice_Tisch_Schalter' received command ON
2022-10-27 21:31:39.492 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'TapoTPLink_Homeoffice_Schalter' predicted to become ON
2022-10-27 21:31:39.532 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'TapoTPLink_Homeoffice_Tisch_Schalter' predicted to become ON
2022-10-27 21:32:09.222 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tapocontrol:L920:50c8694c7a:259604a932' changed from ONLINE to UNKNOWN
2022-10-27 21:32:09.472 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'TapoTPLink_Homeoffice_Schalter' received command ON
2022-10-27 21:32:09.475 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'TapoTPLink_Homeoffice_Tisch_Schalter' received command ON
2022-10-27 21:32:09.478 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'TapoTPLink_Homeoffice_Schalter' predicted to become ON
2022-10-27 21:32:09.482 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'TapoTPLink_Homeoffice_Tisch_Schalter' predicted to become ON
2022-10-27 21:32:09.748 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tapocontrol:L920:50c8694c7a:259604a932' changed from UNKNOWN to ONLINE
2022-10-27 21:32:39.474 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'TapoTPLink_Homeoffice_Schalter' received command ON
2022-10-27 21:32:39.478 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'TapoTPLink_Homeoffice_Tisch_Schalter' received command ON
2022-10-27 21:32:39.481 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'TapoTPLink_Homeoffice_Schalter' predicted to become ON
2022-10-27 21:32:39.484 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'TapoTPLink_Homeoffice_Tisch_Schalter' predicted to become ON
2022-10-27 21:33:09.477 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'TapoTPLink_Homeoffice_Schalter' received command ON
2022-10-27 21:33:09.481 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'TapoTPLink_Homeoffice_Tisch_Schalter' received command ON
2022-10-27 21:33:09.485 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'TapoTPLink_Homeoffice_Schalter' predicted to become ON
2022-10-27 21:33:09.490 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'TapoTPLink_Homeoffice_Tisch_Schalter' predicted to become ON
2022-10-27 21:33:39.481 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'TapoTPLink_Homeoffice_Schalter' received command ON
2022-10-27 21:33:39.486 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'TapoTPLink_Homeoffice_Tisch_Schalter' received command ON
2022-10-27 21:33:39.489 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'TapoTPLink_Homeoffice_Schalter' predicted to become ON
2022-10-27 21:33:39.495 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'TapoTPLink_Homeoffice_Tisch_Schalter' predicted to become O

I’m also affected by the “rate limit exceeded” issue. I saw in [TapoControl] - Control Tapo Smart WiFi-Devices with Openhab - #203 by Poggs that it should be fixed now. Can you give me a hint how I can get/apply the fix? I’m running OH 3.3.0 inside a Docker container. Is it possible not to update the Container but just use a fixed version of the plugin?