{"id":1122,"date":"2024-12-10T01:18:37","date_gmt":"2024-12-10T07:18:37","guid":{"rendered":"https:\/\/thecweb.com\/?p=1122"},"modified":"2024-12-10T01:18:37","modified_gmt":"2024-12-10T07:18:37","slug":"40-kasa-hs300-smart-power-strip","status":"publish","type":"post","link":"https:\/\/thecweb.com\/index.php\/2024\/12\/10\/40-kasa-hs300-smart-power-strip\/","title":{"rendered":"$40 Kasa HS300 Smart Power Strip"},"content":{"rendered":"\n<p>I impulse-bought 2 of <a href=\"https:\/\/www.amazon.com\/dp\/B07G95FFN3\" data-type=\"link\" data-id=\"https:\/\/www.amazon.com\/dp\/B07G95FFN3\">these<\/a> because it seemed like exactly what I needed for a couple projects.  6 individually controlled power outlets, and three always on USB ports.  Each port monitors voltage and amps.  And I even found a <a href=\"https:\/\/python-kasa.readthedocs.io\/en\/stable\/\" data-type=\"link\" data-id=\"https:\/\/python-kasa.readthedocs.io\/en\/stable\/\">Python library<\/a> that controls it and all the other Kasa smart devices I own.  \ud83d\ude0d<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"816\" height=\"611\" src=\"https:\/\/thecweb.com\/wp-content\/uploads\/2024\/12\/image-7.png\" alt=\"\" class=\"wp-image-1123\" srcset=\"https:\/\/thecweb.com\/wp-content\/uploads\/2024\/12\/image-7.png 816w, https:\/\/thecweb.com\/wp-content\/uploads\/2024\/12\/image-7-300x225.png 300w, https:\/\/thecweb.com\/wp-content\/uploads\/2024\/12\/image-7-768x575.png 768w\" sizes=\"auto, (max-width: 816px) 100vw, 816px\" \/><\/figure>\n\n\n\n<p>And look here.  An official <a href=\"https:\/\/dev.mysql.com\/doc\/connector-python\/en\/connector-python-example-connecting.html\" data-type=\"link\" data-id=\"https:\/\/dev.mysql.com\/doc\/connector-python\/en\/connector-python-example-connecting.html\">MySQL Python Connector<\/a>.<\/p>\n\n\n\n<p>So, this is a start.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># commented out code is example code...  for now\nimport asyncio\nfrom kasa import Discover\n\nasync def main():\n    # dev = await Discover.discover_single(\"127.0.0.1\",username=\"un@example.com\",password=\"pw\")\n    # me no think me need login\n    dev = await Discover.discover_single(\"192.168.1.230\")\n    \n    # await dev.turn_on()\n    # await dev.update()\n    # me just want Info for now\n    devInfo = dev.hw_info \n    print(type(devInfo))\n    print(devInfo)\n\nif __name__ == \"__main__\":\n    asyncio.run(main())<\/code><\/pre>\n\n\n\n<p>which gives me this<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;class 'dict'>\n{'sw_ver': '1.0.12 Build 220121 Rel.175814', 'hw_ver': '2.0', 'mac': 'B0:19:21:DF:80:D0', 'mic_type': 'IOT.SMARTPLUGSWITCH', 'hwId': '955F433CBA24823A248A59AA64571A73', 'oemId': '32BD0B21AA9BF8E84737D1DB1C66E883'}<\/code><\/pre>\n\n\n\n<p>I could probably use this command to populate the device table with ease.  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I impulse-bought 2 of these because it seemed like exactly what I needed for a couple projects. 6 individually controlled power outlets, and three always on USB ports. Each port monitors voltage and amps. And I even found a Python library that controls it and all the other Kasa smart devices I own. \ud83d\ude0d And [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1123,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[46,45],"class_list":["post-1122","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-iot","tag-python"],"_links":{"self":[{"href":"https:\/\/thecweb.com\/index.php\/wp-json\/wp\/v2\/posts\/1122","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thecweb.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thecweb.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thecweb.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thecweb.com\/index.php\/wp-json\/wp\/v2\/comments?post=1122"}],"version-history":[{"count":1,"href":"https:\/\/thecweb.com\/index.php\/wp-json\/wp\/v2\/posts\/1122\/revisions"}],"predecessor-version":[{"id":1124,"href":"https:\/\/thecweb.com\/index.php\/wp-json\/wp\/v2\/posts\/1122\/revisions\/1124"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thecweb.com\/index.php\/wp-json\/wp\/v2\/media\/1123"}],"wp:attachment":[{"href":"https:\/\/thecweb.com\/index.php\/wp-json\/wp\/v2\/media?parent=1122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thecweb.com\/index.php\/wp-json\/wp\/v2\/categories?post=1122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thecweb.com\/index.php\/wp-json\/wp\/v2\/tags?post=1122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}