<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kazukifu</author_name>
  <author_url>https://blog.hatena.ne.jp/kazukifu/</author_url>
  <blog_title>Kazuki's Blog</blog_title>
  <blog_url>https://kazukifu.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>はじめに この記事では、SwitchBotプラグミニ（JP）の電力データをAPI経由で取得し、MariaDBに自動記録するPythonスクリプトを紹介します。 以前は status_log テーブルへINSERTしていましたが、今回の更新では新しいテーブル plugmini_jp_utc に記録するよう変更しました。 このスクリプトを使うことで、プラグミニの電圧・電流・日次消費電力などを定期的に取得し、電力モニタリングや可視化に活用できます。 1.更新後のPythonスクリプト 以下は修正版の完全なスクリプトです。環境変数を用いてトークンやDB情報を安全に管理しています。 import req…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkazukifu.hatenablog.com%2Fentry%2F2025%2F11%2F13%2F183418&quot; title=&quot;📡 SwitchBotプラグミニ(JP)データ収集Pythonスクリプトの修正 - Kazuki&amp;#39;s Blog&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2025-11-13 18:34:18</published>
  <title>📡 SwitchBotプラグミニ(JP)データ収集Pythonスクリプトの修正</title>
  <type>rich</type>
  <url>https://kazukifu.hatenablog.com/entry/2025/11/13/183418</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
