Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tapo P100 Error 1003 after Firmeware update 1.2.1 Build 230804 #33

Open
mikelle400 opened this issue Sep 12, 2023 · 33 comments
Open

Tapo P100 Error 1003 after Firmeware update 1.2.1 Build 230804 #33

mikelle400 opened this issue Sep 12, 2023 · 33 comments

Comments

@mikelle400
Copy link

After a firmware update to 1.2.1 I can no longer reach my P100 sockets via node red. I get the following error message:
errorInf: "Error: Unexpected Error Code: 1003 (undefined)"

A new P100 socket with firmware 1.1.2 runs smoothly.
Is the problem known or am I making a mistake?

@rjtokenring
Copy link

I have the same exact error. After upgrade, I got error
'errorInf: "Error: Unexpected Error Code: 1003 (undefined)"'
Maybe something changed in payload definition

@so-lu
Copy link

so-lu commented Oct 5, 2023

Same error here. Seems that there is already a patch for Home Assistant:
https://github.com/python-kasa/python-kasa/pull/477/files

@hutny1980
Copy link

I'm having the same issue after a firmware upgrade

@Altharion1
Copy link

Same issue here :( I had to put new plugs instead and carefully disable the auto update... Any chance to have an update ? Or does someone know another plugin that would work?

@PeterC71
Copy link

Same issue here

@rjtokenring
Copy link

Yes, it is due to new auth handshake (KLAP). Here is what is in progress in kasa project.

https://github.com/python-kasa/python-kasa/pull/117/files#diff-
f14950ebce450aed77d0c995da2f94b5ce78fb298cc27f1a72928ab6e25d0722

@hutny1980
Copy link

Yes, it is due to new auth handshake (KLAP). Here is what is in progress in kasa project.

https://github.com/python-kasa/python-kasa/pull/117/files#diff- f14950ebce450aed77d0c995da2f94b5ce78fb298cc27f1a72928ab6e25d0722

@rjtokenring - forgive me - do you mean we should have a fix soon? I'm new to all this, so not clear on when (and if) we'll see a fix.

thanks,
G

@wcumps
Copy link

wcumps commented Oct 18, 2023

Here the same issue....

@guoper59
Copy link

Automatic update of firmware no more

@guoper59
Copy link

there are any other alternative?

@machasm1
Copy link

machasm1 commented Nov 4, 2023

Is there a fix planned or has development ceased on this module?

@Altharion1
Copy link

No answer since 2 months, no new version for more than a year, it seems that it's over :( I've not found any other way to make these plugs work with Node Red, did anyone do ?

@guoper59
Copy link

guoper59 commented Nov 5, 2023

if somebody has another option to automatise, even if it is not with node red, it is a pity

@so-lu
Copy link

so-lu commented Nov 5, 2023

Tried to downgrade to an old FW, but to no avail.
But I did see that @sanlike0911 made a small commit 3 days ago, so this software is still maintained.
Maybe @sanlike0911 can add the new encryption to a future version of node-red-contrib-tplink-tapo-connect-api
(like was done in https://github.com/python-kasa/python-kasa/pull/477/files )

@machasm1
Copy link

machasm1 commented Nov 6, 2023

I found a work around by installing a python node function https://flows.nodered.org/node/node-red-contrib-python-function-ps
and installing https://github.com/fishbigger/TapoP100
I was then able to call a python function to toggle the P100. A little convoluted but should get you out of a hole until this repo is updated.

@unic8s
Copy link

unic8s commented Nov 6, 2023

I found a work around by installing a python node function https://flows.nodered.org/node/node-red-contrib-python-function-ps and installing https://github.com/fishbigger/TapoP100 I was then able to call a python function to toggle the P100. A little convoluted but should get you out of a hole until this repo is updated.

Thanks for the great idea!

NOTE: I also had an issue like others fishbigger/TapoP100#128
but there is a working fork https://github.com/almottier/TapoP100

@guoper59
Copy link

guoper59 commented Nov 6, 2023

It works perfectly, Thank you so much @machasm1

@ac1176
Copy link

ac1176 commented Nov 8, 2023

Hi @machasm1 - would you be able to elaborate exactly how you went about getting the python-function-ps node to trigger the necessary commands to toggle your P100 plug? I can connect and trigger my P100 plug using python3 in a terminal window, entering each command one by one, but I get an error in Node Red when I try running those same commands within the python-function-ps node ("...PyP100 Module Not Found Error: No module named PyP100"). I'm running Node Red within a Docker Container, which may complicate things.

@ac1176
Copy link

ac1176 commented Nov 8, 2023

Actually, never mind - I've just worked it out. I had to install Python3, Pip and the TapoP100 library within the Node Red container itself. All working again!

@Philster72
Copy link

I now have this issue. Unfortunately, one of my P110 plugs had it's auto update set, so node-red flows that had been working perfectly for months suddenly stopped, and brought some major automations to a grinding halt. Node-red just reports
{"result":false,"errorInf":"Error: Unexpected Error Code: 1003 (undefined)"}

Any news on a fix please?

@Jhonyboy72
Copy link

Same here :-( Since a few days its no longer working. Code 1003

@realhuno
Copy link

Same here..... is there a workaround or something?

@machasm1
Copy link

There is a workaround as outlined by me above.
I will repeat it here for those that didnt see it above

I found a work around by installing a python node function https://flows.nodered.org/node/node-red-contrib-python-function-ps
and installing https://github.com/fishbigger/TapoP100
I was then able to call a python function to toggle the P100. A little convoluted but should get you out of a hole until this repo is updated.

@Altharion1
Copy link

Yes and it works great ! Thank you very much for that :)

@crazy888
Copy link

crazy888 commented Nov 30, 2023

P110 energy usage also not working with Python solution....

fishbigger/TapoP100#134

@paul-thomas1964
Copy link

I use this for energy monitoring and quite a nice nodered app, so would like to get it working again.
I guess there’s no way to regress the firmware?

@paul-thomas1964
Copy link

I’ve managed to work around this for myself. I also use hubitat HE. This has apps to interface to both nodeRed and TPlink TAPO. The HE tapo integration does work with the new firmware (and authentication method). The HE tapo app, creates HE devices mapped to the tapo devices. These devices can then be exposed to nodeRed and controlled or read from the nodeRed flows.

@robmarcer
Copy link

I installed a P110 yesterday, worked fine for the first few hours, I assume it then updated the firmware for the device, I now can't connect, I'm getting the following error.

{"result":false,"errorInf":"Error: Unexpected Error Code: 1003 (undefined)"}

I'm going to try the workaround suggested by @machasm1.

@zoppolig
Copy link

zoppolig commented Jan 8, 2024

Hi, I did as suggested by @machasm1 . I had issues with installing from the fork https://github.com/almottier/TapoP100
I got this error:

sudo pip install git+https://github.com/almottier/TapoP100
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.

I then installed it passing --break-system-packages, everything is fine and the installation works. In node-red, I used the python-function-ps node, with the following code (with the right IP, ID, and PW ;-):

user code here.

from PyP100 import PyP100

p100 = PyP100.P100("MYIP", "MYID", "MYPW") #Creates a P100 plug object

Turn on/off the plug based on input

def python_function(msg):
# Check if the 'payload' key exists in the incoming message
if 'payload' in msg:
# Example: Turn the plug on or off based on the payload
if msg['payload'] == "ON":
p100.turnOn()
elif msg['payload'] == "OFF":
p100.turnOff()

# Return the original message or modify it as needed
return msg

The entry point for the function node

result = python_function(result)

I have an inject node with a msg.payload "ON" and one with msg.payload "OFF".

The debug node just says "ON" and "OFF", while the python-function-ps node has a green light, signaling "running" and "finished" when I inject a payload. That said, all is nice and dandy, but the plug still doesn't work.

Fimware version is 1.5.5

I believe there is an issue with that, but I do not have a clue how to solve it. Too bad, because I have like eight p100 plugs and now not even one works...

@zoppolig
Copy link

zoppolig commented Jan 14, 2024

@machasm1 figured out how to solve everything, and it works like a charm! Basically, for those who do not know how to script in Python or just for the sake of simplicity, here's how to solve everything on a Raspberry Pi:

  1. pip3 install git+https://github.com/almottier/TapoP100.git@main --break-system-packages
  2. install the node-red-contrib-python-function-ps node
  3. point to the python PATH (in my case, global.python)
  4. Here's the code:

`from PyP100 import PyP100

ip = "MYIP"
email = "MYEMAIL"
password = "MYPWD"

plug = PyP100.P100(ip, email, password)

try:
plug.handshake()
plug.login()
except Exception as e:
return {"payload": {"error": str(e)}}

try:
device_info = plug.getDeviceInfo()
except Exception as e:
device_info = {"error": f"Failed to get device info: {str(e)}"}

if msg["payload"] == "on":
plug.turnOn()
return {"payload": {"status": "Turned On", "deviceInfo": device_info}}

elif msg["payload"] == "off":
plug.turnOff()
return {"payload": {"status": "Turned Off", "deviceInfo": device_info}}

else:
return {"payload": {"error": "Invalid command", "deviceInfo": device_info}}
`

Now that works like a charm, and I'm using the latest firmware update for the Tapo p100 plugs, 'fw_ver': '1.5.5 Build 20230927 Rel. 40646', 'hw_ver': '1.20.0'

@joside
Copy link

joside commented Jan 20, 2024

switched to this fork now and it works again!

https://github.com/mbserran/node-red-contrib-tapo-new-api

@Staubgeborener
Copy link

switched to this fork now and it works again!

https://github.com/mbserran/node-red-contrib-tapo-new-api

i can confirm this

@GenericApp
Copy link

Good news for everyone, now there is:

https://pypi.org/project/tapo/

https://github.com/mihai-dinculescu/tapo/tree/main/tapo-py/examples

It works perfectly.

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests