IFTTT를 curl로 조작
IFTTT를 curl로 조작
스마트 플러그를 스크립트에서 조작하고 싶습니다.
최근 Smart Plug(소위 원격 조작이 가능한 콘센트)가 저렴해지고 있습니다. 다만, 스마트폰으로부터 On/Off 하는 것만으로는 아깝다.
자가 서버(라고 하는 Raspberry Pi군)가 일정 온도 이상이 되면, 마음대로 외장 팬을 On으로 할 수 없는 것이라고 생각하고 있었다.
그래서 IFTTT에 있는 Webhook과 Smart Life를 조합해 자동화에 도전해 보았다.
Webhook : 작성한 애플릿에 curl 인터페이스를 제공하는 서비스
Smart Life : Smart Plug의 일파 (스마트 폰, Smart Life 앱에서 작동하는 것)
Meross : Smart Plug의 일파 (스마트 폰, Meross 앱에서 작동하는 것)
IFTTT에서 My Applet 만들기





이벤트 명칭은 curl로 액세스하는 URL이 사용하는 문자열이므로 공백이나 특수 문자는 피하는 것이 무난합니다.


또는 "meross"에서도 가능



Meross에서도 거의 같은 전개. (여기에서는 스마트 폰으로 "USB Fan"이라고 명명 한 device를 지정)

11. 마지막으로, 확인 화면을 묶고 Finish를 클릭

12. My Applet에 등록되어 있는지 확인하고 종료

webhook 사용법 확인


Documentation 액세스 방법을 설명하는 설명서
설정 액세스 방법에 사용할 토큰 관리
설정

Documentation

{event}라고 쓰여 있는 곳에, 이벤트명으로 지정한 것을 넣어 사용한다. 여기의 예이면 TurnOffFan이됩니다.
Curl 해보기
그럼, 실제로, curl 해 본다. 위의 Documentation에 쓰여진 manma 실행
$ curl -X POST https://maker.ifttt.com/trigger/{TurnOffFan}/with/key/abcdefghijklmnopqrstuv
Congratulations! You've fired the TurnOffFan event
무사히 팬이 멈추면 성공. (실제로 멈추었습니다)
Reference
이 문제에 관하여(IFTTT를 curl로 조작), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/mbamba/items/c9ec0ffa9de35823e1d0텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)