I am trying to use the Tapo P100 library from Almottier while using the node-red-contrib-pythonshell.
I am able to turn the Tapo P100 ON and OFF but I don't understand how to read the state of the P100. From p100.getDeviceInfo() I see
<PyP100.PyP100.P100 object at 0x7f9bc5ef60>
from a debug node.
Can anyone help me determine the P100 state from this hex string please?
After sending a turn ON instruction I would like to check the true status of the P100 and if necessary resend an ON instruction, the same with the OFF instruction.
Hi, thanks for getting back. I have tried the link you suggested but it didn't work for me. I think I've tried every available node so can't remember exactly why it didn't work.
If i turn the P100 ON and then read the deviceInfo 3 times these are the responces.
{"payload":"<PyP100.PyP100.P100 object at 0x7faad7ef60>\n","_msgid":"0959d8fb50789ca7"}
{"payload":"<PyP100.PyP100.P100 object at 0x7fb5b7ef60>\n","_msgid":"9bddab8b032c0141"}
{"payload":"<PyP100.PyP100.P100 object at 0x7fb2acef60>\n","_msgid":"9438db0c087007aa"}
If I turn the P100 OFF and then read the deviceInfo 3 times these are the responces.
{"payload":"<PyP100.PyP100.P100 object at 0x7fb761ef60>\n","_msgid":"a1c956a23f4e7551"}
{"payload":"<PyP100.PyP100.P100 object at 0x7f8fdaef60>\n","_msgid":"f25691e4b10cb215"}
{"payload":"<PyP100.PyP100.P100 object at 0x7faecdef60>\n","_msgid":"0ee153c9e3a8754a"}
those strings look suspiciously like python memory addresses you see when printing an object instead of its value(s).
At a guess, you are doing something like:
print(p100)
instead of:
info = p100.get_state() # or whatever the function is called!
print(json.dumps(info))
I would strongly suggest you re-try the lib and ask for assistance if you cant get it working. This will avoid ALL of this hassle (and the inevitable problems you will get from spawning python 10000+ times per day/week/whatever)