LoginSignup
0
1

More than 3 years have passed since last update.

夏休みの工作特別企画 電気ポットをwifiにする

Last updated at Posted at 2019-08-01

image.png
ソノフは、コンセントをwiifiにするスマートプラグです。標準でスマートフォンから制御できます。
image.png

中身は、ESP8266でpythonから制御できるはずでした。
image.png

image.png
ともにバグのために停止しました。

色々ググった結果iftttにsonoffのアクションサービスがあることがわかりました。
image.png

image.png

Createを選択します。
image.png
+を選択します。
image.png
Webhooksを選択します。
image.png
トリガーは、Web requestを選択します。
image.png
適当な名前を付けます。ここでは、plugOn
image.png
that + を選択します。
image.png

image.png
Turn 1 Channel plugを選択します。

image.png

Create Action します。
image.png

Finishします。
image.png
image.png
赤丸をクリックします。
image.png
Documentationをクリックします。
image.png

on と offを作成し各々のweb requestをコピーします。

test.py
import requests,time
on= 'https://maker.ifttt.com/trigger/switchOn/with/key/xxxxxxxxxxxxxxxx'
off='https://maker.ifttt.com/trigger/switchOff/with/key/xxxxxxxxxxxxxxxx'

r = requests.post(on)
print(r.text)
time.sleep(3)
r = requests.post(off)
print(r.text)
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1