{"id":17580,"date":"2025-11-03T07:00:00","date_gmt":"2025-11-02T22:00:00","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=17580"},"modified":"2025-11-14T16:57:18","modified_gmt":"2025-11-14T07:57:18","slug":"%e3%80%90laravel%e3%83%bbswitchbot%e3%80%91%e3%81%9f%e3%81%a3%e3%81%9f1%e4%b8%87%e5%86%86%e5%8f%b0%e3%81%a7%e5%85%a5%e5%ae%a4%e7%ae%a1%e7%90%86%e3%82%b7%e3%82%b9%e3%83%86%e3%83%a0%e3%82%92%e5%b0%8e","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=17580","title":{"rendered":"\u3010Laravel\u30fbSwitchBot\u3011\u305f\u3063\u305f1\u4e07\u5186\u53f0\u3067\u5165\u5ba4\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u3092\u5c0e\u5165\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"\n<p>\u3055\u3066\u3055\u3066\u3001AI\u306b\u3088\u308b\u4eee\u60f3\u7a7a\u9593\u306e\u652f\u914d\u304c\u3069\u3093\u3069\u3093\u5f37\u307e\u3063\u3066\u3044\u308b\u4eca\u65e5\u3053\u306e\u9803\u3067\u3059\u3002<br>\u305d\u3093\u306a\u6642\u4ee3\u306e\u6d41\u308c\u306b\u4e57\u3063\u3066\u3044\u304b\u306d\u3070\u3068\u3044\u3046\u3053\u3068\u3067<strong>\u300c\u30c7\u30b8\u30bf\u30eb\u3068\u30ea\u30a2\u30eb\u306e\u878d\u5408\u300d\u306b\u3064\u3044\u3066\u8272\u3005\u8003\u3048\u3066\u307e\u3057\u305f\u3002<\/strong><\/p>\n\n\n\n<p>\u305d\u3046\u306a\u308b\u3068\u3001\u3084\u306f\u308a\u53ef\u80fd\u6027\u3092\u611f\u3058\u308b\u306e\u304c\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n\n\n\n<p class=\"has-large-font-size\"><strong>SwitchBot\uff08\u30b9\u30a4\u30c3\u30c1\u30dc\u30c3\u30c8\uff09<\/strong><\/p>\n\n\n\n<p>\u3067\u3059\uff01<\/p>\n\n\n\n<p><code>SwitchBot<\/code>\u306f\u30a6\u30a7\u30d6\u4e0a\u304b\u3089\u7269\u7406\u64cd\u4f5c\u304c\u3067\u304d\u308b\u30b9\u30b0\u30ec\u30e2\u30ce\u3067\u3059\u304c\u3001\u5b9f\u306f\u300c<strong>\u6307\u30ed\u30dc\u30c3\u30c8<\/strong>\u300d\u3060\u3051\u3067\u306a\u304f\u8272\u3005\u306a\u6a5f\u68b0\u3092\u7528\u610f\u3057\u3066\u304f\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"has-small-font-size\">\u3053\u308c\u306f\u6307\u30ed\u30dc\u30c3\u30c8\u3067\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"446\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/10\/laravel-switchbot-14.png\" alt=\"\" class=\"wp-image-16679\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/10\/laravel-switchbot-14.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/10\/laravel-switchbot-14-300x209.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<p>\u305f\u3068\u3048\u3070\u3001\u6b21\u306e\u3088\u3046\u306a\u6a5f\u68b0\u306f\u30a2\u30a4\u30c7\u30a2\u6b21\u7b2c\u3067\u9762\u767d\u3044\u3053\u3068\u304c\u3067\u304d\u305d\u3046\u3058\u3083\u306a\u3044\u3067\u3059\u304b?<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4eba\u611f\u30bb\u30f3\u30b5\u30fc<\/li>\n\n\n\n<li>\u958b\u9589\u30bb\u30f3\u30b5\u30fc<\/li>\n\n\n\n<li>\u6c34\u6f0f\u308c\u30bb\u30f3\u30b5\u30fc<\/li>\n\n\n\n<li>\u6e29\u5ea6\u30fb\u6e7f\u5ea6\u8a08<\/li>\n\n\n\n<li>\u76e3\u8996\u30ab\u30e1\u30e9<\/li>\n<\/ul>\n\n\n\n<p>\u305d\u3057\u3066\u305d\u3093\u306a\u4e2d\u3001\u30d4\u30c3\u30af\u30a2\u30c3\u30d7\u3057\u305f\u306e\u304c\u3001<\/p>\n\n\n\n<p class=\"has-large-font-size\"><strong>\u30b9\u30de\u30fc\u30c8\u30ed\u30c3\u30af\uff08\u9060\u9694\u306e\u30c9\u30a2\u30ad\u30fc\u64cd\u4f5c\uff09<\/strong><\/p>\n\n\n\n<p>\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3064\u307e\u308a\uff01<\/p>\n\n\n\n<p>\u4eca\u56de\u306e\u30c6\u30fc\u30de\u300c<strong>\u30b9\u30de\u30fc\u30c8\u30ed\u30c3\u30af\u3067QR\u30b3\u30fc\u30c9\u3092\u3064\u304b\u3063\u305f\u5165\u5ba4\u30b7\u30b9\u30c6\u30e0\u3092\u3064\u304f\u308b<\/strong>\u300d\u306b\u3064\u306a\u304c\u308b\u308f\u3051\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u4eca\u56de\u306f\u6b21\u306e\u3088\u3046\u65b9\u306b\u5411\u3051\u3066\u8a18\u4e8b\u3092\u66f8\u3044\u3066\u3044\u307e\u3059\u3002<br>\u305c\u3072\u6700\u5f8c\u307e\u3067\u8aad\u3093\u3067\u304f\u3060\u3055\u3044\u306d\uff01<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u300cLaravel\u3092\u3064\u304b\u3063\u3066\u5165\u5ba4\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u3092\u3064\u304f\u308a\u305f\u3044\u300d<\/li>\n\n\n\n<li>\u300c1\u4e07\u5186\u53f0\u3067\u5165\u5ba4\u7ba1\u7406\u3092\u8a2d\u7f6e\u3057\u305f\u3044\u300d<\/li>\n\n\n\n<li>\u300cAI\u306e\u53ca\u3073\u306b\u304f\u3044\u3001\u30ea\u30a2\u30eb\u306e\u958b\u767a\u3082\u3084\u3063\u3066\u304a\u304d\u305f\u3044\u300d<\/li>\n\n\n\n<li>\u300c\u30c7\u30b8\u30bf\u30eb\u3068\u30ea\u30a2\u30eb\u306e\u878d\u5408\u306b\u8208\u5473\u304c\u3042\u308b\u300d<\/li>\n\n\n\n<li>\u300c\u30b9\u30bf\u30fc\u30a6\u30a9\u30fc\u30ba\u307f\u305f\u304f\u30d5\u30a9\u30fc\u30b9\u3067\u9060\u9694\u64cd\u4f5c\u3057\u305f\u3044\uff08\u7b11\uff09\u300d<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"370\" height=\"310\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png\" alt=\"\" class=\"wp-image-4445\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png 370w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2-300x251.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/><\/figure><\/div>\n\n\n<p class=\"has-text-align-center\">\u300c\u5b50\u4f9b\u306e\u9803\u3001\u30d5\u30a9\u30fc\u30b9\u3064\u304b\u3046<br>\u7df4\u7fd2\u3092\u3057\u305f\u3053\u3068\u304c\u3042\u308a\u307e\u3059\uff01\u300d<\/p>\n\n\n\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong>Laravel 12.x + Vue 3(TypeScript) + Inertia<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5fc5\u8981\u306a\u6a5f\u68b0\u306e\u307e\u3068\u3081<\/h2>\n\n\n\n<p>\u4eca\u56de\u306f\u3001\u30a6\u30a7\u30d6\u4e0a\u304b\u3089\u30b9\u30de\u30fc\u30c8\u30ed\u30c3\u30af\u3092\u65bd\u9320\u3001\u89e3\u9320\u3057\u307e\u3059\u3002<br>\u5fc5\u8981\u306a\u6a5f\u68b0\u306f\u6b21\u306e2\u3064\u306b\u306a\u308a\u307e\u3059\uff08\u5408\u308f\u305b\u30661\u4e07\u5186\u53f0\u3067\u8cfc\u5165\u3067\u304d\u307e\u3059\uff09<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. <a href=\"https:\/\/amzn.to\/3J5xdtG\" target=\"_blank\" rel=\"noreferrer noopener\">SwitchBot \u30ed\u30c3\u30afLite<\/a>\uff1a<strong>8,980<\/strong>\u5186\uff08\u516c\u5f0f\u30da\u30fc\u30b8\u3088\u308a\u629c\u7c8b2025\/10\/31\uff09<\/h3>\n\n\n\n<p class=\"has-small-font-size\">\u203b\u30ea\u30f3\u30af\u5148\u306fSwitchBot \u30ed\u30c3\u30af\u3067\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"600\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/10\/laravel-switchbot-lock-7.png\" alt=\"\" class=\"wp-image-17905\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/10\/laravel-switchbot-lock-7.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/10\/laravel-switchbot-lock-7-300x281.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<p>Lite\u3058\u3083\u306a\u304f\u3066\u3001Pro\u3068\u304b\u30ce\u30fc\u30de\u30eb\u3067\u3082OK\uff01<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. <a href=\"https:\/\/amzn.to\/3J5ytwU\">SwitchBot \u30cf\u30d6 \u30df\u30cb<\/a>\uff1a<strong>5,480<\/strong>\u5186\uff08\u516c\u5f0f\u30da\u30fc\u30b8\u3088\u308a\u629c\u7c8b2025\/10\/31\uff09<\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"480\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/10\/laravel-switchbot-lock-8.png\" alt=\"\" class=\"wp-image-17906\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/10\/laravel-switchbot-lock-8.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/10\/laravel-switchbot-lock-8-300x225.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<p>\u30df\u30cb\u30cf\u30d6\u3058\u3083\u306a\u304f\u3001\u30ce\u30fc\u30de\u30eb\u306e\u3084\u3064\u3067\u3082OK\uff01<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. QR\u30b3\u30fc\u30c9\u3092\u8aad\u307f\u53d6\u308b\u30c7\u30d0\u30a4\u30b9<\/h3>\n\n\n\n<p>\u30d1\u30bd\u30b3\u30f3\u3084\u30b9\u30de\u30db\u3001\u30bf\u30d6\u30ec\u30c3\u30c8\u306a\u3069\u300c\u30d6\u30e9\u30a6\u30b6\u304c\u8d77\u52d5\u3067\u304d\u308b\u3082\u306e\u300d\u306a\u3089\u4f55\u3067\u3082OK\uff01<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u958b\u767a\u306e\u6e96\u5099\u3092\u3059\u308b3\u30b9\u30c6\u30c3\u30d7<\/h2>\n\n\n\n<p>\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u3044\u3066\u3044\u304f\u524d\u306b\u3001\u5fc5\u8981\u306a\u3082\u306e\u3092\u7528\u610f\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. \u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/h3>\n\n\n\n<p><code>JavaScript<\/code>\u3067QR\u30b3\u30fc\u30c9\u3092\u3064\u304b\u3046\u306e\u3067\u3001\u6b21\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>npm i qrcode -D<br>npm i @types\/qrcode -D<\/strong><br><strong>npm i jsqr -D<\/strong><\/pre>\n\n\n\n<p class=\"has-small-font-size\">\u203b2\u3064\u76ee\u306fTypeScript\u7528\u3067\u3059\u3002\u958b\u767a\u30b9\u30d4\u30fc\u30c9\u304c\u843d\u3061\u308b\u306e\u3067\u3001\u30db\u30f3\u30c8\u306fTypeScript\u4f7f\u3044\u305f\u304f\u306a\u3044\u3093\u3067\u3059\u304c\u3001\u4e16\u9593\u306e\u6d41\u308c\u306b\u9006\u3089\u3048\u305a\u30fb\u30fb\u30fb\uff08\u7b11\uff09<\/p>\n\n\n\n<h3 class=\"wp-block-heading get-device-id\" id=\"get-switchbot-api-token\">2. SwitchBot API\u306e\u30c8\u30fc\u30af\u30f3\u3092\u53d6\u5f97\u3059\u308b<\/h3>\n\n\n\n<p>\u4ee5\u524d\u516c\u958b\u3057\u305f\u8a18\u4e8b\u306b\u307e\u3068\u3081\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u4ee5\u4e0b\u8a18\u4e8b\u306e\u300c<a href=\"https:\/\/blog.capilano-fw.com\/?p=16389#i-2\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>SwitchBot API\u306e\u30c8\u30fc\u30af\u30f3\u3092\u53d6\u5f97\u3059\u308b<\/strong><\/a>\u300d\u3092\u53c2\u7167\u3057\u3066<code>.env<\/code>\u306b\u30bb\u30c3\u30c8\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. \u30c7\u30d0\u30a4\u30b9ID\u3092\u53d6\u5f97\u3059\u308b<\/h3>\n\n\n\n<p><code>SwitchBot API<\/code>\u3092\u3064\u304b\u3063\u3066\u30b9\u30de\u30fc\u30c8\u30ed\u30c3\u30af\u3092\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306b\u300c<strong>\u30c7\u30d0\u30a4\u30b9ID<\/strong>\u300d\u3068\u547c\u3070\u308c\u308b\u56fa\u6709\u306eID\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306eID\u3092\u53d6\u5f97\u3057\u307e\u3057\u3087\u3046\u3002<br>\u307e\u305a\u306f\uff08\u8aac\u660e\u66f8\u304d\u3092\u898b\u306a\u304c\u3089\uff09<code>SwitchBot Lock Lite<\/code>\u3092\u30b9\u30de\u30db\u3067\u30da\u30a2\u30ea\u30f3\u30b0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p>\u6b21\u306b\u30db\u30fc\u30e0\u753b\u9762\u3067\u30da\u30a2\u30ea\u30f3\u30b0\u3057\u305f\u6a5f\u68b0\u3092\u9078\u629e\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full image-border-3\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"666\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/10\/laravel-switchbot-lock-3.png\" alt=\"\" class=\"wp-image-17871\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/10\/laravel-switchbot-lock-3.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/10\/laravel-switchbot-lock-3-135x300.png 135w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/figure>\n\n\n\n<p>\u300c<strong>\u53f3\u4e0a\u306b\u3042\u308b\u6b6f\u8eca\u306e\u30de\u30fc\u30af &gt; Device Info<\/strong>\u300d\u3092\u9078\u629e\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full image-border-3\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"666\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/10\/laravel-switchbot-lock-4.png\" alt=\"\" class=\"wp-image-17872\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/10\/laravel-switchbot-lock-4.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/10\/laravel-switchbot-lock-4-135x300.png 135w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/figure>\n\n\n\n<p>\u300c<strong>BLE MAC<\/strong>\u300d\u9805\u76ee\u304c\u30c7\u30d0\u30a4\u30b9ID\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full image-border-3\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"666\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/10\/laravel-switchbot-lock-5.png\" alt=\"\" class=\"wp-image-17873\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/10\/laravel-switchbot-lock-5.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/10\/laravel-switchbot-lock-5-135x300.png 135w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/figure>\n\n\n\n<p>\u3067\u306f\u3001\u53d6\u5f97\u3057\u305f\u30c7\u30d0\u30a4\u30b9ID\u306f<code>.env<\/code>\u306b\u30bb\u30c3\u30c8\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>SWITCHBOT_LOCK_DEVICE_ID=\"\uff08\u3042\u306a\u305f\u306e\u30c7\u30d0\u30a4\u30b9ID\uff09\"<\/strong><\/pre>\n\n\n\n<p>\u305d\u3057\u3066\u3001\u30b3\u30f3\u30d5\u30a3\u30b0\u767b\u9332\u3082\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ \u7701\u7565<br><br><strong>'switchbot' =&gt; [<br>    'devices' =&gt; [<br>        'lock' =&gt; env('SWITCHBOT_LOCK_DEVICE_ID'),<br>    ],<br>],<\/strong><\/pre>\n\n\n\n<p>\u3053\u308c\u3067<code>config('services.switchbot.devices.lock');<\/code>\u3067\u30c7\u30d0\u30a4\u30b9ID\u3092\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"http-switchbot\">SwitchBot API\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3084\u3059\u304f\u3059\u308b\u305f\u3081\u3001Http\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306b\u5c02\u7528macro\u3092\u3064\u304f\u308b<\/h2>\n\n\n\n<p><code>SwitchBot API<\/code>\u306fcurl\u3067\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u306e\u3067\u3059\u304c\u3001\u4ee5\u524d\u516c\u958b\u3057\u305f\u8a18\u4e8b\u3067\u3082\u308f\u304b\u308b\u3068\u304a\u308a\u5c11\u3057\u8907\u96d1\u306a\u8a08\u7b97\u3092\u3057\u306a\u3044\u3068\u3044\u3051\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u3092\u6bce\u56de\u66f8\u304f\u306e\u306f\u9762\u5012\u304f\u3055\u3044\u3067\u3059\u306d\u3002<\/p>\n\n\n\n<p>\u306a\u306e\u3067\u3001<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>Http::switchbot()-&gt;device()-&gt;command();<\/strong><\/pre>\n\n\n\n<p>\u307f\u305f\u3044\u306a\u30b7\u30f3\u30d7\u30eb\u306a\u30b3\u30fc\u30c9\u3067API\u3092\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<br>\u4eca\u56de\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u4ed6\u306e\u6a5f\u80fd\u306b\u3082\u4f7f\u3048\u308b\u306e\u3067\u4fbf\u5229\u3067\u3059\uff01<\/p>\n\n\n\n<p><strong>app\/Providers\/AppServiceProvider.php<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php<br><br>namespace App\\Providers;<br><br>use Illuminate\\Support\\Facades\\Vite;<br>use Illuminate\\Support\\ServiceProvider;<br>use Illuminate\\Support\\Facades\\Http;<br><br>class AppServiceProvider extends ServiceProvider<br>{<br>    <em>\/**<br>     * Register any application services.<br>     *\/<br>    <\/em>public function register(): void<br>    {<br>        \/\/<br>    }<br><br>    <em>\/**<br>     * Bootstrap any application services.<br>     *\/<br>    <\/em>public function boot(): void<br>    {<br>        Vite::prefetch(concurrency: 3);<br><br>        <strong>\/\/ SwitchBot\u30af\u30e9\u30a4\u30a2\u30f3\u30c8<br>        Http::macro('switchbot', function () {<br><br>            return new SwitchBotClient;<br><br>        });<\/strong><br>    }<br>}<br><br><strong>\/* SwitchBot\u30af\u30e9\u30b9 *\/<br><br>class SwitchBotClient<br>{<br>    public function device(string $deviceId): SwitchBotDeviceClient<br>    {<br>        return new SwitchBotDeviceClient($deviceId);<br>    }<br>}<br><br>trait SwitchBotBaseTrait<br>{<br>    \/\/ \u5171\u901a<br>    public function getHeaders(): array<br>    {<br>        $token = config('services.switchbot.access_token'); \/\/ \u3042\u306a\u305f\u306e\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3<br>        $secret = config('services.switchbot.secret_token'); \/\/ \u3042\u306a\u305f\u306e\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30c8\u30fc\u30af\u30f3<br><br>        $nonce = $this-&gt;getGuid();<br>        $t = time() * 1000;<br>        $data = mb_convert_encoding($token . $t . $nonce, 'UTF-8');<br>        $sign = hash_hmac('sha256', $data, $secret, true);<br>        $sign = strtoupper(base64_encode($sign));<br><br>        return [<br>            'Content-Type: application\/json; charset=utf8',<br>            'Authorization: ' . $token,<br>            'sign: ' . $sign,<br>            'nonce: ' . $nonce,<br>            't: ' . $t,<br>        ];<br>    }<br><br>    private function getGuid($data = null)<br>    {<br>        $data = $data ?? random_bytes(16);<br>        assert(strlen($data) == 16);<br>        $data[6] = chr(ord($data[6]) &amp; 0x0f | 0x40);<br>        $data[8] = chr(ord($data[8]) &amp; 0x3f | 0x80);<br><br>        return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));<br>    }<br>}<br><br>class SwitchBotDeviceClient<br>{<br>    use SwitchBotBaseTrait;<br><br>    public function __construct(private string $deviceId)<br>    {<br>    }<br><br>    public function command(array $payload): array<br>    {<br>        $deviceId = $this-&gt;getDeviceId();<br>        $headers = $this-&gt;getHeaders();<br>        $url = 'https:\/\/api.switch-bot.com\/v1.1\/devices\/' . $deviceId . '\/commands';<br><br>        $ch = curl_init($url);<br>        curl_setopt($ch, <em>CURLOPT_POST<\/em>, true);<br>        curl_setopt($ch, <em>CURLOPT_HTTPHEADER<\/em>, $headers);<br>        curl_setopt($ch, <em>CURLOPT_POSTFIELDS<\/em>, json_encode($payload));<br>        curl_setopt($ch, <em>CURLOPT_RETURNTRANSFER<\/em>, true);<br>        $response = curl_exec($ch);<br>        curl_close($ch);<br><br>        if ($response === false) {<br><br>            return ['message' =&gt; 'request_error'];<br><br>        }<br><br>        return json_decode($response, true); \/\/ \u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u914d\u5217\u3068\u3057\u3066\u8fd4\u3059<br>    }<br><br>    public function status(): array<br>    {<br>        $deviceId = $this-&gt;getDeviceId();<br>        $headers = $this-&gt;getHeaders();<br>        $url = 'https:\/\/api.switch-bot.com\/v1.1\/devices\/' . $deviceId . '\/status';<br><br>        $ch = curl_init($url);<br>        curl_setopt($ch, <em>CURLOPT_HTTPGET<\/em>, true);<br>        curl_setopt($ch, <em>CURLOPT_HTTPHEADER<\/em>, $headers);<br>        curl_setopt($ch, <em>CURLOPT_RETURNTRANSFER<\/em>, true);<br>        $response = curl_exec($ch);<br>        curl_close($ch);<br><br>        if ($response === false) {<br><br>            return ['message' =&gt; 'request_error'];<br><br>        }<br><br>        return json_decode($response, true); \/\/ \u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u914d\u5217\u3068\u3057\u3066\u8fd4\u3059<br>    }<br><br>    private function getDeviceId()<br>    {<br>        return str_replace(':', '', $this-&gt;deviceId);<br>    }<br>}<\/strong><\/pre>\n\n\n\n<p>\u203b<code>SwitchBotBaseTrait<\/code>\u306e\u4e2d\u3067\u300c<strong>\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3<\/strong>\u300d\u3068\u300c<strong>\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30c8\u30fc\u30af\u30f3<\/strong>\u300d\u304c\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u306b<code>config\/services.php<\/code>\u306b\u767b\u9332\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n\n\n\n<p><strong>config\/services.php<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ \u7701\u7565<br><br>'switchbot' =&gt; [<br>    'access_token' =&gt; env('SWITCHBOT_ACCESS_TOKEN'),<br>    'secret_token' =&gt; env('SWITCHBOT_SECRET_TOKEN'),<br>],<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">QR\u30b3\u30fc\u30c9\u3067\u89e3\u9320\u3059\u308b\u90e8\u5206\u3092\u3064\u304f\u308b3\u30b9\u30c6\u30c3\u30d7<\/h2>\n\n\n\n<p>\u3067\u306f\u3001\u3053\u3053\u304b\u3089\u306f\u672c\u683c\u7684\u306b<code>Laravel<\/code>\u306e\u958b\u767a\u4f5c\u696d\u3067\u3059\u3002<br>\u5fc5\u8981\u30d5\u30a1\u30a4\u30eb\u3092\u3064\u304f\u308b\u306e\u3067\u3001\u4ee5\u4e0b\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>php artisan make:model LockPermission -msc<\/strong><\/pre>\n\n\n\n<p>\u3059\u308b\u3068\u3001\u300c<strong>\u30e2\u30c7\u30eb<\/strong>\u300d\u300c<strong>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3<\/strong>\u300d\u300c<strong>Seeder<\/strong>\u300d\u300c<strong>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc<\/strong>\u300d\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<br>\u305d\u308c\u305e\u308c\u4e2d\u8eab\u3092\u5909\u66f4\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. \u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5909\u66f4\u3059\u308b<\/h3>\n\n\n\n<p>DB\u30c6\u30fc\u30d6\u30eb\u306e\u69cb\u9020\u3092\u6c7a\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>database\/migrations\/****_**_**_******_create_lock_permissions_table.php<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php<br><br>use Illuminate\\Database\\Migrations\\Migration;<br>use Illuminate\\Database\\Schema\\Blueprint;<br>use Illuminate\\Support\\Facades\\Schema;<br><br>return new class extends Migration<br>{<br>    <em>\/**<br>     * Run the migrations.<br>     *\/<br>    <\/em>public function up(): void<br>    {<br>        <strong>Schema::create('lock_permissions', function (Blueprint $table) {<br>            $table-&gt;id();<br>            $table-&gt;uuid()-&gt;comment('UUID');<br>            $table-&gt;string('device_id')-&gt;comment('\u30c7\u30d0\u30a4\u30b9ID');<br>            $table-&gt;dateTime('expires_at')-&gt;nullable()-&gt;comment('\u6a29\u9650\u306e\u6709\u52b9\u671f\u9650');<br>            $table-&gt;timestamps();<br>        });<\/strong><br>    }<br><br>    <em>\/**<br>     * Reverse the migrations.<br>     *\/<br>    <\/em>public function down(): void<br>    {<br>        Schema::dropIfExists('lock_permissions');<br>    }<br>};<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2. Seeder\u3092\u5909\u66f4\u3059\u308b<\/h3>\n\n\n\n<p>\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u3092\u3064\u304f\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>database\/seeders\/LockPermissionSeeder.php<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php<br><br>namespace Database\\Seeders;<br><br>use App\\Models\\LockPermission;<br>use Illuminate\\Database\\Console\\Seeds\\WithoutModelEvents;<br>use Illuminate\\Database\\Seeder;<br>use Illuminate\\Support\\Str;<br><br>class LockPermissionSeeder extends Seeder<br>{<br>    <em>\/**<br>     * Run the database seeds.<br>     *\/<br>    <\/em>public function run(): void<br>    {<br>        <strong>$permissions = [<br>            [<br>                'device_id' =&gt; '\uff08\u3053\u3053\u306b\u3042\u306a\u305f\u306e\u30c7\u30d0\u30a4\u30b9ID\uff09',<br>                'expires_at' =&gt; now()-&gt;addDays(30),<br>            ],<br>            [<br>                'device_id' =&gt; '\uff08\u3053\u3053\u306b\u3042\u306a\u305f\u306e\u30c7\u30d0\u30a4\u30b9ID\uff09',<br>                'expires_at' =&gt; now()-&gt;subDays(30), \/\/ \u671f\u9650\u5207\u308c<br>            ],<br>            [<br>                'device_id' =&gt; '\uff08\u3053\u3053\u306b\u3042\u306a\u305f\u306e\u30c7\u30d0\u30a4\u30b9ID\uff09',<br>                'expires_at' =&gt; null, \/\/ \u6c38\u7d9a\u7684\u306a\u6a29\u9650\uff08\u7ba1\u7406\u8005\u6a29\u9650\u306a\u3069\uff09<br>            ],<br>        ];<br><br>        foreach ($permissions as $permission) {<br><br>            $lockPermission = new LockPermission();<br>            $lockPermission-&gt;uuid = Str::<em>uuid<\/em>();<br>            $lockPermission-&gt;device_id = $permission['device_id'];<br>            $lockPermission-&gt;expires_at = $permission['expires_at'];<br>            $lockPermission-&gt;save();<br><br>        }<br>    }<\/strong><br>}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3. \u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u5909\u66f4\u3059\u308b<\/h3>\n\n\n\n<p>\u6700\u5f8c\u306b\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u5185\u5bb9\u3068\u3057\u3066\u306f\u3001<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>index\uff1aQR\u30b3\u30fc\u30c9\u8868\u793a\u3002\u30c6\u30b9\u30c8\u7528\u3002<\/li>\n\n\n\n<li>create\u3068store\uff1a\u30ed\u30c3\u30af\u89e3\u9664<\/li>\n<\/ul>\n\n\n\n<p>\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>app\/Http\/Controllers\/LockPermissionController.php<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>&lt;?php<br><br>namespace App\\Http\\Controllers;<br><br>use App\\Models\\LockPermission;<br>use Illuminate\\Http\\Request;<br>use Illuminate\\Support\\Facades\\Http;<br><br>class LockPermissionController extends Controller<br>{<br>    \/\/ QR\u30b3\u30fc\u30c9\u8868\u793a<br>    public function index()<br>    {<br>        \/\/ \u671f\u9650\u5207\u308c\u3082\u542b\u3081\u3066\u5168\u3066\u306e\u30ed\u30c3\u30af\u89e3\u9664\u6a29\u9650\u3092\u53d6\u5f97<br>        $lockPermissions = LockPermission::<em>withoutGlobalScopes<\/em>()-&gt;get();<br><br>        return inertia('LockPermission\/Index', [<br>            'uuids' =&gt; $lockPermissions-&gt;pluck('uuid')<br>        ]);<br>    }<br><br>    \/\/ \u30ed\u30c3\u30af\u89e3\u9664\uff08\u8868\u793a\u7528\uff09<br>    public function create()<br>    {<br>        return inertia('LockPermission\/Create');<br>    }<br><br>    \/\/ \u30ed\u30c3\u30af\u89e3\u9664\uff08Switchbot API\u7528\uff09<br>    public function store(LockPermission $lockPermission)<br>    {<br>        $status = 'FAILED'; \/\/ Enum\u306a\u3069\u3067\u7ba1\u7406\u3059\u308b\u306e\u304c\u30d9\u30bf\u30fc<br><br>        \/\/ SwitchBot API\u3067\u30ed\u30c3\u30af\u89e3\u9664<br><br>        $deviceId = config('services.switchbot.devices.lock');<br>        $payload = [<br>            'command' =&gt; 'unlock',<br>            'parameter' =&gt; 'default',<br>            'commandType' =&gt; 'command',<br>        ];<br>        $response = Http::<em>switchbot<\/em>()<br>            -&gt;device($deviceId)<br>            -&gt;command($payload);<br><br>        if($response['message'] === 'success') {<br><br>            $status = 'SUCCESS';<br><br>        }<br><br>        \/\/ \u30ed\u30b0\u306b\u89e3\u9320\u30c7\u30fc\u30bf\u3092\u8a18\u9332\uff08\u672c\u6765\u306fDB\u306b\u4fdd\u5b58\u3057\u305f\u65b9\u304c\u3044\u3044\u3067\u3057\u3087\u3046\uff09<br>        logger()-&gt;info('LockPermission used', [<br>            'uuid' =&gt; $lockPermission-&gt;uuid,<br>            'status' =&gt; $status,<br>        ]);<br><br>        return ['status' =&gt; $status];<br>    }<br>}<\/strong><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u30d3\u30e5\u30fc\u3092\u3064\u304f\u308b<\/h2>\n\n\n\n<p>\u3067\u306f\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u5185\u3067\u30bb\u30c3\u30c8\u3057\u305f\u30d3\u30e5\u30fc2\u3064\u3092\u7528\u610f\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Index<\/h3>\n\n\n\n<p>QR\u30b3\u30fc\u30c9\u306e\u4e00\u89a7\u3092\u8868\u793a\u3059\u308b\u30da\u30fc\u30b8\u3067\u3059\u3002<br>\u30c6\u30b9\u30c8\u7528\u3067\u306e\u8868\u793a\u3067\u3059\u306e\u3067\u3001\u672c\u756a\u3067\u306f\u7ba1\u7406\u8005\u7528\u3068\u3057\u3066\u3064\u304b\u3046\u3053\u3068\u306b\u306a\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p><strong>resources\/js\/Pages\/LockPermission\/Index.vue<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>&lt;script setup lang=\"ts\"&gt;<br>import { <em>Head <\/em>} from '@inertiajs\/vue3';<br>import QRCode from 'qrcode';<br>import { nextTick, onMounted } from 'vue';<br><br>const props = <em>defineProps<\/em>&lt;{<br>    uuids: string[];<br>}&gt;();<br><br>onMounted(() =&gt; {<br>    nextTick(() =&gt; {<br>        props.uuids.forEach((uuid) =&gt; {<br>            const canvas = <em>document<\/em>.getElementById(<br>                `canvas-${uuid}`,<br>            ) as HTMLCanvasElement | null;<br>            if (canvas) {<br>                QRCode.toCanvas(canvas, uuid, (error?: Error | null) =&gt; {<br>                    if (error) <em>console<\/em>.error(error);<br>                });<br>            }<br>        });<br>    });<br>});<br>&lt;\/script&gt;<br><br>&lt;template&gt;<br>    &lt;Head title=\"\u30ed\u30c3\u30af\u89e3\u9664UUID\"&gt;&lt;\/Head&gt;<br><br>    &lt;div class=\"px-16 py-10\"&gt;<br>        &lt;h1 class=\"mb-8 text-3xl font-bold\"&gt;\ud83d\udd13\u30ed\u30c3\u30af\u89e3\u9664UUID&lt;\/h1&gt;<br>        &lt;div class=\"flex gap-5\"&gt;<br>            &lt;div<br>                v-for=\"uuid in uuids\"<br>                :key=\"uuid\"<br>                class=\"mb-10 rounded-lg bg-yellow-200 p-5 pb-4\"<br>            &gt;<br>                &lt;canvas<br>                    :id=\"`canvas-${uuid}`\"<br>                    class=\"mx-auto mb-5 h-20 w-20 rounded-sm\"<br>                &gt;&lt;\/canvas&gt;<br>                &lt;div<br>                    class=\"rounded-sm bg-yellow-400 px-3 py-1.5 text-xs font-bold text-yellow-800\"<br>                &gt;<br>                    {{ uuid }}<br>                &lt;\/div&gt;<br>            &lt;\/div&gt;<br>        &lt;\/div&gt;<br>    &lt;\/div&gt;<br>&lt;\/template&gt;<\/strong><\/pre>\n\n\n\n<p>\u8868\u793a\u3059\u308b\u3068\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full image-border-3\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"223\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/10\/laravel-switchbot-lock-1.png\" alt=\"\" class=\"wp-image-17627\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/10\/laravel-switchbot-lock-1.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/10\/laravel-switchbot-lock-1-300x105.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<p class=\"has-small-font-size\">\u203b\u8868\u793a\u3057\u305f\u30da\u30fc\u30b8\u304b\u3089\u3001QR\u30b3\u30fc\u30c9\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3082\u3067\u304d\u307e\u3059\u3088\ud83d\udc4d<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Create<\/h3>\n\n\n\n<p>QR\u30b3\u30fc\u30c9\u3092\u8aad\u307f\u53d6\u308a\u3001\u305d\u306e\u5185\u5bb9\u3092\u30c7\u30fc\u30bf\u9001\u4fe1\u3059\u308b\u30da\u30fc\u30b8\u3067\u3059\u3002<\/p>\n\n\n\n<p><strong>resources\/js\/Pages\/LockPermission\/Create.vue<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>&lt;script setup lang=\"ts\"&gt;<br>import { <em>Head <\/em>} from '@inertiajs\/vue3';<br>import <em>axios <\/em>from 'axios';<br>import jsQR from 'jsqr';<br>import { ref } from 'vue';<br><br>\/\/ QR\u30b3\u30fc\u30c9\u30b9\u30ad\u30e3\u30ca\u30fc<br>const videoRef = ref&lt;HTMLVideoElement | null&gt;(<em>document<\/em>.createElement('video'));<br>const canvasRef = ref&lt;HTMLCanvasElement | null&gt;(null);<br>const isScanning = ref(false);<br>let stream: MediaStream | null = null;<br>const onScan = async () =&gt; {<br>    isScanning.value = true;<br><br>    \/\/ 10\u79d2\u5f8c\u306b\u81ea\u52d5\u30ad\u30e3\u30f3\u30bb\u30eb<br>    setTimeout(() =&gt; {<br>        if (isScanning.value) {<br>            onCancelScan();<br>        }<br>    }, 10000);<br><br>    \/\/ \u30ab\u30e1\u30e9\u8d77\u52d5<br>    stream = await <em>navigator<\/em>.mediaDevices.getUserMedia({<br>        video: { facingMode: 'environment' },<br>    });<br>    if (videoRef.value) {<br>        videoRef.value.srcObject = stream;<br>        videoRef.value.play();<br>    }<br>    scanLoop();<br>};<br>const scanLoop = () =&gt; {<br>    if (!videoRef.value || !canvasRef.value) return;<br>    const ctx = canvasRef.value.getContext('2d');<br>    if (!ctx) return;<br><br>    \/\/ \u6bce\u30d5\u30ec\u30fc\u30e0\u30c1\u30a7\u30c3\u30af<br>    const scanFrame = async () =&gt; {<br>        if (videoRef.value?.readyState === videoRef.value?.HAVE_ENOUGH_DATA) {<br>            if (!canvasRef.value || !videoRef.value) return;<br><br>            \/\/ \u753b\u9762\u5e45\u306b\u5408\u308f\u305b\u3066\u9ad8\u3055\u3092\u8abf\u6574<br>            canvasRef.value.width = <em>window<\/em>.innerWidth;<br>            canvasRef.value.height =<br>                videoRef.value.videoHeight \/<br>                (videoRef.value.videoWidth \/ <em>window<\/em>.innerWidth);<br>            \/\/ canvas\u306b\u30d3\u30c7\u30aa\u753b\u9762\u3092\u63cf\u753b<br>            ctx.drawImage(<br>                videoRef.value,<br>                0,<br>                0,<br>                canvasRef.value.width,<br>                canvasRef.value.height,<br>            );<br>            const imageData = ctx.getImageData(<br>                0,<br>                0,<br>                canvasRef.value.width,<br>                canvasRef.value.height,<br>            );<br>            const code = jsQR(<br>                imageData.data,<br>                imageData.width,<br>                imageData.height,<br>            );<br>            if (code) {<br>                const uuid = code.data;<br>                onCancelScan();<br>                onSubmit(uuid);<br>                return;<br>            }<br>        }<br>        requestAnimationFrame(scanFrame);<br>    };<br>    scanFrame();<br>};<br><br>\/\/ \u9001\u4fe1\uff08\u30ed\u30c3\u30af\u89e3\u9664\uff09<br>type Status = 'IDLE' | 'SUCCESS' | 'FAILED';<br>const status = ref&lt;Status&gt;('IDLE');<br>const onSubmit = (uuid: string) =&gt; {<br>    const url = <em>route<\/em>('lock_permission.store', { lockPermission: uuid });<br>    <em>axios<br>        <\/em>.post(url)<br>        .then((response) =&gt; {<br>            status.value = response.data.status;<br>        })<br>        .catch((error) =&gt; {<br>            status.value = 'FAILED';<br>            <em>console<\/em>.error('\u30a8\u30e9\u30fc:', error);<br>        })<br>        .finally(() =&gt; {<br>            \/\/ 5\u79d2\u5f8c\u306b\u30b9\u30c6\u30fc\u30bf\u30b9\u3092\u30ea\u30bb\u30c3\u30c8<br>            setTimeout(() =&gt; {<br>                status.value = 'IDLE';<br>            }, 5000);<br>        });<br>};<br>const onCancelScan = () =&gt; {<br>    isScanning.value = false;<br>    if (stream) {<br>        stream.getTracks().forEach((track) =&gt; track.stop());<br>        stream = null;<br>    }<br>    if (videoRef.value) {<br>        videoRef.value.srcObject = null;<br>        videoRef.value.pause();<br>    }<br>};<br>&lt;\/script&gt;<br><br>&lt;template&gt;<br>    &lt;Head title=\"\u30ed\u30c3\u30af\u89e3\u9664\"&gt;&lt;\/Head&gt;<br><br>    &lt;div class=\"px-8 py-10\"&gt;<br>        &lt;h1 class=\"mb-8 text-center text-3xl font-bold md:text-4xl\"&gt;<br>            \ud83d\udd13QR\u30b3\u30fc\u30c9&lt;small&gt;\u3092\u30b9\u30ad\u30e3\u30f3\u3057\u3066\u89e3\u9320\u3057\u3066\u304f\u3060\u3055\u3044&lt;\/small&gt;<br>        &lt;\/h1&gt;<br><br>        &lt;div<br>            class=\"text-center font-bold text-green-600\"<br>            v-if=\"status === 'SUCCESS'\"<br>        &gt;<br>            \uff3b\u5b8c\u4e86\uff3d&lt;br \/&gt;<br>            \u30ed\u30c3\u30af\u304c\u89e3\u9664\u3055\u308c\u307e\u3057\u305f\u3002<br>        &lt;\/div&gt;<br>        &lt;div<br>            class=\"text-center font-bold text-red-500\"<br>            v-if=\"status === 'FAILED'\"<br>        &gt;<br>            \uff3b\u30a8\u30e9\u30fc\uff3d&lt;br \/&gt;<br>            \u4e00\u81f4\u3059\u308b\u30ad\u30fc\u304c\u5b58\u5728\u3057\u306a\u3044\u304b\u3001\u6709\u52b9\u671f\u9650\u304c\u5207\u308c\u3066\u3044\u307e\u3059\u3002<br>        &lt;\/div&gt;<br><br>        &lt;div class=\"fixed inset-0 z-10 bg-black\/50\" v-show=\"isScanning\"&gt;<br>            &lt;div<br>                class=\"fixed left-0 right-0 top-1\/2 -translate-y-1\/2 text-center\"<br>            &gt;<br>                &lt;canvas ref=\"canvasRef\"&gt;&lt;\/canvas&gt;<br>            &lt;\/div&gt;<br>        &lt;\/div&gt;<br><br>        &lt;div class=\"fixed bottom-12 left-0 right-0 text-center\"&gt;<br>            &lt;button<br>                type=\"button\"<br>                class=\"rounded-lg bg-sky-500 px-6 py-5 text-xl font-bold text-white\"<br>                @click=\"onScan\"<br>            &gt;<br>                QR\u30b3\u30fc\u30c9&lt;small&gt;\u3092\u8aad\u307f\u53d6\u308b&lt;\/small&gt;<br>            &lt;\/button&gt;<br>        &lt;\/div&gt;<br>    &lt;\/div&gt;<br>&lt;\/template&gt;<\/strong><\/pre>\n\n\n\n<p>\u898b\u305f\u76ee\u306f\u3053\u3093\u306a\u30ab\u30f3\u30b8\u3067\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full image-border-3\"><img loading=\"lazy\" decoding=\"async\" width=\"250\" height=\"555\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/10\/laravel-switchbot-lock-2.png\" alt=\"\" class=\"wp-image-17828\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/10\/laravel-switchbot-lock-2.png 250w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/10\/laravel-switchbot-lock-2-135x300.png 135w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u9375\u304c\u958b\u3044\u305f\u307e\u307e\u306e\u3068\u304d\u306f\u3001\u81ea\u52d5\u3067\u65bd\u9320\u3059\u308b\u3088\u3046\u306b\u3059\u308b<\/h2>\n\n\n\n<p>\u3053\u3053\u307e\u3067\u306f\u9375\u3092\u958b\u3051\u308b\u52d5\u4f5c\u3067\u3057\u305f\u304c\u3001\u3082\u3057\u304b\u3059\u308b\u3068<strong>\u9375\u3092\u9589\u3081\u5fd8\u308c\u308b\u4eba\u304c\u3044\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/strong><\/p>\n\n\n\n<p>\u3082\u3057\u304f\u306f\u300c\u81ea\u52d5\u3067\u9589\u3081\u3066\u304f\u308c\u3088\u2026\ud83d\ude05\u300d\u3068\u3044\u3046\u5834\u5408\u3082\u3042\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u30bf\u30a4\u30de\u30fc\u3067\u9375\u306e\u72b6\u614b\u3092\u76e3\u8996\u3057\u3001\u3082\u3057\u958b\u3044\u305f\u307e\u307e\u306b\u306a\u3063\u3066\u3044\u305f\u3089\u81ea\u52d5\u3067\u65bd\u9320\u3059\u308b\u6a5f\u80fd\u3082\u3064\u304f\u3063\u3066\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3067\u306f\u3001\u5c02\u7528\u306e<code>Artisan<\/code>\u30b3\u30de\u30f3\u30c9\u3092\u3064\u304f\u308b\u306e\u3067\u3001\u4ee5\u4e0b\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>php artsan make:command CheckSmartBotLockCommand<\/strong><\/pre>\n\n\n\n<p>\u3059\u308b\u3068\u3001\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u4e2d\u8eab\u3092\u3053\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>app\/Console\/Commands\/CheckSmartBotLockCommand.php<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>&lt;?php<br><br>namespace App\\Console\\Commands;<br><br>use Illuminate\\Console\\Command;<br>use Illuminate\\Support\\Facades\\Http;<br><br>class CheckSmartBotLockCommand extends Command<br>{<br>    <em>\/**<br>     * The name and signature of the console command.<br>     *<br>     * @var string<br>     *\/<br>    <\/em>protected $signature = 'check:switchbot-lock';<br><br>    <em>\/**<br>     * The console command description.<br>     *<br>     * @var string<br>     *\/<br>    <\/em>protected $description = 'Check switchbot lock status and lock automatically if unlocked.';<br><br>    <em>\/**<br>     * Execute the console command.<br>     *\/<br>    <\/em>public function handle()<br>    {<br>        $deviceId = config('services.switchbot.devices.lock');<br><br>        \/\/ \u30ed\u30c3\u30af\u306e\u72b6\u614b\u3092\u53d6\u5f97\u3059\u308b<br>        $response = Http::<em>switchbot<\/em>()<br>            -&gt;device($deviceId)<br>            -&gt;status();<br>        $lockState = data_get($response, 'body.lockState', 'unknown');<br><br>        if ($lockState === 'unlocked') {<br><br>            \/\/ \u7a7a\u3044\u305f\u307e\u307e\u306a\u306e\u3067\u3001\u81ea\u52d5\u30ed\u30c3\u30af\u3059\u308b<br>            $payload = [<br>                'command' =&gt; 'lock',<br>                'parameter' =&gt; 'default',<br>                'commandType' =&gt; 'command',<br>            ];<br>            Http::<em>switchbot<\/em>()<br>                -&gt;device($deviceId)<br>                -&gt;command($payload);<br><br>        } else if (in_array($lockState, ['jammed', 'unknown'])) {<br><br>            \/\/ \u3053\u3053\u306f\u60f3\u5b9a\u5916\u306a\u306e\u3067\u30e1\u30fc\u30eb\u901a\u77e5\u306a\u3069\u3092\u3059\u308b\u3068\u3044\u3044\u3067\u3057\u3087\u3046\u3002<br>            logger()-&gt;warning('SwitchBot Lock in unexpected state', [<br>                'lockState' =&gt; $lockState,<br>            ]);<br><br>        }<br>    }<br>}<\/strong><\/pre>\n\n\n\n<p class=\"has-small-font-size\">\u203b\u3082\u3057\u304b\u3059\u308b\u3068\u3001\u65bd\u9320\u3068QR\u30b9\u30ad\u30e3\u30f3\u306b\u3088\u308b\u89e3\u9320\u304c\u30d0\u30c3\u30c6\u30a3\u30f3\u30b0\u3059\u308b\u3053\u3068\u3082\u8003\u3048\u3089\u308c\u308b\u306e\u3067\u3001\u89e3\u9320\u51e6\u7406\u3092\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u81ea\u52d5\u65bd\u9320\u306f\u3057\u306a\u3044\u3088\u3046\u306b\u3057\u305f\u307b\u3046\u304c\u3044\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\uff08\u4eca\u56de\u306f\u7701\u7565\u3057\u3066\u3044\u307e\u3059\uff09<\/p>\n\n\n\n<p class=\"has-small-font-size\">\u203b\u672c\u6765\u306f\u958b\u9589\u30bb\u30f3\u30b5\u30fc\u3092\u3064\u304b\u3063\u3066\u53b3\u5bc6\u306b\u65bd\u9320\u3059\u3079\u304d\u3067\u3059\u304c\u3001\u4eca\u56de\u306f\u30c6\u30b9\u30c8\u3068\u3044\u3046\u3053\u3068\u3067\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u304a\u307e\u3051\uff1aSwitchBot\u306e\u6a5f\u68b0\u3092\u30aa\u30fc\u30af\u30b7\u30e7\u30f3\u8cb7\u3046\u5834\u5408\u306f\u6ce8\u610f\uff01\uff08\u6700\u60aa\u30da\u30a2\u30ea\u30f3\u30b0\u3067\u304d\u306a\u3044\u304b\u3082\ud83d\ude2b\uff09<\/h2>\n\n\n\n<p>\u5b9f\u306f\u4eca\u56de\u3001<code>SwitchBot Lock Lite<\/code>\u3092\u30e1\u30eb\u30ab\u30ea\u3067\u8cfc\u5165\u3057\u305f\u3093\u3067\u3059\u304c\u3001\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3068\u3044\u3046\u306e\u3082\u3001\u30a2\u30d7\u30ea\u306e\u30da\u30a2\u30ea\u30f3\u30b0\u306b\u5931\u6557\u3057\u3066\u300c\u8cfc\u5165\u3057\u305f\u8a3c\u62e0\u3092\u51fa\u305b\u300d\u3068\u8a00\u308f\u308c\u305f\u304b\u3089\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"has-small-font-size\">\u30ec\u30a2\u30b1\u30fc\u30b9\u304b\u3082\u3067\u3059\u304c\u2026\ud83e\udd14<\/p>\n\n\n\n<p>\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b<strong><code>Amazon<\/code>\u306a\u3069\u3067\u8cfc\u5165\u3057\u305f\u3068\u304d\u306e\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u306a\u3044\u3068\u3044\u3051\u307e\u305b\u3093\u3002<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full image-border-3\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"436\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/10\/laravel-switchbot-lock-6.png\" alt=\"\" class=\"wp-image-17884\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/10\/laravel-switchbot-lock-6.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/10\/laravel-switchbot-lock-6-300x204.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<p><strong>\u672c\u6587\uff1a<\/strong>Please upload an image of your proof of purchase, such as an Amazon order screenshot or shopping receipt. The image must contain your order number and the product name.<\/p>\n\n\n\n<p><strong>\u65e5\u672c\u8a9e\u8a33\uff1a<\/strong>\u8cfc\u5165\u8a3c\u660e\u66f8\u306e\u753b\u50cf\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u3066\u304f\u3060\u3055\u3044\u3002Amazon\u306e\u6ce8\u6587\u753b\u9762\u306e\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u3084\u30ec\u30b7\u30fc\u30c8\u306a\u3069\u3092\u3054\u5229\u7528\u3044\u305f\u3060\u3051\u307e\u3059\u3002\u753b\u50cf\u306b\u306f\u6ce8\u6587\u756a\u53f7\u3068\u88fd\u54c1\u540d\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4eca\u56de\u51fa\u54c1\u8005\u3055\u3093\u304c\u5bfe\u5fdc\u3057\u3066\u304f\u308c\u3066\u554f\u984c\u306a\u304b\u3063\u305f\u3093\u3067\u3059\u304c\u3001\u4e2d\u53e4\u306e\u5834\u5408\u306f\u305d\u3046\u3044\u3063\u305f\u30ea\u30b9\u30af\u3082\u3042\u308b\u306e\u3067\u6ce8\u610f\u3057\u3066\u304a\u3044\u305f\u307b\u3046\u304c\u3044\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p>\u3061\u306a\u307f\u306b\u3001\u4ed6\u306e\u65b9\u304c\u51fa\u54c1\u3059\u308bSwitchBot\u306e\u5546\u54c1\u306e\u8aac\u660e\u306b\u300c\u30da\u30a2\u30ea\u30f3\u30b0\u306f\u3059\u3067\u306b\u89e3\u9664\u3057\u3066\u3044\u307e\u3059\u300d\u3068\u8a18\u8ff0\u304c\u3042\u3063\u305f\u305f\u3081\u3001\u3082\u3057\u304b\u3059\u308b\u3068\u5143\u3005\u306e\u30da\u30a2\u30ea\u30f3\u30b0\u3092\u89e3\u9664\u3059\u308c\u3070\u89e3\u6c7a\u3059\u308b\u53ef\u80fd\u6027\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30c6\u30b9\u30c8\u3057\u3066\u307f\u308b<\/h2>\n\n\n\n<p>\u3067\u306f\u5b9f\u969b\u306b\u30c6\u30b9\u30c8\u3057\u3066\u307f\u307e\u3057\u3087\u3046\uff01<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">QR\u30b3\u30fc\u30c9\u3067\u30ed\u30c3\u30af\u89e3\u9664\u3059\u308b\u30c6\u30b9\u30c8<\/h3>\n\n\n\n<p>\u52d5\u753b\u3092\u7528\u610f\u3057\u305f\u306e\u3067\u3001\u305c\u3072\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-9-16 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"\u3010Laravel + Vue 3\u3011SwitchBot\u30ed\u30c3\u30afLite\u3092QR\u30b3\u30fc \u30c9\u3092\u30b9\u30ad\u30e3\u30f3\u3057\u3066\u89e3\u9320\u3059\u308b\u69d8\u5b50\" width=\"443\" height=\"788\" src=\"https:\/\/www.youtube.com\/embed\/dha4wXd1pD8?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>\u3046\u307e\u304f\u30ed\u30c3\u30af\u89e3\u9664\u3067\u304d\u307e\u3057\u305f\u306d\uff01<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u81ea\u52d5\u65bd\u9320\u3059\u308b\u6a5f\u80fd\u306e\u30c6\u30b9\u30c8<\/h3>\n\n\n\n<p>\u3067\u306f\u3001\u9589\u3081\u5fd8\u308c\u305f\u3068\u304d\u306e\u81ea\u52d5\u65bd\u9320\u3067\u3059\u3002<br>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p>\u3069\u3046\u306a\u308b\u3067\u3057\u3087\u3046\u304b\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-9-16 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"\u3010Laravel\u3011Artisan\u30b3\u30de\u30f3\u30c9\u3092\u3064\u304b\u3063\u3066SwitchBot\u30ed\u30c3\u30afLite\u306e\u65bd\u9320\u3092\u3059\u308b\u69d8\u5b50\" width=\"443\" height=\"788\" src=\"https:\/\/www.youtube.com\/embed\/AQfNqJMlixk?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>\u306f\u3044\uff01<br>\u3053\u3063\u3061\u3082\u3046\u307e\u304f\u3044\u304d\u307e\u3057\u305f\u306d\u3002<\/p>\n\n\n\n<p>\u3059\u3079\u3066\u6210\u529f\u3067\u3059\ud83d\ude0a\u2728<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f01\u696d\u69d8\u3078\u306e\u3054\u63d0\u6848<\/h2>\n\n\n\n<p>\u4eca\u56de\u306e\u30c6\u30af\u30cb\u30c3\u30af\u3092\u3064\u304b\u3046\u3068\u3001\u5165\u5ba4\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u3060\u3051\u3067\u306a\u304f\u6b21\u306e\u3088\u3046\u306a\u6a5f\u80fd\u3092\u3064\u304f\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u81ea\u52d5\u30c1\u30a7\u30c3\u30af\u30a4\u30f3\u30fb\u30c1\u30a7\u30c3\u30af\u30a2\u30a6\u30c8<\/li>\n\n\n\n<li>QR\u8a8d\u8a3c\u3067\u30b2\u30b9\u30c8\u53d7\u4ed8<\/li>\n\n\n\n<li>\u30ec\u30f3\u30bf\u30eb\u30b9\u30da\u30fc\u30b9\u306e\u81ea\u52d5\u8cb8\u3057\u51fa\u3057<\/li>\n\n\n\n<li>\u6c11\u6cca\u306e\u30bb\u30eb\u30d5\u89e3\u9320<\/li>\n\n\n\n<li>\u8cc7\u6599\u5ba4\u3078\u306e\u671f\u9593\u3092\u9650\u5b9a\u3057\u305f\u5165\u5ba4<\/li>\n\n\n\n<li>\u5b85\u914d\u30dc\u30c3\u30af\u30b9\u306e\u81ea\u52d5\u53d7\u3051\u53d6\u308a<\/li>\n\n\n\n<li>\u4fdd\u80b2\u5712\u306a\u3069\u306e\u5165\u9000\u5712\u7ba1\u7406<\/li>\n<\/ul>\n\n\n\n<p>\u3082\u3057\u3053\u3046\u3044\u3063\u305f\u6a5f\u80fd\u3092\u3054\u5e0c\u671b\u3067\u3057\u305f\u3089\u304a\u529b\u306b\u306a\u308c\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u306e\u3067\u3001\u305c\u3072<strong><a href=\"https:\/\/contact-me.capilano-fw.com\/\">\u304a\u554f\u3044\u5408\u308f\u305b<\/a><\/strong>\u304b\u3089\u3054\u76f8\u8ac7\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p>\u304a\u5f85\u3061\u3057\u3066\u304a\u308a\u307e\u3059\ud83d\ude0a\u2728<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u304a\u308f\u308a\u306b<\/h2>\n\n\n\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f<code>SwitchBot Lock<\/code>\u3092\u3064\u304b\u3063\u3066\u5165\u5ba4\u30b7\u30b9\u30c6\u30e0\u3092\u3064\u304f\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u500b\u4eba\u7684\u306b<code>SwitchBot<\/code>\u306f<strong>\u300c\u624b\u9803\u306a\u5024\u6bb5\u300d\u3067\u8cfc\u5165\u3067\u304d\u308b\u306e\u3067\u3001\u3044\u3044\u3067\u3059\u306d\uff01<\/strong><\/p>\n\n\n\n<p>\u6b63\u76f4\u4eca\u56de\u8cfc\u5165\u3057\u305f\u6a5f\u68b0\u306f\u81ea\u5206\u3067\u306f\u3064\u304b\u308f\u306a\u3044\uff08\u3064\u307e\u308a\u3001\u30d6\u30ed\u30b0\u306e\u305f\u3081\u3060\u3051\u306b\u8cb7\u3044\u307e\u3057\u305f\ud83d\ude02\uff09\u3067\u3059\u304c\u3001\u30ea\u30fc\u30ba\u30ca\u30d6\u30eb\u306a\u5024\u6bb5\u3060\u3068\u300c\u7814\u7a76\u300d\u304c\u3057\u3084\u3059\u304f\u3001\u304d\u3063\u3068\u88fe\u91ce\u304c\u5e83\u304c\u308a\u307e\u3059\u306d\u3002<\/p>\n\n\n\n<p>\u3061\u306a\u307f\u306b\u904e\u53bb\u306b<code>RFID<\/code>\uff08\u96fb\u6ce2\u3067IC\u30bf\u30b0\u3092\u8aad\u307f\u66f8\u304d\u3059\u308b\u8a8d\u8b58\u30b7\u30b9\u30c6\u30e0\uff09\u306e\u8a18\u4e8b\u3092\u66f8\u3053\u3046\u304b\u3068\u3082\u601d\u3063\u305f\u3093\u3067\u3059\u304c\u3001\u305f\u3057\u304b\u6a5f\u68b0\u304c5\u4e07\u5186\u3068\u304b\u3059\u308b\u306e\u3067\u898b\u9001\u3063\u305f\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3044\u3064\u304b\u30e1\u30eb\u30ab\u30ea\u3067\u5b89\u304f\u58f2\u3063\u3066\u305f\u3089\u8003\u3048\u307e\u3059\u306d\uff01\uff08\u8ab0\u304b\u6295\u3052\u58f2\u308a\u3057\u3066\ud83d\ude4f\u2728\uff09<\/p>\n\n\n\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306e\u4f5c\u696d\u3082\u697d\u3057\u304b\u3063\u305f\u3067\u3059\u3002<br>\u305c\u3072\u7686\u3055\u3093\u3082\u3084\u3063\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n\n\n\n<p>\u3067\u306f\u3067\u306f\u301c\uff01<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"370\" height=\"290\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/09\/no_10.png\" alt=\"\" class=\"wp-image-11002\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/09\/no_10.png 370w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/09\/no_10-300x235.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/><\/figure><\/div>\n\n\n<p class=\"has-text-align-center\">\u300c\u305f\u307e\u306b\u3001\u76ee\u7684\u306e\u98df\u6750\uff3b\u3060\u3051\uff3d\u3092\u5fd8\u308c\u3066<br>\u5e30\u3063\u3066\u304f\u308b\u3053\u3068\u304c\u3042\u308b\u3093\u3067\u3059\u304c\u30fb\u30fb\u30fb\u300d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001AI\u306b\u3088\u308b\u4eee\u60f3\u7a7a\u9593\u306e\u652f\u914d\u304c\u3069\u3093\u3069\u3093\u5f37\u307e\u3063\u3066\u3044\u308b\u4eca\u65e5\u3053\u306e\u9803\u3067\u3059\u3002\u305d\u3093\u306a\u6642\u4ee3\u306e\u6d41\u308c\u306b\u4e57\u3063\u3066\u3044\u304b\u306d\u3070\u3068\u3044\u3046\u3053\u3068\u3067\u300c\u30c7\u30b8\u30bf\u30eb\u3068\u30ea\u30a2\u30eb\u306e\u878d\u5408\u300d\u306b\u3064\u3044\u3066\u8272\u3005\u8003\u3048\u3066 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=17580\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u3010Laravel\u30fbSwitchBot\u3011\u305f\u3063\u305f1\u4e07\u5186\u53f0\u3067\u5165\u5ba4\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u3092\u5c0e\u5165\u3059\u308b\u65b9\u6cd5&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":17988,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[264],"class_list":["post-17580","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","tag-switchbot"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/17580","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=17580"}],"version-history":[{"count":382,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/17580\/revisions"}],"predecessor-version":[{"id":18861,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/17580\/revisions\/18861"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/17988"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17580"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=17580"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=17580"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}