{"id":17990,"date":"2025-11-10T07:00:00","date_gmt":"2025-11-09T22:00:00","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=17990"},"modified":"2025-11-14T16:56:13","modified_gmt":"2025-11-14T07:56:13","slug":"%e3%80%90switchbot-laravel%e3%80%91%e9%96%8b%e9%96%89%e3%82%bb%e3%83%b3%e3%82%b5%e3%83%bc%e3%81%a7%e8%96%ac%e3%81%ae%e9%a3%b2%e3%81%bf%e5%bf%98%e3%82%8c%e3%82%92%e9%98%b2%e3%81%90%e6%a9%9f%e8%83%bd","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=17990","title":{"rendered":"\u3010SwitchBot + Laravel\u3011\u958b\u9589\u30bb\u30f3\u30b5\u30fc\u3067\u85ac\u306e\u98f2\u307f\u5fd8\u308c\u3092\u9632\u3050\u6a5f\u80fd\u3092\u3064\u304f\u3063\u3066\u307f\u305f\uff01"},"content":{"rendered":"\n<p>\u3055\u3066\u3055\u3066\u3001\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u3068\u7269\u7406\u64cd\u4f5c\u306e\u9023\u643a\u304c\u9762\u767d\u304f\u3066\u3057\u3087\u3046\u304c\u306a\u3044\u4eca\u65e5\u3053\u306e\u9803\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u524d\u56de<a href=\"https:\/\/blog.capilano-fw.com\/?p=17580\" data-type=\"post\" data-id=\"17580\">\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<\/a>\u3068\u3044\u3046\u8a18\u4e8b\u3092\u516c\u958b\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u3063\u3066\u3001<\/p>\n\n\n\n<p class=\"has-large-font-size\"><strong>\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u2192\u7269\u7406\u7684\u306a\u52d5\u304d<\/strong><\/p>\n\n\n\n<p>\u3063\u3066\u6d41\u308c\u3060\u3063\u305f\u3093\u3067\u3059\u3002<br><strong>\u3064\u307e\u308a\u3001\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u304c\u4e3b\u4f53\u3002<\/strong><\/p>\n\n\n\n<p>\u3067\u3082\u3001\u9006\u3082\u3084\u3063\u3066\u307f\u305f\u304f\u306a\u3063\u305f\u3093\u3067\u3059\u3088\u306d\u3002<\/p>\n\n\n\n<p>\u305d\u3046\u3002<\/p>\n\n\n\n<p class=\"has-large-font-size\"><strong>\u7269\u7406\u7684\u306a\u52d5\u304d\u2192\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u64cd\u4f5c<\/strong><\/p>\n\n\n\n<p>\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3064\u307e\u308a\u3001<strong>\u30ea\u30a2\u30eb\u306a\u4e16\u754c\u3067\u30a2\u30af\u30b7\u30e7\u30f3\u304c\u3042\u3063\u305f\u3089\u3001\u305d\u306e\u60c5\u5831\u3092\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u306b\u4f1d\u3048\u308b\u3068\u3044\u3046\u6d41\u308c\u3067\u3059\u3002<\/strong><\/p>\n\n\n\n<p>\u305d\u3053\u3067\u8cfc\u5165\u3057\u305f\u306e\u304c\u3001<\/p>\n\n\n\n<p class=\"has-large-font-size\"><strong>\u300cSwitchBot\u306e\u958b\u9589\u30bb\u30f3\u30b5\u30fc\u300d<\/strong><\/p>\n\n\n\n<p>\u305d\u306e\u540d\u306e\u3054\u3068\u304f\u300c<strong>\u958b\u3051\u308b\/\u9589\u3081\u308b\u3092\u691c\u77e5\u3059\u308b<\/strong>\u300d\u30bb\u30f3\u30b5\u30fc\u3067\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"632\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-5.png\" alt=\"\" class=\"wp-image-18076\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-5.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-5-300x296.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-5-100x100.png 100w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<p>\u3067\u3001\u3053\u306e\u958b\u9589\u30bb\u30f3\u30b5\u30fc\u3092\u3064\u304b\u3063\u3066\u4f55\u304b\u3067\u304d\u306a\u3044\u304b\u8003\u3048\u305f\u3068\u3053\u308d\u601d\u3044\u3064\u304d\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p><strong>\u85ac\u7bb1\u3092\u958b\u3051\u305f\u6642\u9593\u3092\u8a18\u9332\u3057\u3066\u300c\u98f2\u307f\u5fd8\u308c\u300d\u3092\u9632\u3050\u6a5f\u80fd<\/strong>\u3092\u3064\u304f\u3063\u305f\u3089\u4fbf\u5229\u3058\u3083\u306a\u3044\u304b\u3068\u3002<\/p>\n\n\n\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u4eba\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>\u300c\u30ea\u30a2\u30eb\u306a\u52d5\u304d\u3092\u304d\u3063\u304b\u3051\u306b\u3057\u305f\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u64cd\u4f5c\u304c\u3057\u305f\u3044\u300d<\/li>\n\n\n\n<li>\u300cIoT\u3068Web\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u3001\u66ae\u3089\u3057\u3092\u3082\u3063\u3068\u4fbf\u5229\u306b\u3057\u305f\u3044\u300d<\/li>\n\n\n\n<li>\u300cSwitchBot\u3067\u81ea\u5206\u306e\u30a2\u30a4\u30c7\u30a2\u3092\u5b9f\u73fe\u3057\u3066\u307f\u305f\u3044\u300d<\/li>\n\n\n\n<li>\u300cSwitchBot\u3092Laravel\u3068\u9023\u643a\u3055\u305b\u3066\u3001\u81ea\u52d5\u5316\u306e\u30a2\u30a4\u30c7\u30a2\u3092\u5f62\u306b\u3057\u3066\u307f\u305f\u3044\u300d<\/li>\n\n\n\n<li>\u300cSwitchBot\u306eWebhook\u306e\u4f7f\u3044\u65b9\u3092\u77e5\u308a\u305f\u3044\u300d<\/li>\n\n\n\n<li>\u300c\u304a\u85ac\u7ba1\u7406\u3092\u81ea\u52d5\u5316\u3067\u304d\u305f\u3089\u4fbf\u5229\u3060\u3068\u601d\u3046\u300d<\/li>\n\n\n\n<li>\u300c\u3064\u304f\u3063\u305f\u30b7\u30b9\u30c6\u30e0\u3092\u5bb6\u65cf\u3084\u53cb\u4eba\u306b\u3082\u4f7f\u3063\u3066\u3082\u3089\u3044\u305f\u3044\u300d<\/li>\n\n\n\n<li>\u300c\u500b\u4eba\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u304b\u3089\u526f\u696d\u306b\u767a\u5c55\u3055\u305b\u305f\u3044\u300d<\/li>\n\n\n\n<li>\u300cLaravel\u3067\u696d\u52d9\u30a2\u30d7\u30ea\u3092\u4f5c\u3063\u3066\u3044\u308b\u306e\u3067\u53c2\u8003\u306b\u3057\u305f\u3044\u300d<\/li>\n\n\n\n<li>\u300c\u697d\u3057\u307f\u306a\u304c\u3089\u6280\u8853\u3092\u6df1\u6398\u308a\u3057\u305f\u3044\u300d<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"226\" height=\"320\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_12.png\" alt=\"\" class=\"wp-image-6068\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_12.png 226w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_12-212x300.png 212w\" sizes=\"auto, (max-width: 226px) 100vw, 226px\" \/><\/figure><\/div>\n\n\n<p class=\"has-text-align-center\">\u300c\u79c1\u81ea\u8eab\u3001\u304a\u85ac\u306f<br>\u307e\u3063\u305f\u304f\u98f2\u3093\u3067\u307e\u305b\u3093\uff08\u5143\u6c17\uff01\uff09\u300d<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9f\u88c5\u306b\u5fc5\u8981\u306a\u3082\u306e\u30fb\u5b9f\u884c\u74b0\u5883<\/h2>\n\n\n\n<p>\u4eca\u56de\u306f\u4ee5\u4e0b2\u3064\u306e\u6a5f\u68b0\u3067\u5b9f\u88c5\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/amzn.to\/3WJpaG7\" target=\"_blank\" rel=\"noreferrer noopener\">SwitchBot\u958b\u9589\u30bb\u30f3\u30b5\u30fc<\/a>\uff1a\u958b\u3051\u9589\u3081\u3092\u611f\u77e5\u3059\u308b\u30bb\u30f3\u30b5\u30fc<\/li>\n\n\n\n<li><a href=\"https:\/\/amzn.to\/3LogBy5\" target=\"_blank\" rel=\"noreferrer noopener\">SwitchBot\u30cf\u30d6\u30df\u30cb<\/a>\uff1a\u958b\u9589\u30bb\u30f3\u30b5\u30fc\u3092\u30a6\u30a7\u30d6\u9023\u643a\u3055\u305b\u308b\u30cf\u30d6<\/li>\n<\/ul>\n\n\n\n<p class=\"has-small-font-size\">SwitchBot\u958b\u9589\u30bb\u30f3\u30b5\u30fc<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"632\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-2.jpg\" alt=\"\" class=\"wp-image-18250\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-2.jpg 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-2-300x296.jpg 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-2-100x100.jpg 100w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<p class=\"has-small-font-size\">SwitchBot\u30cf\u30d6\u30df\u30cb<\/p>\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>\u307e\u305f\u3001\u5b9f\u884c\u74b0\u5883\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Laravel 12.x<\/li>\n\n\n\n<li>Vue 3<\/li>\n\n\n\n<li>Inertia<\/li>\n\n\n\n<li>TypeScript<\/li>\n<\/ul>\n\n\n\n<p>\u3067\u306f\u4eca\u56de\u3082\u697d\u3057\u3093\u3067\u3084\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\uff01<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">SwitchBot\u958b\u9589\u30bb\u30f3\u30b5\u30fc\u3092\u30a6\u30a7\u30d6\u306b\u3064\u306a\u3050<\/h2>\n\n\n\n<p>\u958b\u5c01\u3057\u305f\u3089\u307e\u305a\u96fb\u6c60\u3092\u3044\u308c\u3066\uff08\u8aac\u660e\u66f8\u3092\u898b\u306a\u304c\u3089\uff09\u30b9\u30de\u30db\u30a2\u30d7\u30ea\u3068\u30da\u30a2\u30ea\u30f3\u30b0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"582\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-3.jpg\" alt=\"\" class=\"wp-image-18078\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-3.jpg 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-3-300x273.jpg 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<p>\u30b9\u30de\u30db\u30a2\u30d7\u30ea\u304c\u958b\u9589\u30bb\u30f3\u30b5\u30fc\u3092\u8a8d\u8b58\u3057\u305f\u3089\u3001\u624b\u3067\u52d5\u304b\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u958b\u3044\u305f\/\u9589\u3058\u305f\u3092\u691c\u77e5\u3057\u901a\u77e5\u3057\u3066\u304f\u308c\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"450\" height=\"613\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-4.png\" alt=\"\" class=\"wp-image-18080\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-4.png 450w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-4-220x300.png 220w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/figure>\n\n\n\n<p>\u3067\u306f\u3001\u30cf\u30d6\u30df\u30cb\u3082\u8d77\u52d5\u3057\u3066\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u7d4c\u7531\u3067\u3082\u6709\u52b9\u306b\u306a\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">WebHook\u3092\u3064\u304f\u308b5\u30b9\u30c6\u30c3\u30d7<\/h2>\n\n\n\n<p>\u5192\u982d\u3067\u3082\u66f8\u3044\u305f\u3068\u304a\u308a\u3001\u4eca\u56de\u306f\u300c<strong>\u7269\u7406\u7684\u30a2\u30af\u30b7\u30e7\u30f3\u2192\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8<\/strong>\u300d\u3068\u3044\u3046\u6d41\u308c\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u7269\u7406\u7684\u30a2\u30af\u30b7\u30e7\u30f3\u304c\u3042\u3063\u305f\u3053\u3068\u3092\u77e5\u3089\u305b\u308b<code>WebHook<\/code>\uff08\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u3078\u306e\u30c7\u30fc\u30bf\u901a\u77e5\uff09\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u9806\u3092\u8ffd\u3063\u3066\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\uff01<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. \u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3\u3092\u53d6\u5f97\u3059\u308b<\/h3>\n\n\n\n<p>\u904e\u53bb\u8a18\u4e8b\u3067\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\">2. \u30c7\u30d0\u30a4\u30b9ID\u3092\u53d6\u5f97\u3059\u308b<\/h3>\n\n\n\n<p>\u4eca\u56de\u8cfc\u5165\u3057\u305f\u958b\u9589\u30bb\u30f3\u30b5\u30fc\u306e\u300c<strong>\u30c7\u30d0\u30a4\u30b9ID\uff08\u6a5f\u68b0\u56fa\u6709\u306e\u756a\u53f7\uff09<\/strong>\u300d\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30da\u30a2\u30ea\u30f3\u30b0\u3057\u305f\u6a5f\u68b0\u3092\u9078\u629e\u3059\u308b\u3068\u53f3\u4e0a\u306b\u6b6f\u8eca\u30de\u30fc\u30af\u304c\u3067\u3066\u304f\u308b\u306e\u3067\u3001\u305d\u3053\u304b\u3089\u300c<strong>Device Info<\/strong>\u300d\u3092\u9078\u629e\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30c7\u30d0\u30a4\u30b9ID\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full image-border-3\"><img loading=\"lazy\" decoding=\"async\" width=\"450\" height=\"168\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-9.png\" alt=\"\" class=\"wp-image-18082\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-9.png 450w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-9-300x112.png 300w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/figure>\n\n\n\n<p>\u3067\u306f\u3001\u3053\u306e\u6587\u5b57\u5217\u3092<code>.env<\/code>\u306b\u30bb\u30c3\u30c8\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p><strong>.env<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>SWITCHBOT_MOTION_SENSOR_DEVICE_ID=\"\uff08\u3053\u3053\u306b\u3042\u306a\u305f\u306e\u30c7\u30d0\u30a4\u30b9ID\uff09\"<\/strong><\/pre>\n\n\n\n<p>\u30b3\u30f3\u30d5\u30a3\u30b0\u3082\u767b\u9332\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>config\/services.php<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php<br><br>return [<br><br>    \/\/ \u7701\u7565<br><br>    'switchbot' =&gt; [<br>        'access_token' =&gt; env('SWITCHBOT_ACCESS_TOKEN'),<br>        'secret_token' =&gt; env('SWITCHBOT_SECRET_TOKEN'),<br>        'devices' =&gt; [<br>            <strong>'contact_sensor' =&gt; env('SWITCHBOT_CONTACT_SENSOR_DEVICE_ID'),<\/strong><br>        ],<br>    ],<br><br>];<\/pre>\n\n\n\n<p>\u3053\u308c\u3067\u3001\u3069\u3053\u304b\u3089\u3067\u3082<code>config('services.switchbot.devices.contact_sensor');<\/code>\u3067\u30c7\u30d0\u30a4\u30b9ID\u304c\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Laravel\u306e\u30dd\u30fc\u30c8\u756a\u53f7\u3092\u53d6\u5f97\u3059\u308b<\/h3>\n\n\n\n<p>\u6b21\u306e<code>ngrok<\/code>\u3067\u5fc5\u8981\u306b\u306a\u308b\u306e\u3067\u3001\u4ee5\u4e0b\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u30dd\u30fc\u30c8\u756a\u53f7\u3092\u53d6\u5f97\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>php arsan serve<\/strong><\/pre>\n\n\n\n<p>\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8868\u793a\u306b\u306a\u308b\u306e\u3067\u300c\uff1a\u300d\u306e\u5f8c\u308d\u306b\u3042\u308b\u6570\u5b57\u3092\u899a\u3048\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>Server running on [http:\/\/127.0.0.1:8000]<\/strong><\/pre>\n\n\n\n<p class=\"has-small-font-size\">\u203b8000\u304c\u57fa\u672c\u3060\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u74b0\u5883\u306b\u3088\u3063\u3066\u9055\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. ngrok\u3067WebHook\u3092\u30ed\u30fc\u30ab\u30eb\u3067\u53d7\u3051\u53d6\u308c\u308b\u3088\u3046\u306b\u3059\u308b<\/h3>\n\n\n\n<p><code>WebHook<\/code>\u306f\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u4e0a\u3078\u306e\u30c7\u30fc\u30bf\u9001\u4fe1\u306e\u3053\u3068\u3067\u3059\u304c\u3001\u3064\u307e\u308a\u305d\u308c\u306f\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u306b\u306f\u5c4a\u304b\u306a\u3044\u3053\u3068\u3092\u610f\u5473\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u3057\u304b\u3057\u3001\u958b\u767a\u4e2d\u3060\u3068\u6bce\u56de\u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u30fc\u306b\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u306e\u306f\u9762\u5012\u3067\u3059\u3002<\/strong><\/p>\n\n\n\n<p>\u305d\u3053\u3067<code>ngrok<\/code>\u306e\u300c\u30c8\u30f3\u30cd\u30eb\u300d\u3068\u3044\u308f\u308c\u308b\u6280\u8853\u3092\u3064\u304b\u3063\u3066<code>WebHook<\/code>\u3092\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u3067\u53d7\u4fe1\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002\u3064\u307e\u308a\u3001<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>SwitchBot\u304cngrok\u3078\u30c7\u30fc\u30bf\u9001\u4fe1<\/li>\n\n\n\n<li>ngrok\u304c\u6a4b\u6e21\u3057<\/li>\n\n\n\n<li>\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u306bWebHook\u304c\u6765\u308b<\/li>\n<\/ol>\n\n\n\n<p>\u3068\u3044\u3046\u6d41\u308c\u3067\u3059\u3002\u8a73\u3057\u304f\u306f\u3001\u904e\u53bb\u8a18\u4e8b\u306e<a href=\"https:\/\/blog.capilano-fw.com\/?p=12168#_ngrok\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>\u304a\u307e\u3051\uff1a ngrok \u306b\u3064\u3044\u3066<\/strong><\/a>\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p>\u305d\u3057\u3066\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3057\u305f\u3089\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>ngrok http \uff08php artisan serve\u3067\u53d6\u5f97\u3057\u305f\u30dd\u30fc\u30c8\u756a\u53f7\uff09<\/strong><\/pre>\n\n\n\n<p>\u5b9f\u969b\u306e\u4f8b\u306f\u3053\u3061\u3089\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>ngrok http 8000<\/strong><\/pre>\n\n\n\n<p>\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8868\u793a\u306b\u306a\u308b\u306e\u3067\u3001\u300c<strong>Forwarding<\/strong>\u300d\u306e\u90e8\u5206\u306b\u66f8\u3044\u3066\u3042\u308b<code>URL<\/code>\u3092\u899a\u3048\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\uff08\u30ad\u30e3\u30f3\u30bb\u30eb\u3059\u308b\u5834\u5408\u306fCtr + C\uff09\u3067\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"202\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-11.png\" alt=\"\" class=\"wp-image-18105\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-11.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-11-300x95.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<p class=\"has-small-font-size\">\u203b\u3053\u306eURL\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3001ngrok\u304c\u30ed\u30fc\u30ab\u30eb\u306b\u8ee2\u9001\u3057\u3066\u304f\u308c\u308b\u308f\u3051\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u3057\u3066\u3001\u3053\u306eURL\u306f<code>Laravel<\/code>\u306e\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u306b\u306a\u308b\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30eb\u30fc\u30c8\u3064\u304d\u306eURL\u306b\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p><strong>\u3010WebHook URL\u3011<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>https:\/\/*********.ngrok-free.app\/switchbot\/webhook<\/strong><\/pre>\n\n\n\n<p>\u3053\u306e<code>URL<\/code>\u3092<code>WebHook<\/code>\u306b\u767b\u9332\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5. WebHook\u3092\u767b\u9332\u3059\u308b<\/h3>\n\n\n\n<p>\u3067\u306f\u3001\u5148\u307b\u3069\u53d6\u5f97\u3057\u305f<code>ngrok<\/code>\u306e<code>URL<\/code>\u306b<code>WebHook<\/code>\u304c\u9001\u4fe1\u3055\u308c\u308b\u3088\u3046\u767b\u9332\u3092\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>SwitchBot<\/code>\u306e<code>WebHook<\/code>\u306f<code>API<\/code>\u3092\u901a\u3057\u3066\u5b9f\u884c\u3059\u308b\u306e\u3067\u3059\u304c\u3001\u3044\u3061\u3044\u3061\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u306e\u306f\u9762\u5012\u306a\u306e\u3067\u3001<a href=\"https:\/\/www.postman.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Postman<\/a>\u3092\u3064\u304b\u3063\u3066\u30b5\u30af\u30c3\u3068\u5b9f\u884c\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p class=\"has-small-font-size\">\u203b\u3061\u306a\u307f\u306b\u3001\u9006\u306b\u8a00\u3046\u3068API\u4ee5\u5916\u3067WebHook\u767b\u9332\u306f\u3067\u304d\u307e\u305b\u3093\u30022025\/11\/07\u73fe\u5728\u3002<\/p>\n\n\n\n<p>\u5165\u529b\u3059\u308b\u306e\u306f\u3001\u4ee5\u4e0b\u306e\u9805\u76ee\u3067\u3059\u3002<\/p>\n\n\n\n<p><strong>\u3010<strong>\u30ea\u30af\u30a8\u30b9\u30c8<\/strong>\u3011<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>POST https:\/\/api.switch-bot.com\/v1.1\/webhook\/setupWebhook<\/strong><\/pre>\n\n\n\n<p><strong>\u3010Headers\u3011<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Content-type\uff1aapplication\/json\uff08\u6ce8\uff1a\u3059\u3067\u306b\u5165\u3063\u3066\u3044\u308b\u3068\u601d\u3046\u306e\u3067\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\uff09<\/li>\n\n\n\n<li>Authorization\uff1a\uff08\u3042\u306a\u305f\u306e\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3\uff09<\/li>\n<\/ul>\n\n\n\n<p><strong>\u3010Body\u3011<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>action\uff1asetupWebhook<\/li>\n\n\n\n<li>url\uff1a\uff08ngrok\u3067\u53d6\u5f97\u3057\u305fURL\uff09<\/li>\n\n\n\n<li>deviceList\uff1aALL<\/li>\n<\/ul>\n\n\n\n<p>\u203b<code>raw<\/code>\u30bf\u30d6\u3067\u4ee5\u4e0b\u3092\u8cbc\u308a\u3064\u3051\u308b\u3068\u697d\u3067\u3059\u3088\ud83d\udc4d<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>{<br>    \"action\":\"setupWebhook\",<br>    \"url\":\"\uff08ngrok\u3067\u53d6\u5f97\u3057\u305fWebHook URL\uff09\",<br>    \"deviceList\":\"ALL\"<br>}<\/strong><\/pre>\n\n\n\n<p>\u305d\u3057\u3066\u3001\u9001\u4fe1\u3057\u3066\u3046\u307e\u304f\u3044\u304f\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8fd4\u3063\u3066\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>{<br>    \"statusCode\": 100,<br>    \"body\": {},<br>    \"message\": \"success\"<br>}<\/strong><\/pre>\n\n\n\n<p>\u3082\u3057<code>WebHook<\/code>\u306e\u524a\u9664\u3084\u5909\u66f4\u3092\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u672c\u5bb6\u306e\u4ee5\u4e0b\u30da\u30fc\u30b8\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/github.com\/OpenWonderLabs\/SwitchBotAPI?tab=readme-ov-file#get-webhook-configuration\" target=\"_blank\" rel=\"noreferrer noopener\">WebHook\u306e\u78ba\u8a8d<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/OpenWonderLabs\/SwitchBotAPI?tab=readme-ov-file#update-webhook-configuration\" target=\"_blank\" rel=\"noreferrer noopener\">WebHook\u306e\u5909\u66f4<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/OpenWonderLabs\/SwitchBotAPI?tab=readme-ov-file#delete-webhook\" target=\"_blank\" rel=\"noreferrer noopener\">WebHook\u306e\u524a\u9664<\/a><\/li>\n<\/ul>\n\n\n\n<p class=\"has-small-font-size\">\u203b\u30d1\u30e9\u30e1\u30fc\u30bf\u304c\u5c11\u3057\u305a\u3064\u9055\u3063\u3066\u3044\u308b\u306e\u3067\u6c17\u3092\u3064\u3051\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u3067<code>WebHook<\/code>\u306e\u6e96\u5099\u306f\u5b8c\u4e86\u3067\u3059\uff01<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Laravel\u3067WebHook\u3092\u53d7\u3051\u53d6\u308b\u90e8\u5206\u3092\u3064\u304f\u308b3\u30b9\u30c6\u30c3\u30d7<\/h2>\n\n\n\n<p>\u3067\u306f\u3001\u3084\u3063\u3068<code>Laravel<\/code>\u306e\u4f5c\u696d\u3067\u3059\uff01<br>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. DB\u307e\u308f\u308a\u3092\u3064\u304f\u308b<\/h3>\n\n\n\n<p>\u4ee5\u4e0b\u306e\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 arsan make:model ContactSensorHistory -m<\/strong><\/pre>\n\n\n\n<p>\u3059\u308b\u3068\u300c<strong>\u30e2\u30c7\u30eb<\/strong>\u300d\u300c<strong>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3<\/strong>\u300d\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u3001\u4e2d\u8eab\u3092\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>database\/migrations\/****_**_**_******_create_contact_sensor_histories_table.php<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>&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>        Schema::create('contact_sensor_histories', function (Blueprint $table) {<br>            $table-&gt;id();<br>            $table-&gt;string('device_id')-&gt;comment('\u30c7\u30d0\u30a4\u30b9ID');<br>            $table-&gt;string('detection_state')-&gt;comment('\u691c\u77e5\u72b6\u614b');<br>            $table-&gt;string('contact_state')-&gt;comment('\u958b\u9589\u72b6\u614b');<br>            $table-&gt;timestamps();<br>        });<br>    }<br><br>    <em>\/**<br>     * Reverse the migrations.<br>     *\/<br>    <\/em>public function down(): void<br>    {<br>        Schema::dropIfExists('contact_sensor_histories');<br>    }<br>};<\/strong><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2. \u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u3064\u304f\u308b<\/h3>\n\n\n\n<p>\u6b21\u306f\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>php artisan make:controller SwitchBotWebhookController<\/strong><\/pre>\n\n\n\n<p>\u4e2d\u8eab\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>app\/Http\/Controllers\/SwitchBotWebhookController.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\\ContactSensorHistory;<br>use Illuminate\\Http\\Request;<br><br>class SwitchBotWebhookController extends Controller<br>{<br>    public function store(Request $request)<br>    {<br>        $deviceId = $request-&gt;input('context.deviceMac');    \/\/ \u30c7\u30d0\u30a4\u30b9ID\uff08\u30b3\u30ed\u30f3\u306a\u3057\uff09<br>        $deviceType = $request-&gt;input('context.deviceType'); \/\/ \u30c7\u30d0\u30a4\u30b9\u30bf\u30a4\u30d7<br><br>        if ($deviceType === 'WoContact') { \/\/ \u958b\u9589\u30bb\u30f3\u30b5\u30fc\u306e\u5834\u5408\uff08\u672c\u6765Enum\u3092\u4f7f\u3046\u3079\u304d\uff09<br><br>            $contactState = $request-&gt;input('context.openState');        \/\/ \u958b\u9589\u72b6\u614b<br>            $detectionState = $request-&gt;input('context.detectionState'); \/\/ \u52d5\u4f5c\u691c\u77e5\u72b6\u614b<br><br>            \/\/ \u672c\u6765\u306f\u3053\u3053\u3067\u4e2d\u8eab\u3092\u30c7\u30fc\u30bf\u78ba\u8a8d\u3059\u3079\u304d\u3067\u3059\u304c\u3001\u7701\u7565<br><br>            $contactSensorHistory = new ContactSensorHistory;<br>            $contactSensorHistory-&gt;device_id = $deviceId;<br>            $contactSensorHistory-&gt;detection_state = $detectionState;<br>            $contactSensorHistory-&gt;contact_state = $contactState;<br>            $result = $contactSensorHistory-&gt;save();<br><br>            if ($result === false) {<br><br>                abort(500);<br><br>            }<br><br>            return response(200);<br><br>        }<br><br>        abort(404);<br>    }<br>}<\/strong><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"make-route\">3. \u30eb\u30fc\u30c8\u3092\u3064\u304f\u308b<\/h3>\n\n\n\n<p>\u6700\u5f8c\u306b\u30eb\u30fc\u30c8\u3067\u3059\u3002<\/p>\n\n\n\n<p><strong>routes\/web.php<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>use App\\Http\\Controllers\\SwitchBotWebhookController;<br><br>Route::prefix('switchbot')-&gt;group(function () {<br><br>    \/\/ Webhook<br>    Route::post('\/webhook', [SwitchBotWebhookController::class, 'store'])-&gt;name('switchbot.webhook.store');<br><br>});<\/strong><\/pre>\n\n\n\n<p>\u3061\u306a\u307f\u306b\u3001\u3053\u306e\u307e\u307e\u3060\u3068<code>CSRF<\/code>\u30ac\u30fc\u30c9\u304c\u52b9\u3044\u3066\u3044\u308b\u306e\u3067<code>WebHook<\/code>\u3092\u53d7\u4fe1\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u306a\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066<code>switchbot\/webhook<\/code>\u3060\u3051\u3053\u306e\u30ac\u30fc\u30c9\u3092\u89e3\u9664\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p><strong>bootstrap\/app.php<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php<br><br>use Illuminate\\Foundation\\Application;<br>use Illuminate\\Foundation\\Configuration\\Exceptions;<br>use Illuminate\\Foundation\\Configuration\\Middleware;<br><br>return Application::<em>configure<\/em>(basePath: dirname(<em>__DIR__<\/em>))<br>    -&gt;withRouting(<br>        web: <em>__DIR__<\/em>.'\/..\/routes\/web.php',<br>        commands: <em>__DIR__<\/em>.'\/..\/routes\/console.php',<br>        health: '\/up',<br>    )<br>    -&gt;withMiddleware(function (Middleware $middleware) {<br>        $middleware-&gt;web(append: [<br>            \\App\\Http\\Middleware\\HandleInertiaRequests::class,<br>            \\Illuminate\\Http\\Middleware\\AddLinkHeadersForPreloadedAssets::class,<br>        ]);<br><br><strong>        $middleware-&gt;validateCsrfTokens(except: [<br>            'switchbot\/webhook',<br>        ]);<\/strong><br><br>        \/\/<br>    })<br>    -&gt;withExceptions(function (Exceptions $exceptions) {<br>        \/\/<br>    })-&gt;create();<\/pre>\n\n\n\n<p class=\"has-small-font-size\">\u203bLaravel 12.x\u3067\u306f\u8a2d\u5b9a\u65b9\u6cd5\u304c\u5909\u308f\u308a\u307e\u3057\u305f\u306d\ud83e\udd14<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30bf\u30a4\u30de\u30fc\u5b9f\u884c\u3067\u85ac\u306e\u98f2\u307f\u5fd8\u308c\u30c1\u30a7\u30c3\u30af\u3092\u3059\u308b\u90e8\u5206\u3092\u3064\u304f\u308b<\/h2>\n\n\n\n<p>\u7d9a\u3044\u3066\u3001\u5148\u307b\u3069\u306e<code>WebHook<\/code>\u3092\u53d7\u4fe1\u3057\u305f\u3068\u304d\u306b\u4fdd\u5b58\u3057\u305f\u30c7\u30fc\u30bf\u3092<code>cron<\/code>\u3084<code>systemd<\/code>\u3067\u5b9a\u671f\u7684\u306b\u30c1\u30a7\u30c3\u30af\u3057\u3066\u3001\u3082\u3057\u98f2\u307f\u5fd8\u308c\u304c\u3042\u3063\u305f\u3089\u30e1\u30fc\u30eb\u3067\u901a\u77e5\u3059\u308b\u90e8\u5206\u3092\u3064\u304f\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30e1\u30fc\u30eb\u9001\u4fe1\u90e8\u5206\u3092\u3064\u304f\u308b<\/h3>\n\n\n\n<p>\u30b3\u30de\u30f3\u30c9\u672c\u4f53\u3092\u3064\u304f\u308b\u524d\u306b\u30e1\u30fc\u30eb\u90e8\u5206\u3092\u3064\u304f\u308a\u307e\u3059\u3002<br>\u4ee5\u4e0b\u306e\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:mail NotTakingMedicine<\/strong><\/pre>\n\n\n\n<p>\u4e2d\u8eab\u306f\u6b21\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>app\/Mail\/NotTakingMedicine.php<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>&lt;?php<br><br>namespace App\\Mail;<br><br>use Illuminate\\Bus\\Queueable;<br>use Illuminate\\Contracts\\Queue\\ShouldQueue;<br>use Illuminate\\Mail\\Mailable;<br>use Illuminate\\Mail\\Mailables\\Content;<br>use Illuminate\\Mail\\Mailables\\Envelope;<br>use Illuminate\\Queue\\SerializesModels;<br><br>class NotTakingMedicine extends Mailable<br>{<br>    use Queueable, SerializesModels;<br><br>    <em>\/**<br>     * Create a new message instance.<br>     *\/<br>    <\/em>public function __construct()<br>    {<br>        \/\/<br>    }<br><br>    <em>\/**<br>     * Get the message envelope.<br>     *\/<br>    <\/em>public function envelope(): Envelope<br>    {<br>        return new Envelope(<br>            subject: '\u304a\u85ac\ud83d\udc8a\u3061\u3083\u3093\u3068\u98f2\u3082\uff01',<br>        );<br>    }<br><br>    <em>\/**<br>     * Get the message content definition.<br>     *\/<br>    <\/em>public function content(): Content<br>    {<br>        return new Content(<br>            htmlString: '&lt;p&gt;\u304a\u85ac\ud83d\udc8a\u98f2\u307f\u5fd8\u308c\u3066\u308b\u3088\u3002\u3061\u3083\u3093\u3068\u98f2\u3082\uff01&lt;\/p&gt;',<br>        );<br>    }<br><br>    <em>\/**<br>     * Get the attachments for the message.<br>     *<br>     * @return array&lt;int, \\Illuminate\\Mail\\Mailables\\Attachment&gt;<br>     *\/<br>    <\/em>public function attachments(): array<br>    {<br>        return [];<br>    }<br>}<\/strong><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Artisan\u30b3\u30de\u30f3\u30c9\u3092\u3064\u304f\u308b<\/h3>\n\n\n\n<p>\u4ee5\u4e0b\u306e\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:command CheckTakingMedicineCommand<\/strong><\/pre>\n\n\n\n<p>\u4e2d\u8eab\u306f\u6b21\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>app\/Console\/Commands\/CheckTakingMedicineCommand.php<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>&lt;?php<br><br>namespace App\\Console\\Commands;<br><br>use App\\Mail\\NotTakingMedicine;<br>use App\\Models\\ContactSensorHistory;<br>use Carbon\\Carbon;<br>use Illuminate\\Console\\Command;<br>use Illuminate\\Support\\Facades\\Mail;<br><br>class CheckTakingMedicineCommand extends Command<br>{<br>    const <em>TO_EMAIL <\/em>= 'test@example.com'; \/\/ \u901a\u77e5\u5148\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9<br><br>    <em>\/**<br>     * The name and signature of the console command.<br>     *<br>     * @var string<br>     *\/<br>    <\/em>protected $signature = 'check:taking-medicine';<br><br>    <em>\/**<br>     * The console command description.<br>     *<br>     * @var string<br>     *\/<br>    <\/em>protected $description = 'Check if the user has taken their medicine or not';<br><br>    <em>\/**<br>     * Execute the console command.<br>     *\/<br>    <\/em>public function handle()<br>    {<br>        Carbon::<em>setTestNow<\/em>(now()-&gt;hour(9)); \/\/ \u30c6\u30b9\u30c8\u7528\uff1a\u73fe\u5728\u6642\u523b\u30929\u6642\u306b\u56fa\u5b9a<br><br>        $base_hours = [8, 12, 18]; \/\/ \u304a\u85ac\u3092\u98f2\u3080\u3079\u304d\u6642\u9593\u5e2f<br>        $now = now();<br>        $current_hour = $now-&gt;format('H');<br><br>        foreach ($base_hours as $hour) {<br><br>            if ($current_hour - 1 === $hour) {<br><br>                $start_dt = Carbon::<em>create<\/em>($now-&gt;year, $now-&gt;month, $now-&gt;day, $hour);<br>                $end_dt = $start_dt-&gt;copy()-&gt;addMinutes(59)-&gt;addSeconds(59);<br><br>                $this-&gt;info('Checking for time range: ' . $start_dt . ' -&gt; ' . $end_dt-&gt;format('H:i:s'));<br><br>                $exists = ContactSensorHistory::<em>query<\/em>()<br>                    -&gt;where('detection_state', 'DETECTED')<br>                    -&gt;where('contact_state', 'open')<br>                    -&gt;whereBetween('created_at', [$start_dt, $end_dt])<br>                    -&gt;exists();<br><br>                $this-&gt;info('$exists: ' . ($exists ? 'true' : 'false'));<br><br>                if ($exists === false) { \/\/ \u304a\u85ac\u3092\u98f2\u3093\u3067\u3044\u306a\u3044\u5834\u5408\u306e\u51e6\u7406<br><br>                    $to = self::<em>TO_EMAIL<\/em>;<br>                    Mail::to($to)-&gt;send(new NotTakingMedicine);<br><br>                }<br><br>            }<br><br>        }<br>    }<br>}<\/strong><\/pre>\n\n\n\n<p class=\"has-small-font-size\">\u203b\u3061\u306a\u307f\u306b\u3053\u306e\u30b3\u30fc\u30c9\u306f\u30c6\u30b9\u30c8\u7528\u3067\u6642\u9593\u3092\u56fa\u5b9a\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u6bce\u56de\u30c1\u30a7\u30c3\u30af\u3059\u3079\u304d\u6642\u9593\u3068\u5224\u5225\u3055\u308c\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u958b\u9589\u30bb\u30f3\u30b5\u30fc\u3092\u7bb1\u306b\u30bb\u30c3\u30c8\u3059\u308b<\/h2>\n\n\n\n<p>\u79c1\u306b\u306f\u65e2\u5f80\u75c7\u306f\u306a\u304f\u304a\u85ac\u3082\u98f2\u3093\u3067\u306a\u3044\u306e\u3067\u3001\u904e\u53bb\u8a18\u4e8b\u300c<a href=\"https:\/\/blog.capilano-fw.com\/?p=12272\" data-type=\"post\" data-id=\"12272\"><strong>\u3010\u304a\u5e74\u7389\u7528\u3011\uff13\u3064\u306e\u6570\u5b57\u3092\u30b2\u30c3\u30c8\u3057\u3066\u5b9d\u7bb1\u3092\u958b\u3051\u308b\u6a5f\u80fd\u3092\u3064\u304f\u308b<\/strong><\/a>\u300d\u306e\u305f\u3081\u306b\u8cfc\u5165\u3057\u305f\u5b9d\u7bb1\u3067\u8a66\u3057\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"593\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-13.png\" alt=\"\" class=\"wp-image-18269\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-13.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-13-300x278.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<p>SwitchBot\u958b\u9589\u30bb\u30f3\u30b5\u30fc\u306f30mm\uff083cm\uff09\u306e\u8ddd\u96e2\u3092\u958b\u3051\u3066\u30bb\u30c3\u30c8\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"481\" height=\"640\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-15.png\" alt=\"\" class=\"wp-image-18271\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-15.png 481w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-15-225x300.png 225w\" sizes=\"auto, (max-width: 481px) 100vw, 481px\" \/><\/figure>\n\n\n\n<p>\u3067\u3001\u30bb\u30c3\u30c8\u3057\u305f\u306e\u304c\u3053\u3061\u3089\uff08\u6ce8\uff1a\u8fd1\u3065\u304f\u5834\u6240\u304c\u304b\u308f\u308b\u3068\u8ddd\u96e2\u3082\u304b\u308f\u308b\u3088\u3046\u3067\u3057\u305f\uff09<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"665\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-14.png\" alt=\"\" class=\"wp-image-18270\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-14.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-14-289x300.png 289w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<p class=\"has-small-font-size\">\u203b\u30c6\u30b9\u30c8\u306a\u306e\u3067\u3001\u958b\u9589\u30bb\u30f3\u30b5\u30fc\u306b\u3064\u3044\u3066\u308b\u4e21\u9762\u30c6\u30fc\u30d7\u306f\u4f7f\u308f\u305a\u30ac\u30e0\u30c6\u30fc\u30d7\u3067\u304f\u3063\u3064\u3051\u3066\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<br>\u304a\u85ac\u7bb1\uff08\u5b9f\u969b\u306f\u5b9d\u7bb1\uff09\u306e\u958b\u3051\u308b\/\u9589\u3081\u308b\u3092\u5b9f\u884c\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-18.jpg\" alt=\"\" class=\"wp-image-18282\"\/><\/figure>\n\n\n\n<p>\u307e\u305a\u306f\u7bb1\u3092\u958b\u3051\u308b\u52d5\u4f5c\u3067\u3059\u306d\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-19.jpg\" alt=\"\" class=\"wp-image-18283\"\/><\/figure>\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-image size-full image-border-3\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"251\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-16.png\" alt=\"\" class=\"wp-image-18288\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-16.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-16-300x118.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<p>\u306f\u3044\uff01<\/p>\n\n\n\n<p><code>WebHook<\/code>\u3092\u901a\u3058\u3066\u691c\u77e5\u3055\u308c\u305f\u30c7\u30fc\u30bf\u304c\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u4fdd\u5b58\u3055\u308c\u3066\u3044\u308b\u306e\u304c\u308f\u304b\u308a\u307e\u3059\u306d\u3002\u30c7\u30fc\u30bf\u3082<code>open<\/code>\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3067\u306f\u3001\u958b\u3051\u305f\u84cb\u3092\u5143\u306b\u623b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-18.jpg\" alt=\"\" class=\"wp-image-18282\"\/><\/figure>\n\n\n\n<p>\u3046\u307e\u304f\u3044\u304f\u3067\u3057\u3087\u3046\u304b\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n\n\n\n<figure class=\"wp-block-image size-full image-border-3\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"274\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-17.png\" alt=\"\" class=\"wp-image-18296\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-17.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-17-300x128.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<p>\u306f\u3044\uff01<\/p>\n\n\n\n<p><code>close<\/code>\u306e\u65b9\u3082\u3046\u307e\u304f\u30c7\u30fc\u30bf\u4fdd\u5b58\u3067\u304d\u3066\u3044\u307e\u3059\u3002<br>\u6210\u529f\u3067\u3059\ud83d\ude0a<\/p>\n\n\n\n<p>\u3067\u306f\uff08\u30c7\u30fc\u30bf\u304c\u3042\u308b\u3068\u3046\u307e\u304f\u3044\u304b\u306a\u3044\u306e\u3067\uff09\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u521d\u671f\u5316\u3057\u3066\u3001<code>Artisan<\/code>\u30b3\u30de\u30f3\u30c9\u3082\u5b9f\u884c\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p>\u6210\u529f\u3059\u308b\u3067\u3057\u3087\u3046\u304b\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n\n\n\n<figure class=\"wp-block-image size-full image-border-3\"><img loading=\"lazy\" decoding=\"async\" width=\"417\" height=\"210\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-12.png\" alt=\"\" class=\"wp-image-18214\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-12.png 417w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-contact-sensor-12-300x151.png 300w\" sizes=\"auto, (max-width: 417px) 100vw, 417px\" \/><\/figure>\n\n\n\n<p>\u306f\u3044\uff01\u3046\u307e\u304f\u9001\u4fe1\u3055\u308c\u3066\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\">\u3061\u306a\u307f\u306b\uff1a\u9589\u3081\u5fd8\u308c\u305f\u3068\u304d\u306eWebHook\u306f\u6765\u306a\u3044<\/h2>\n\n\n\n<p><a href=\"https:\/\/github.com\/OpenWonderLabs\/SwitchBotAPI\"><strong>SwitchBot API\u306eGitHub\u30ea\u30dd\u30b8\u30c8\u30ea<\/strong><\/a>\u306e\u8aac\u660e\u3092\u8aad\u3080\u3068\u3001\u958b\u9589\u30bb\u30f3\u30b5\u30fc\u306e<code>WebHook<\/code>\u306f\u4ee5\u4e0b3\u3064\u306e\u72b6\u614b\u304c\u3042\u308b\u3068\u66f8\u3044\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>open\uff1a\u958b\u3044\u305f<\/li>\n\n\n\n<li>close\uff1a\u9589\u3058\u305f<\/li>\n\n\n\n<li>timeOutNotClose\uff1a\u9589\u3081\u5fd8\u308c\u3066\u308b<\/li>\n<\/ul>\n\n\n\n<p><strong>\u3067\u3082\u3001\u4f55\u5ea6\u3084\u3063\u3066\u3082\u300ctimeOutNotClose\u300d\u3067\u306eWebHook\u304c\u6765\u308b\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002<\/strong><\/p>\n\n\n\n<p>\u30b9\u30de\u30db\u30a2\u30d7\u30ea\u5074\u306b\u306f\u3061\u3083\u3093\u3068\u901a\u77e5\u304c\u6765\u308b\u306e\u3067\u3001<code>WebHook<\/code>\u306e\u8aac\u660e\u304c\u9593\u9055\u3063\u3066\u3044\u308b\u306e\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p class=\"has-small-font-size\">\u203b\u4f55\u304b\u60c5\u5831\u3092\u304a\u6301\u3061\u306e\u65b9\u304c\u3044\u3089\u3063\u3057\u3083\u3063\u305f\u3089\u3001\u305c\u3072\u6559\u3048\u3066\u304f\u3060\u3055\u3044\ud83d\ude47<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f01\u696d\u69d8\u3078\u306e\u3054\u63d0\u6848<\/h2>\n\n\n\n<p>\u958b\u9589\u30bb\u30f3\u30b5\u30fc\u3092\u3064\u304b\u3046\u3068\u5009\u5eab\u3084\u8cc7\u6750\u5eab\u306e\u958b\u9589\u76e3\u8996\u306a\u3069\u69d8\u3005\u306a\u30b7\u30fc\u30f3\u3067\u6d3b\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3082\u3057\u4f55\u304b\u793e\u5185\u3067\u304a\u56f0\u308a\u306e\u5185\u5bb9\u304c\u3042\u308a\u307e\u3057\u305f\u3089\u3001\u3044\u3064\u3067\u3082\u304a\u6c17\u8efd\u306b\u76f8\u8ac7\u304f\u3060\u3055\u3044\u3002\u304a\u5f85\u3061\u3057\u3066\u304a\u308a\u307e\u3059\ud83d\ude0a<\/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<\/code>\u958b\u9589\u30bb\u30f3\u30b5\u30fc\u3092\u3064\u304b\u3063\u3066\u85ac\u7bb1\u306e\u52d5\u4f5c\u3092\u76e3\u8996\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u958b\u9589\u52d5\u4f5c\u304c\u5fc5\u8981\u306a\u5834\u6240\u306f\u3001\u4e16\u306e\u4e2d\u306b\u305f\u304f\u3055\u3093\u3042\u308b\u306e\u3067\u3001\u85ac\u7bb1\u3060\u3051\u3067\u306a\u304f\u8272\u3005\u306a\u30b7\u30fc\u30f3\u3067\u6d3b\u7528\u3067\u304d\u308b\u3093\u3058\u3083\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n\n\n\n<p>\u3061\u306a\u307f\u306b\u3001\u4ee5\u524d\u516c\u958b\u3057\u305f<a href=\"https:\/\/blog.capilano-fw.com\/?p=17580\"><strong>\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<\/strong><\/a>\u3067\u7d39\u4ecb\u3057\u305f\u6a5f\u80fd\u3068\u9023\u643a\u3055\u305b\u308b\u3068\u3001\u30c9\u30a2\u306e\u958b\u3051\u9589\u3081\u30c7\u30fc\u30bf\u3082\u4fdd\u5b58\u3067\u304d\u308b\u306e\u3067\u3001\u3055\u3089\u306b\u9ad8\u6027\u80fd\u306a\u3082\u306e\u3092\u3064\u304f\u308c\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p>\u305c\u3072\u307f\u306a\u3055\u3093\u3082\u3001\u8272\u3005\u3068\u30a2\u30a4\u30c7\u30a2\u3092\u8003\u3048\u3066\u300c<strong>\u4e0d\u4fbf\u2192\u4fbf\u5229<\/strong>\u300d\u3057\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=\"310\" height=\"320\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2024\/07\/no_7.png\" alt=\"\" class=\"wp-image-12948\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2024\/07\/no_7.png 310w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2024\/07\/no_7-291x300.png 291w\" sizes=\"auto, (max-width: 310px) 100vw, 310px\" \/><\/figure><\/div>\n\n\n<p class=\"has-text-align-center\">\u300c\u5348\u5f8c\u306e\u7d05\u8336\u3092\u3001\u5348\u524d\u306b\u98f2\u3080\u3002<br>\u3053\u306e\u80cc\u5fb3\u611f\ud83d\udc4d\u300d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u3068\u7269\u7406\u64cd\u4f5c\u306e\u9023\u643a\u304c\u9762\u767d\u304f\u3066\u3057\u3087\u3046\u304c\u306a\u3044\u4eca\u65e5\u3053\u306e\u9803\u3067\u3059\u3002 \u524d\u56de\u3010Laravel\u30fbSwitchBot\u3011\u305f\u3063\u305f1\u4e07\u5186\u53f0\u3067\u5165\u5ba4\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u3092\u5c0e\u5165\u3059 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=17990\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u3010SwitchBot + Laravel\u3011\u958b\u9589\u30bb\u30f3\u30b5\u30fc\u3067\u85ac\u306e\u98f2\u307f\u5fd8\u308c\u3092\u9632\u3050\u6a5f\u80fd\u3092\u3064\u304f\u3063\u3066\u307f\u305f\uff01&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":18312,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[264],"class_list":["post-17990","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\/17990","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=17990"}],"version-history":[{"count":331,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/17990\/revisions"}],"predecessor-version":[{"id":18549,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/17990\/revisions\/18549"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/18312"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17990"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=17990"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=17990"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}