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

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

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

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

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

    View full-size slide

  2. Sora Arakawa arkw
    • B2 →B3
    • etc…
    • →
    • Android 940
    • Alexa 915
    • …
    • https://arkw.net/

    View full-size slide


  3. • Windows GitHub
    arkwnet/LTTimer

    View full-size slide

  4. Internet of Things

    View full-size slide

  5. IoT Internet of Things

    https://aws.amazon.com/jp/iot/what-is-the-internet-of-things/

    View full-size slide

  6. • TP-Link Tapo P105
    1000
    1500W 1

    View full-size slide

  7. • TP-Link Tapo

    View full-size slide


  8. N W
    OK NG
    N W

    View full-size slide



  9. 20% ON 80% OFF

    View full-size slide

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

    View full-size slide

  11. • Python
    • pip3 install PyP100

    View full-size slide

  12. from PyP100 import PyP100
    p105 = PyP100.P100("192.168.X.X", "[email protected]", "password")
    p105.handshake()
    p105.login()
    p105.turnOn()

    View full-size slide

  13. from PyP100 import PyP100
    p105 = PyP100.P100("192.168.X.X", "[email protected]", "password")
    p105.handshake()
    p105.login()
    p105.turnOn()
    # IP TP-Link ID

    View full-size slide

  14. • → →IP

    View full-size slide

  15. from PyP100 import PyP100
    p105 = PyP100.P100("192.168.X.X", "[email protected]", "password")
    p105.handshake()
    p105.login()
    p105.turnOff()

    View full-size slide

  16. from PyP100 import PyP100
    p105 = PyP100.P100("192.168.X.X", "[email protected]", "password")
    p105.handshake()
    p105.login()
    setup_args = p105.getDeviceInfo()
    print(setup_args)

    View full-size slide

  17. print(setup_args)

    View full-size slide

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

    View full-size slide

  19. (Python)
    GUI (C#)

    View full-size slide

  20. (Linux+Python)
    Android (Java)
    20% ON
    80% OFF

    View full-size slide

  21. • IoT

    • TP-Link Python
    • IP

    View full-size slide

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

    View full-size slide