この記事は、前回のこちらの記事
M5Stack UiFlow x Azure IoT Central で簡単に双方向連携デバイスを作る方法
の続きです。
Azure IoT Central は Microsoft のサービスですから、Power Platform との親和性も高いです。
実際、Power Automate を見てみると、非常に多くのアクションが用意されています。
※これでも一部
活用すると、こんなことができるようになります!
色々検証したけど、 #PowerApps から単体で #Azure IoT Central にコマンド発行するのは厳しいっぽいので、 #PowerAutomate 挟んだ方が圧倒的に楽。
— りなたむ(Ryota)@ITの町医者👨⚕️ (@Rinatamu_ITDR) November 4, 2023
ってのが分かった🤗#M5Stack #M5Paper pic.twitter.com/GQi3Q8Lijj
というわけで、Azure IoT Central で定義したコマンドを Power Apps、Power Automate から実行させ、M5Stack デバイス上に表示させる仕組みを作っていきたいと思います。
1. Power Automate
Power Apps にも、Azure IoT Central があるので、そこからでも飛ばせそうですが、IDを引っ張ったりするのがちょっと大変なので、Power Automate 経由にしたいと思います。
1.1. Power Apps トリガー
1.2. Azure IoT Central アクション
- Azure IoT Central V3 の デバイスでコマンドを実行するを選択する
-
フローを保存する。
2. Power Apps
作成したフローを Power Apps と連携させます。
3. 完成形
実際に操作したのがこちらです
#PowerApps から #Azure IoT Central 経由で、 #M5StickC にメッセージを連携。
— りなたむ(Ryota)@ITの町医者👨⚕️ (@Rinatamu_ITDR) November 9, 2023
驚くほど簡単にできます😁#M5Stack pic.twitter.com/cBE2x4lkN1
4. まとめ
一度連携部分を作ってしまえば、Power Apps,Power Automate との連動は非常に簡単でしたね!
これも一つの Fusion Team 開発と言ってよいかと思います😃
ぜひ、いろんなデバイスと組み合わせて、最高なアプリを作ってみてください😃