{"id":18341,"date":"2025-11-17T07:00:00","date_gmt":"2025-11-16T22:00:00","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=18341"},"modified":"2025-11-13T15:14:32","modified_gmt":"2025-11-13T06:14:32","slug":"%e3%80%90switchbot-laravel%e3%80%911%e4%ba%ba%e6%9a%ae%e3%82%89%e3%81%97%e3%81%ae%e8%a6%aa%e3%82%92%e8%a6%8b%e5%ae%88%e3%82%8b%e6%a9%9f%e8%83%bd%e3%82%92%e3%81%a4%e3%81%8f%e3%81%a3%e3%81%a6%e3%81%bf","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=18341","title":{"rendered":"\u3010SwitchBot + Laravel\u30111\u4eba\u66ae\u3089\u3057\u306e\u89aa\u3092\u898b\u5b88\u308b\u6a5f\u80fd\u3092\u3064\u304f\u3063\u3066\u307f\u305f\uff01"},"content":{"rendered":"\n<p>\u3055\u3066\u3055\u3066\u3001\u5c11\u3057\u524d\u306b5\u5e74\u306b1\u5ea6\u306e\u56fd\u52e2\u8abf\u67fb\u304c\u884c\u308f\u308c\u3001\u7d50\u679c\u304c\u6c17\u306b\u306a\u308b\u90e8\u5206\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u308c\u306f\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n\n\n\n<p class=\"has-large-font-size\"><strong>\u5c11\u5b50\u9ad8\u9f62\u5316\u304c\u3069\u3046\u306a\u3063\u3066\u308b\u304b\uff1f<\/strong><\/p>\n\n\n\n<p>\u3067\u3059\u3002<\/p>\n\n\n\n<p><strong>\u306a\u305c\u306a\u3089\u3001\u8ca1\u653f\u554f\u984c\u304c\u5f85\u3063\u305f\u306a\u3057\uff01\u3060\u304b\u3089\u3067\u3059\u306d\u3002<\/strong><\/p>\n\n\n\n<p>\u305d\u3057\u3066\u3001\u3042\u308f\u305b\u3066\u6c17\u306b\u306a\u308b\u306e\u304c\u300c<strong>\u5358\u8eab\u9ad8\u9f62\u8005\u306e\u5897\u52a0<\/strong>\u300d\u3067\u3059\u3002<br>\u6b21\u306e\u30b0\u30e9\u30d5\u3092\u898b\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full image-border-3\"><img loading=\"lazy\" decoding=\"async\" width=\"610\" height=\"470\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-1.png\" alt=\"\" class=\"wp-image-18355\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-1.png 610w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-1-300x231.png 300w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/figure>\n\n\n\n<p class=\"has-small-font-size\">\u51fa\u5178\uff1a<a href=\"https:\/\/www.nissay.co.jp\/enjoy\/keizai\/162.html\">\u65e5\u672c\u751f\u547d\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u3088\u308a\u3002\u300c\u7b2c162\u56de\u3000\u5897\u3048\u308b\u4e00\u4eba\u66ae\u3089\u3057\u306e\u9ad8\u9f62\u8005\u30002020\u5e74\u306f672\u4e07\u4eba\u30012040\u5e74\u306b\u306f896\u4e07\u4eba\u306e\u898b\u901a\u3057\u300d<\/a><\/p>\n\n\n\n<p class=\"has-large-font-size\"><strong>\u306a\u3093\u3068\u300165\u6b73\u4ee5\u4e0a\u306e\u5358\u8eab\u9ad8\u9f62\u8005\u306f\u3001<strong>2040\u5e74\u306b<\/strong>896\u4e07\u4eba\uff08\u7d0413\u4eba\u306b1\u4eba\uff09\u306b\u306a\u308b<\/strong><\/p>\n\n\n\n<p>\u3068\u63a8\u8a08\u3055\u308c\u3066\u308b\u3093\u3067\u3059\u306d\u3002<br>\u8a18\u4e8b\u57f7\u7b46\u6642\u304b\u3089\u3059\u308b\u3068\u3001<strong>\u305f\u3063\u305f15\u5e74\u3067\u3053\u3046\u306a\u308b\u308f\u3051\u3067\u3059\u3002<\/strong><\/p>\n\n\n\n<p>\u305d\u3053\u3067\uff01<\/p>\n\n\n\n<p>\u6700\u8fd1\u6c17\u306b\u3044\u3063\u3066\u308b<code>SwitchBot<\/code>\u306e\u4eba\u611f\u30bb\u30f3\u30b5\u30fc\u3092\u3064\u304b\u3063\u3066\u3001\u3053\u306e\u793e\u4f1a\u554f\u984c\u306b\u5c11\u3057\u3067\u3082\u5f79\u306b\u7acb\u3064\u6a5f\u80fd\u3092\u4f5c\u3063\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"has-large-font-size\">\u300c<strong>\u8d77\u304d\u3066\u308b\u306f\u305a\u306e\u6642\u9593\u306b\u52d5\u304d\u304c\u306a\u304b\u3063\u305f\u3089\u901a\u77e5\u3059\u308b\u300d<\/strong><\/p>\n\n\n\n<p>\u3068\u3044\u3046\u6a5f\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3064\u307e\u308a\u3001<strong>\u52d5\u3051\u306a\u304f\u306a\u3063\u3066\u3044\u308b\u53ef\u80fd\u6027\u304c\u3042\u308c\u3070\u3001\u5bb6\u65cf\u3084\u4ecb\u8b77\u65bd\u8a2d\u306b\u81ea\u52d5\u3067\u77e5\u3089\u305b\u308b\u306e\u304c\u76ee\u7684\u3067\u3059\u306d\u3002<\/strong><\/p>\n\n\n\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306e\u8a18\u4e8b\u306f\u6b21\u306e\u3088\u3046\u306a\u65b9\u306b\u5411\u3051\u3066\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\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u793e\u4f1a\u554f\u984c\u3092\u89e3\u6c7a\u3057\u305f\u3044\u300d<\/li>\n\n\n\n<li>\u300c\u9ad8\u9f62\u8005\u3092IoT\u3067\u898b\u5b88\u308c\u305f\u3089\u3068\u601d\u3046\u300d<\/li>\n\n\n\n<li>\u300c\u6280\u8853\u3067\u4eba\u3092\u652f\u3048\u308b\u4ed5\u7d44\u307f\u3092\u4f5c\u308a\u305f\u3044\u300d<\/li>\n\n\n\n<li>\u300c\u81ea\u5206\u306e\u30b9\u30ad\u30eb\u3092\u4eba\u306b\u5f79\u7acb\u3066\u305f\u3044\u300d<\/li>\n\n\n\n<li>\u300c\u3046\u3061\u306e\u89aa\u3001\u4e00\u4eba\u66ae\u3089\u3057\u3060\u3051\u3069\u672c\u5f53\u306b\u5927\u4e08\u592b\u3060\u308d\u3046\u304b\u2026\u300d<\/li>\n\n\n\n<li>\u300c\u6700\u4f4e\u9650\u306e\u5bb6\u65cf\u306e\u898b\u5b88\u308a\u306f\u81ea\u52d5\u5316\u3057\u305f\u3044\u300d<\/li>\n\n\n\n<li>\u300c\u65bd\u8a2d\u306b\u5165\u308c\u308b\u307b\u3069\u3067\u306f\u306a\u3044\u3051\u3069\u3001\u898b\u5b88\u308a\u306f\u307b\u3057\u3044\u300d<\/li>\n\n\n\n<li>\u300c\u624b\u8efd\u306b\u898b\u5b88\u308a\u6a5f\u80fd\u3092\u3064\u304f\u308a\u305f\u3044\u300d<\/li>\n\n\n\n<li>\u300c\u672c\u4eba\u306b\u6c17\u3092\u3064\u304b\u308f\u305b\u306a\u3044\u898b\u5b88\u308a\u65b9\u6cd5\u3092\u3064\u304f\u308a\u305f\u3044\u300d<\/li>\n\n\n\n<li>\u300c\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u3068\u7269\u7406\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u9023\u643a\u3057\u305f\u6a5f\u80fd\u3092\u3064\u304f\u308a\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=\"306\" height=\"320\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1.png\" alt=\"\" class=\"wp-image-3566\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1.png 306w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1-287x300.png 287w\" sizes=\"auto, (max-width: 306px) 100vw, 306px\" \/><\/figure><\/div>\n\n\n<p class=\"has-text-align-center\">\u300c\u6b73\u3092\u91cd\u306d\u3066\u5897\u3048\u308b\u5e78\u305b\u3082\u3042\u308a\u307e\u3059\u3002<br>\u305d\u3046\u3002\u30d0\u30c3\u30c6\u30e9\u3068\u304b\u306d\ud83d\udc4d\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\/3WPjE4F\" target=\"_blank\" rel=\"noreferrer noopener\">SwitchBot\u4eba\u611f\u30bb\u30f3\u30b5\u30fc<\/a>\uff1a\u4eba\u306e\u52d5\u304d\u3092\u691c\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\u4eba\u611f\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\u4eba\u611f\u30bb\u30f3\u30b5\u30fc<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"611\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-8.jpg\" alt=\"\" class=\"wp-image-18506\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-8.jpg 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-8-300x286.jpg 300w\" 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>\u4eca\u56de\u306f\u5927\u4e8b\u306a\u30c6\u30fc\u30de\u306a\u306e\u3067\u771f\u9762\u76ee\u306b\u3084\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\uff01<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">SwitchBot\u4eba\u611f\u30bb\u30f3\u30b5\u30fc\u3092\u8d77\u52d5\u3059\u308b<\/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<p class=\"has-small-font-size\">\u203b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3068\u304d\u3001\u30da\u30c3\u30c8\u3044\u308b\/\u3044\u306a\u3044\u306e\u8a2d\u5b9a\u3092\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"386\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-2.jpg\" alt=\"\" class=\"wp-image-18458\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-2.jpg 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-2-300x181.jpg 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<p>\u3061\u306a\u307f\u306b\u8a2d\u5b9a\u30da\u30fc\u30b8\u3067\u306f\u30bb\u30f3\u30b5\u30fc\u306e\u611f\u5ea6\u3092\u5909\u66f4\u3067\u304d\u307e\u3059\u3002<br>\u4eca\u56de\u306f\u6700\u5927\u9650\u306e\u691c\u77e5\u3092\u3064\u304b\u3044\u307e\u3059\u304c\u3001\u74b0\u5883\u306b\u3042\u308f\u305b\u3066\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full image-border-3\"><img loading=\"lazy\" decoding=\"async\" width=\"450\" height=\"583\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-3.png\" alt=\"\" class=\"wp-image-18462\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-3.png 450w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-3-232x300.png 232w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/figure>\n\n\n\n<p class=\"has-small-font-size\">\u203bLong\u8a2d\u5b9a\u3060\u3068\u300c\u3042\uff01\u4eca\u306e\u3067\u691c\u77e5\u3055\u308c\u305f\u3093\u3060\u300d\u3050\u3089\u3044\u306e\u30ed\u30f3\u30b0\u30ec\u30f3\u30b8\u3067\u53cd\u5fdc\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u307e\u305f\u3001\u30bb\u30f3\u30b5\u30fc\u304c\u691c\u77e5\u3057\u305f\u3068\u304d\u306b\u30e9\u30a4\u30c8\u3092\u5149\u3089\u305b\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<br>\u304a\u597d\u307f\u3067\u6709\u52b9\/\u7121\u52b9\u306b\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full image-border-3\"><img loading=\"lazy\" decoding=\"async\" width=\"450\" height=\"415\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-4.png\" alt=\"\" class=\"wp-image-18464\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-4.png 450w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-4-300x277.png 300w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">WebHook\u3092\u3064\u304f\u308b<\/h2>\n\n\n\n<p>\u3053\u306e\u90e8\u5206\u306f\u3001\u524d\u56de\u8a18\u4e8b<a href=\"https:\/\/blog.capilano-fw.com\/?p=17990\" data-type=\"post\" data-id=\"17990\">\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<\/a>\u3068\u307b\u307c\u540c\u3058\u306a\u306e\u3067\u4ee5\u4e0b\u3092\u53c2\u8003\u306b\u3057\u3066\u8a2d\u5b9a\u3092\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p><strong>\u53c2\u8003\u8a18\u4e8b\uff1a<\/strong><a href=\"https:\/\/blog.capilano-fw.com\/?p=17990#WebHook5\" target=\"_blank\" rel=\"noreferrer noopener\">WebHook\u3092\u3064\u304f\u308b5\u30b9\u30c6\u30c3\u30d7<\/a><\/p>\n\n\n\n<p>\u3061\u306a\u307f\u306b\u30c7\u30d0\u30a4\u30b9ID\u3068\u30b3\u30f3\u30d5\u30a3\u30b0\u306e\u8a2d\u5b9a\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\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><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>'motion_sensor' =&gt; env('SWITCHBOT_MOTION_SENSOR_DEVICE_ID'),<\/strong><br>        ],<br>    ],<br><br>];<\/pre>\n\n\n\n<p>\u3061\u306a\u307f\u306b\u524d\u56de\u8a18\u4e8b\u3067\u306f<code>WebHook<\/code>\u306e\u521d\u56de\u767b\u9332\u3067\u3057\u305f\u304c\u3001<code>ngrok<\/code>\u3092\u3064\u304b\u3063\u3066\u958b\u767a\u3059\u308b\u3068\u66f4\u65b0\u3082\u3088\u304f\u4f7f\u3046\u306e\u3067\u4ee5\u4e0b\u306b\u307e\u3068\u3081\u3066\u304a\u304d\u307e\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\/updateWebhook<\/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\ud83d\udc4d<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>{<br>    \"action\":\"updateWebhook\",<br>    \"config\":{<br>        \"url\":\"\uff08ngrok\u3067\u53d6\u5f97\u3057\u305fWebHook URL\uff09\",<br>        \"enable\":true<br>    }<br>}<\/strong><\/pre>\n\n\n\n<p>\u305d\u3057\u3066\u3001\u767b\u9332\u3068\u540c\u3058\u3088\u3046\u306b\u6210\u529f\u3059\u308b\u3068\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\u65b0\u898f\u8ffd\u52a0\u3084\u524a\u9664\u3084\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#configure-webhook\" target=\"_blank\" rel=\"noreferrer noopener\">WebHook\u306e\u8ffd\u52a0<\/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<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\u3053\u3053\u304b\u3089\u306f<code>Laravel<\/code>\u306e\u4f5c\u696d\u306b\u79fb\u308a\u307e\u3059\uff01<\/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>\u307e\u305a\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u95a2\u9023\u3067\u3059\u3002<br>\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 MotionSensorHistory -m<\/strong><\/pre>\n\n\n\n<p>\u3059\u308b\u3068\u3001\u30e2\u30c7\u30eb\u3068\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u4e2d\u8eab\u3092\u6b21\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>database\/migrations\/****_**_**_******_create_motion_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('motion_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'); \/\/ DETECTED or NOT_DETECTED<br>            $table-&gt;timestamps();<br>        });<br>    }<br><br>    <em>\/**<br>     * Reverse the migrations.<br>     *\/<br>    <\/em>public function down(): void<br>    {<br>        Schema::dropIfExists('motion_sensor_histories');<br>    }<br>};<\/strong><\/pre>\n\n\n\n<p>\u3067\u306f\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>php artisan migrate<\/strong><\/pre>\n\n\n\n<p>\u5b9f\u969b\u306e\u30c6\u30fc\u30d6\u30eb\u306f\u3053\u3046\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full image-border-3\"><img loading=\"lazy\" decoding=\"async\" width=\"406\" height=\"261\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-9.png\" alt=\"\" class=\"wp-image-18527\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-9.png 406w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-9-300x193.png 300w\" sizes=\"auto, (max-width: 406px) 100vw, 406px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">2. WebHook\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u3064\u304f\u308b<\/h3>\n\n\n\n<p>\u6b21\u306b\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"has-small-font-size\">\u203b\u6ce8\uff1a\u524d\u56de\u8a18\u4e8b\u3067\u4f5c\u6210\u3057\u305f\u4eba\u306f\u3059\u3067\u306b\u5b58\u5728\u3057\u3066\u3044\u308b\u306e\u3067\u4e0d\u8981\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\\MotionSensorHistory;<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 === 'WoPresence') { \/\/ \u4eba\u611f\u30bb\u30f3\u30b5\u30fc\u306e\u5834\u5408\uff08\u672c\u6765Enum\u3092\u4f7f\u3046\u3079\u304d\uff09<br><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 MotionSensorHistory;<br>            $contactSensorHistory-&gt;device_id = $deviceId;<br>            $contactSensorHistory-&gt;detection_state = $detectionState;<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<p>\u3061\u306a\u307f\u306b\u3001\u691c\u77e5\u72b6\u614b\uff08<code>detection_state<\/code>\uff09\u306b\u5165\u3063\u3066\u304f\u308b\u306e\u306f\u3001<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>DETECTED\uff1a\u4eba\u611f\u30bb\u30f3\u30b5\u30fc\u3067\u691c\u77e5\u3055\u308c\u305f<\/li>\n\n\n\n<li>NOT_DETECTED\uff1a\u305d\u306e\u5f8c\u3001\u3057\u3070\u3089\u304f\u691c\u77e5\u304c\u306a\u304b\u3063\u305f<\/li>\n<\/ul>\n\n\n\n<p>\u306e2\u3064\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u4eca\u56de\u306e\u6a5f\u80fd\u3068\u3057\u3066\u306f<code>DETEDTED<\/code>\u3060\u3051\u3067\u554f\u984c\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u30c7\u30fc\u30bf\u306f\u591a\u3044\u307b\u3046\u304c\u3044\u3044\u306e\u3067\u3069\u3061\u3089\u3082\u4fdd\u5b58\u3057\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066<code>WHERE<\/code>\u53e5\u3067\u30d5\u30a3\u30eb\u30bf\u30fc\u3092\u304b\u3051\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. \u30eb\u30fc\u30c8\u3092\u3064\u304f\u308b<\/h3>\n\n\n\n<p>\u6700\u5f8c\u306b\u30eb\u30fc\u30c8\u3067\u3059\u3002<br>\u3053\u3053\u306f\u524d\u56de\u3068\u540c\u3058\u306a\u306e\u3067\u3001\u4ee5\u4e0b\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p><strong>\u53c2\u7167\uff1a<\/strong><a href=\"https:\/\/blog.capilano-fw.com\/?p=17990#make-route\">\u30eb\u30fc\u30c8\u3092\u3064\u304f\u308b<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30bf\u30a4\u30de\u30fc\u5b9f\u884c\u3067\u7dca\u6025\u4e8b\u614b\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u90e8\u5206\u3092\u3064\u304f\u308b<\/h2>\n\n\n\n<p>\u3067\u306f\u3001<code>WebHook<\/code>\u304b\u3089\u53d6\u5f97\u3057\u305f\u30c7\u30fc\u30bf\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3066\u3001\u5bfe\u8c61\u8005\u306b\u52d5\u304d\u304c\u306a\u3044\uff08=\u7dca\u6025\u4e8b\u614b\u3067\u3042\u308b\uff09\u306e\u3092\u30c1\u30a7\u30c3\u30af\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u3092<code>crontab<\/code>\u3084<code>systemd<\/code>\u3067\u5b9a\u671f\u7684\u306b\u30bf\u30a4\u30de\u30fc\u5b9f\u884c\u3059\u308b\u308f\u3051\u3067\u3059\u306d\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>\u5148\u306b<code>Mailable<\/code>\u3092\u3064\u304f\u3063\u3066\u304a\u304d\u307e\u3059\u3002<br>\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:mail MotionNotDetected<\/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\/Mail\/MotionNotDetected.php<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>&lt;?php<br><br>namespace App\\Mail;<br><br>use Carbon\\Carbon;<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 MotionNotDetected extends Mailable<br>{<br>    use Queueable, SerializesModels;<br><br>    <em>\/**<br>     * Create a new message instance.<br>     *\/<br>    <\/em>public function __construct(private bool $motionDetected, private Carbon $startDt, private Carbon $endDt)<br>    {<br>    }<br><br>    <em>\/**<br>     * Get the message envelope.<br>     *\/<br>    <\/em>public function envelope(): Envelope<br>    {<br>        $subject = $this-&gt;motionDetected === true<br>            ? '\u5bfe\u8c61\u8005\u306e\u52d5\u4f5c\u304c\u691c\u77e5\u3055\u308c\u3066\u3044\u307e\u3059\u3002'<br>            : '\u3010\u81f3\u6025\uff01\u3011\u5bfe\u8c61\u8005\u306e\u52d5\u4f5c\u304c\u691c\u77e5\u3055\u308c\u3066\u3044\u307e\u305b\u3093';<br><br>        return new Envelope(<br>            subject: $subject,<br>        );<br>    }<br><br>    <em>\/**<br>     * Get the message content definition.<br>     *\/<br>    <\/em>public function content(): Content<br>    {<br>        $timeRange = $this-&gt;startDt-&gt;format('H:i') . ' \u301c ' . $this-&gt;endDt-&gt;format('H:i');<br>        $htmlString = $this-&gt;motionDetected === true<br>            ? '&lt;p&gt;'. $timeRange .'\u306b\u5bfe\u8c61\u8005\u306e\u52d5\u4f5c\u691c\u77e5\u304c\u3042\u308a\u307e\u3057\u305f\u3002&lt;\/p&gt;'<br>            : '&lt;p&gt;'. $timeRange .'\u306b\u5bfe\u8c61\u8005\u306e\u52d5\u4f5c\u691c\u77e5\u304c\u3042\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002&lt;br \/&gt;\u81f3\u6025\u3001\u5b89\u5426\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002&lt;\/p&gt;';<br><br>        return new Content(<br>            htmlString: $htmlString,<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\u90e8\u5206\u3092\u3064\u304f\u308b<\/h3>\n\n\n\n<p>\u7d9a\u3044\u3066\u30bf\u30a4\u30de\u30fc\u3067\u5b9f\u884c\u3059\u308b\u672c\u4f53\u3067\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:command CheckMotionCommand<\/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\/CheckMotionCommand.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\\MotionNotDetected;<br>use App\\Models\\MotionSensorHistory;<br>use Carbon\\Carbon;<br>use Illuminate\\Console\\Command;<br>use Illuminate\\Support\\Facades\\Mail;<br><br>class CheckMotionCommand extends Command<br>{<br>    <em>\/**<br>     * The name and signature of the console command.<br>     *<br>     * @var string<br>     *\/<br>    <\/em>protected $signature = 'check:motion';<br><br>    <em>\/**<br>     * The console command description.<br>     *<br>     * @var string<br>     *\/<br>    <\/em>protected $description = 'Check motion sensor histories';<br><br>    <em>\/**<br>     * Execute the console command.<br>     *\/<br>    <\/em>public function handle()<br>    {<br>        Carbon::<em>setTestNow<\/em>(<br>            Carbon::<em>now<\/em>()-&gt;hour(9)-&gt;minute(0)-&gt;second(0) \/\/ \u30c6\u30b9\u30c8\u306e\u305f\u3081\u30019:00\u306b\u56fa\u5b9a<br>        );<br><br>        $deviceId = str_replace(<br>            ':',<br>            '',<br>            config('services.switchbot.devices.motion_sensor')<br>        );<br>        $dt = now();<br><br>        \/\/ \u4ee5\u4e0b\u3001\u672c\u6765\u306f\u8a2d\u5b9a\u306a\u3069\u304b\u3089\u53d6\u5f97\u3059\u3079\u304d<br>        $checkHours = [9, 15, 21]; \/\/ \u30c1\u30a7\u30c3\u30af\u3059\u308b\u6642\u9593\u5e2f\uff08\u671d\u30fb\u663c\u30fb\u591c\u3092\u60f3\u5b9a\uff09<br>        $checkMinutes = 180; \/\/ \u904e\u53bb\u4f55\u5206\u9593\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u304b<br><br>        if(in_array($dt-&gt;hour, $checkHours, true)) {<br><br>            \/\/ \u904e\u53bb180\u5206\u9593\u306b\u52d5\u4f5c\u691c\u77e5\u304c\u306a\u3044\u304b\u30c1\u30a7\u30c3\u30af\u3059\u308b<br>            $startDt = $dt-&gt;copy()-&gt;subMinutes($checkMinutes);<br>            $exists = MotionSensorHistory::<em>query<\/em>()<br>                -&gt;where('device_id', $deviceId)<br>                -&gt;where('detection_state', 'DETECTED')<br>                -&gt;whereBetween('created_at', [$startDt, $dt])<br>                -&gt;exists();<br><br>            \/\/ \u7d50\u679c\u3092\u30e1\u30fc\u30eb\u9001\u4fe1<br>            $to = 'to-family@example.com'; \/\/ \u901a\u77e5\u5148\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9<br>            Mail::to($to)-&gt;send(new MotionNotDetected($exists, $startDt, $dt));<br><br>        }<br>    }<br>}<\/strong><\/pre>\n\n\n\n<p>\u3053\u308c\u3067\u4f5c\u696d\u306f\u5b8c\u4e86\u3067\u3059\uff01<br>\u304a\u75b2\u308c\u69d8\u3067\u3057\u305f\ud83d\ude0a\u2728<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u3061\u306a\u307f\u306b\uff1a\u4eba\u611f\u30bb\u30f3\u30b5\u30fc\u306f\u660e\u308b\u3055\u3082\u691c\u77e5\u3067\u304d\u308b<\/h2>\n\n\n\n<p><code>WebHook<\/code>\u306b\u306f\u9001\u3089\u308c\u3066\u3053\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u4eba\u611f\u30bb\u30f3\u30b5\u30fc\u306f\u90e8\u5c4b\u304c\u660e\u308b\u3044\/\u6697\u3044\u3092\u81ea\u52d5\u3067\u691c\u77e5\u3067\u304d\u307e\u3059\u306e\u3067\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"has-small-font-size\">\u203b\u3069\u3046\u3084\u3089\u958b\u9589\u30bb\u30f3\u30b5\u30fc\u306a\u3089WebHook\u306b\u660e\u308b\u3055\u60c5\u5831\u3082\u9001\u3063\u3066\u304f\u308b\u3088\u3046\u3067\u3059\u3002\u306a\u305c\u2026\ud83e\udd14<\/p>\n\n\n\n<p>\u30db\u30fc\u30e0\u753b\u9762\u3067\u5bfe\u8c61\u306e\u4eba\u611f\u30bb\u30f3\u30b5\u30fc\u3092\u9078\u629e\u3057\u3001\u53f3\u4e0a\u306b\u51fa\u3066\u304f\u308b\u6b6f\u8eca\u30de\u30fc\u30af\u3092\u30bf\u30c3\u30d7\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u8a2d\u5b9a\u753b\u9762\u304c\u51fa\u3066\u304f\u308b\u306e\u3067\u300c<strong>Light Sensor<\/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=\"450\" height=\"436\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-12.png\" alt=\"\" class=\"wp-image-18629\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-12.png 450w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-12-300x291.png 300w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/figure>\n\n\n\n<p>\u8aac\u660e\u66f8\u304d\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u300c<strong>Next<\/strong>\u300d\u30dc\u30bf\u30f3\u3092\u62bc\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full image-border-3\"><img loading=\"lazy\" decoding=\"async\" width=\"387\" height=\"93\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-13.png\" alt=\"\" class=\"wp-image-18632\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-13.png 387w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-13-300x72.png 300w\" sizes=\"auto, (max-width: 387px) 100vw, 387px\" \/><\/figure>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u8868\u793a\u306b\u306a\u308b\u306e\u3067<strong>\u90e8\u5c4b\u3092\u6697\u304f\u3057\u3066\u304b\u3089\u5b9f\u884c\u30dc\u30bf\u30f3\u3092\u62bc\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full image-border-3\"><img loading=\"lazy\" decoding=\"async\" width=\"391\" height=\"355\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-14.png\" alt=\"\" class=\"wp-image-18633\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-14.png 391w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-14-300x272.png 300w\" sizes=\"auto, (max-width: 391px) 100vw, 391px\" \/><\/figure>\n\n\n\n<p>\u6b21\u306b\u3001\u305d\u306e\u307e\u307e\u90e8\u5c4b\u3092\u660e\u308b\u304f\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full image-border-3\"><img loading=\"lazy\" decoding=\"async\" width=\"389\" height=\"497\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-15.png\" alt=\"\" class=\"wp-image-18635\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-15.png 389w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-15-235x300.png 235w\" sizes=\"auto, (max-width: 389px) 100vw, 389px\" \/><\/figure>\n\n\n\n<p>\u3059\u308b\u3068\u3001\u6570\u79d2\u3067\u81ea\u52d5\u7684\u306b\u753b\u9762\u304c\u5207\u308a\u66ff\u308f\u308a\u3001\u8a2d\u5b9a\u304c\u5b8c\u4e86\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u306a\u304a\u3001\u3053\u306e\u300c<strong>\u90e8\u5c4b\u304c\u660e\u308b\u3044\/\u6697\u3044<\/strong>\u300d\u306e\u60c5\u5831\u306f<code>SwitchBot API<\/code>\u304b\u3089\u53d6\u5f97\u3067\u304d\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\u3001\u5b9f\u969b\u306b\u8a66\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br>\u5148\u306b\u4ee5\u4e0b3\u3064\u3092\u5b9f\u884c\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>ngrok\u3067WebHook URL\u3092\u4f5c\u6210<\/li>\n\n\n\n<li>Postman\u3067WebHook URL\u3092\u4fdd\u5b58<\/li>\n\n\n\n<li>php artisan serve\u3067\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u8d77\u52d5<\/li>\n<\/ul>\n\n\n\n<p>\u3067\u306f\u3001\u3053\u306e\u72b6\u614b\u3067\u8a2d\u7f6e\u3057\u305f\u4eba\u611f\u30bb\u30f3\u30b5\u30fc\u306e\u524d\u3092\u6a2a\u5207\u3063\u3066\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"611\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-8.jpg\" alt=\"\" class=\"wp-image-18506\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-8.jpg 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-8-300x286.jpg 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<p class=\"has-small-font-size\">\u30b6\u30c3\u30b6\u30c3\u30b6\u30c3\uff08\u30c9\u30e9\u30af\u30a8\u98a8\uff09<\/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-image size-full image-border-3\"><img loading=\"lazy\" decoding=\"async\" width=\"599\" height=\"351\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-10.png\" alt=\"\" class=\"wp-image-18569\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-10.png 599w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-10-300x176.png 300w\" sizes=\"auto, (max-width: 599px) 100vw, 599px\" \/><\/figure>\n\n\n\n<p>\u306f\u3044\uff01<\/p>\n\n\n\n<p><code>WebHook<\/code>\u3092\u901a\u3057\u3066\u3001\u52d5\u4f5c\u691c\u77e5\u306e\u30c7\u30fc\u30bf\u304c\u4fdd\u5b58\u3055\u308c\u307e\u3057\u305f\u3002<br>\u307e\u305a\u306f\u6210\u529f\u3067\u3059\ud83d\ude0a\u2728<\/p>\n\n\n\n<p>\u7d9a\u3044\u3066\u3001\u52d5\u4f5c\u691c\u77e5\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306e\u30e1\u30fc\u30eb\u9001\u4fe1\u3092\u30c6\u30b9\u30c8\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3044\u3063\u305f\u3093\u30c7\u30fc\u30bf\u3092\u5168\u3066\u6d88\u3057\u3066\u3001\u4ee5\u4e0b\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong><em>php artisan <\/em>check:<em>motion<\/em><\/strong><\/pre>\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=\"522\" height=\"217\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-11.png\" alt=\"\" class=\"wp-image-18578\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-11.png 522w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/11\/switchbot-laravel-monitor-elderly-people-11-300x125.png 300w\" sizes=\"auto, (max-width: 522px) 100vw, 522px\" \/><\/figure>\n\n\n\n<p>\u306f\u3044\uff01<br>\u7dca\u6025\u30e1\u30fc\u30eb\u304c\u9001\u4fe1\u3055\u308c\u3066\u304d\u307e\u3057\u305f\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\u6a5f\u80fd\u306f\u3001\u7279\u306b\u4ecb\u8b77\u4e8b\u696d\u8005\u306e\u65b9\u306b\u30de\u30c3\u30c1\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3068\u3044\u3046\u306e\u3082\u3001\u5404\u3054\u5bb6\u5ead\u306b<code>SwitchBot<\/code>\u4eba\u611f\u30bb\u30f3\u30b5\u30fc\u3068\u30cf\u30d6\u3092\u7528\u610f\u3057\u3066\u3082\u3001\u30b7\u30b9\u30c6\u30e0\u306f1\u3064\u3067OK\u3060\u304b\u3089\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u307e\u305f\u3001\u30e9\u30f3\u30cb\u30f3\u30b0\u30b3\u30b9\u30c8\u306f\u30b5\u30fc\u30d0\u30fc\u6599\u91d1\uff08\u4f8b\uff1a<a href=\"https:\/\/www.xserver.ne.jp\/price\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u30a8\u30c3\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u30fb\u30b9\u30bf\u30f3\u30c0\u30fc\u30c9\u30d7\u30e9\u30f3<\/a>\u3060\u3068693\u5186\u301c\u30022025\/11\/12\u73fe\u5728\uff09\u3060\u3051\u3067OK\u3067\u3059\u3002<\/p>\n\n\n\n<p><strong>\u3064\u307e\u308a\u3001\u308f\u305a\u304b\u6708\u984d500\u5186\u3067\u63d0\u4f9b\u3057\u3066\u3082\u30012\u4eba\u5951\u7d04\u3059\u308c\u3070\u30da\u30a4\u3067\u304d\u308b\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u306d\u3002<\/strong><\/p>\n\n\n\n<p class=\"has-small-font-size\">\u521d\u671f\u8cbb\u7528\u3067\u4eba\u611f\u30bb\u30f3\u30b5\u30fc\u3084\u30cf\u30d6\u306e\u8cfc\u5165\u8cbb\u7528\u306b\u3057\u3066\u3082\u3044\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u306d\u3002<\/p>\n\n\n\n<p>\u3055\u3089\u306b\u91cd\u8981\u306a\u306e\u304c\u3001<strong>\u3082\u3057\u300c\u898b\u5b88\u308a\u30b5\u30fc\u30d3\u30b9\u300d\u304c\u5951\u7d04\u7d42\u4e86\u3057\u3066\u3082\u4eba\u611f\u30bb\u30f3\u30b5\u30fc\u306a\u3069\u306e\u6a5f\u68b0\u306f\u6b8b\u308b\u306e\u3067\u3001\u5225\u306e\u5834\u6240\u306b\u8a2d\u7f6e\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u5927\u5e45\u306a\u30b3\u30b9\u30c8\u30c0\u30a6\u30f3&amp;\u521d\u671f\u8cbb\u7528\u306e\u53ce\u76ca\u5316\u306b\u3064\u306a\u304c\u308b\u3068\u3044\u3046\u70b9\u3067\u3059\u3002<\/strong><\/p>\n\n\n\n<p>\u3082\u3057\u305d\u3046\u3044\u3063\u305f\u30b7\u30b9\u30c6\u30e0\u3092\u3054\u5e0c\u671b\u3067\u3057\u305f\u3089\u3001\u3044\u3064\u3067\u3082\u304a\u6c17\u8efd\u306b\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<\/code>\u4eba\u611f\u30bb\u30f3\u30b5\u30fc\u3092\u3064\u304b\u3063\u305f\u300c<strong>1\u4eba\u66ae\u3089\u3057\u306e\u89aa\u3092\u898b\u5b88\u308b\u6a5f\u80fd<\/strong>\u300d\u3092\u3064\u304f\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u73fe\u5728\u3001\u65e5\u672c\u306f\u5c11\u5b50\u9ad8\u9f62\u5316\u304c\u9032\u3093\u3060\u7d50\u679c\u3001\u4eba\u624b\u304c\u4e0d\u8db3\u3057\u3066\u3044\u308b\u53cd\u9762\u3001\u4ecb\u8b77\u3055\u308c\u308b\u5074\u306f\u5897\u3048\u3066\u3044\u304f\u72b6\u6cc1\u306b\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u79fb\u6c11\u653f\u7b56\u3082\u69d8\u3005\u306a\u554f\u984c\u70b9\u304c\u3042\u308b\u3053\u3068\u304c\u6307\u6458\u3055\u308c\u3066\u304a\u308a\u3001\u3084\u306f\u308a\u5f53\u9762\u306f\u300c<strong>\u3044\u304b\u306b\u4eba\u624b\u3092\u4f7f\u308f\u306a\u3044\u624b\u6bb5\u3092\u5c0e\u5165\u3059\u308b\u304b?<\/strong>\u300d\u304c\u91cd\u8981\u306b\u306a\u3063\u3066\u304f\u308b\u3093\u3058\u3083\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n\n\n\n<p>\u3082\u3057IT\u306e\u6280\u8853\u3067\u793e\u4f1a\u554f\u984c\u3092\u89e3\u6c7a\u3067\u304d\u305f\u3089\u3044\u3044\u3067\u3059\u306d\uff01<br>\u305c\u3072\u7686\u3055\u3093\u3082\u3044\u308d\u3044\u308d\u8003\u3048\u3066\u304f\u3060\u3055\u3044\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=\"350\" height=\"323\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/08\/tuktuk-with-boy-small.png\" alt=\"\" class=\"wp-image-16070\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/08\/tuktuk-with-boy-small.png 350w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2025\/08\/tuktuk-with-boy-small-300x277.png 300w\" sizes=\"auto, (max-width: 350px) 100vw, 350px\" \/><\/figure><\/div>\n\n\n<p class=\"has-text-align-center\">\u300cEV\u30c8\u30a5\u30af\u30c8\u30a5\u30af\u306e\u51ac\u904b\u7528\u3001<br>\u304d\u3061\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\u30fc\ud83d\ude02\uff08\u3051\u3069\u4e57\u308b\uff01\uff09\u300d<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u5c11\u3057\u524d\u306b5\u5e74\u306b1\u5ea6\u306e\u56fd\u52e2\u8abf\u67fb\u304c\u884c\u308f\u308c\u3001\u7d50\u679c\u304c\u6c17\u306b\u306a\u308b\u90e8\u5206\u304c\u3042\u308a\u307e\u3059\u3002 \u305d\u308c\u306f\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb \u5c11\u5b50\u9ad8\u9f62\u5316\u304c\u3069\u3046\u306a\u3063\u3066\u308b\u304b\uff1f \u3067\u3059\u3002 \u306a\u305c\u306a\u3089\u3001\u8ca1\u653f\u554f\u984c\u304c &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=18341\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u3010SwitchBot + Laravel\u30111\u4eba\u66ae\u3089\u3057\u306e\u89aa\u3092\u898b\u5b88\u308b\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":18694,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[264],"class_list":["post-18341","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\/18341","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=18341"}],"version-history":[{"count":320,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/18341\/revisions"}],"predecessor-version":[{"id":18695,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/18341\/revisions\/18695"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/18694"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=18341"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=18341"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=18341"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}