Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Python(+α)でスマートプラグを制御してみた

 Python(+α)でスマートプラグを制御してみた

サポーターズ学生ライトニングトーク ~2022春の始まり編~

9a9ba864ec37c5c72c72f0377fe4ccf4?s=128

Sora Arakawa

March 01, 2022
Tweet

More Decks by Sora Arakawa

Other Decks in Programming

Transcript

  1. Python +α Sora Arakawa (arkw) 2022/03/01 LT@ CAMP

  2. Sora Arakawa arkw • B2 →B3 • etc… • →

    • Android 940 • Alexa 915 • … • https://arkw.net/
  3. • • Windows GitHub arkwnet/LTTimer

  4. IoT

  5. Internet of Things

  6. IoT Internet of Things • https://aws.amazon.com/jp/iot/what-is-the-internet-of-things/

  7. None
  8. • TP-Link Tapo P105 1000 1500W 1

  9. • TP-Link Tapo

  10. • N W OK NG N W

  11. !

  12. • • 20% ON 80% OFF

  13. • Tapo P100 PyP100 https://github.com/fishbigger/TapoP100

  14. Python

  15. Python

  16. • Python • pip3 install PyP100

  17. from PyP100 import PyP100 p105 = PyP100.P100("192.168.X.X", "aaa@bbb.com", "password") p105.handshake()

    p105.login() p105.turnOn()
  18. from PyP100 import PyP100 p105 = PyP100.P100("192.168.X.X", "aaa@bbb.com", "password") p105.handshake()

    p105.login() p105.turnOn() # IP TP-Link ID
  19. • → →IP

  20. • IP

  21. from PyP100 import PyP100 p105 = PyP100.P100("192.168.X.X", "aaa@bbb.com", "password") p105.handshake()

    p105.login() p105.turnOff()
  22. from PyP100 import PyP100 p105 = PyP100.P100("192.168.X.X", "aaa@bbb.com", "password") p105.handshake()

    p105.login() setup_args = p105.getDeviceInfo() print(setup_args)
  23. print(setup_args)

  24. print(setup_args['result']['device_on'])

  25. • 5 API •

  26. GUI

  27. Python

  28. C#

  29. (Python) GUI (C#)

  30. None
  31. None
  32. (Linux+Python) Android (Java) 20% ON 80% OFF •

  33. • IoT • • TP-Link Python • IP

  34. • GitHub https://github.com/arkwnet/tapo-p105

  35. None