Save 37% off PRO during our Black Friday Sale! »

エアコンの操作についての話

 エアコンの操作についての話

ダイキンエアコンのリモート操作Appの仕様が2021年6月28日に変更になったのを受けて、自分で直接エアコン操作ができるようにした話

1f744b4a2aac98ea3fe81fe1f0217573?s=128

Yukimitsu Izawa

August 21, 2021
Tweet

Transcript

  1. ΤΞίϯͷ ૢ࡞ʹ͍ͭͯͷ࿩ ҪᖒΏ͖Έͭ 2021೥8݄21೔ Kanazawa.rb meetup #108

  2. ࣗݾ঺հ ➤ YouTuber ➤ My Outdoor Life (https://kanazawa.camp/) ➤ ത࢜(৘ใՊֶ)

    ➤ ΠϯλʔωοτΛ࢖ͬͨૄ݁߹෼ࢄγεςϜͷݚڀΛ͍ͯ͠·͢ ➤ גࣜձࣾΫϧ΢Οοτ औక໾COO ݉ ๺཮ࢧࣾ௕ ➤ Code for Kanazawa ཧࣄ ➤ ిࢠ޻࡞ͱφΠϑΛࣗ࡞͢Δͷ͕झຯͰ͢
  3. ৸ࣨͷΤΞίϯ ग़య: https://www.daikinaircon.com/roomaircon/products/r_series/index.html#spec?tab=18 ΑΓ

  4. εϚϗ͔Βૢ࡞Ͱ͖Δศརػೳ෇͖ ग़య: https://www.daikinaircon.com/roomaircon/products/r_series/index.html#spec?tab=18 ΑΓ

  5. ൵ܶ͸ಥવʹ

  6. ηΩϡϦςΟରԠ……ʁ

  7. ωοτͰ΋൵໐͕͕͋Δ

  8. զ͕ՈͷηΩϡϦςΟϙϦγతʹΞ΢τ ➤ ୐಺ͷIoTػث͸Πϯλʔωοτଆ͔ΒϦʔνϟϒϧʹ͠ͳ͍ ➤ DAIKINΫϥ΢υ͕ؕམͨ͠Βզ͕ՈͷΤΞίϯͷૢ࡞ݖ͕ୣऔ͞ΕΔϦεΫ ➤ ΤΞίϯͷૢ࡞͸ਓʹة֐ΛՃ͑ΔखஈͱͳΓ͑Δ(೤த঱ͳͲɺಛʹ࿝ਓ) ίϯτϩʔϥʔ͙Β͍؆୯ʹ࡞ΕΔͬ͠ΐ

  9. άάΔͱ͍Ζ͍Ζͱ৘ใ͕ग़ͯ͘Δ ➤ port 80 Ͱ Web API͕ޱΛ։͚͍ͯΔ ➤ GET ϝιουͰશ෦׬݁Ͱ͖ͦ͏

    ➤ ΤϯυϙΠϯτͷURL͸άάΔͱग़͖ͯͨ ➤ ͭ·Γcurlఔ౓Ͱ׬݁ͦ͠͏͡ΌͶʁ
  10. API END POINT ➤ /common/basic_info جຊతͳ৘ใ ➤ /aircon/get_sensor_info ηϯα৘ใ ➤

    /aircon/get_control_info ઃఆऔಘ ➤ /aircon/set_control_info ઃఆมߋ
  11. /COMMON/BASIC_INFO % curl http://192.168.100.9/common/basic_info ret=OK,type=aircon,reg=jp,dst=1,ver=3_5_3,pow=0,err=0,location=0, name=%e5%af%9d%e5%ae%a4,icon=0,method=home only,port=30050,id=,pw=, lpw_flag=0,adp_kind=2,pv=3.01,cpv=3,cpv_minor=01,led=1,en_setzone=0, mac=60F189B45044,adp_mode=run,en_hol=0,enlver=1.00,grp_name=,en_grp=0

  12. /AIRCON/GET_SENSOR_INFO % curl http://192.168.100.9/aircon/get_sensor_info ret=OK,htemp=26.0,hhum=85,otemp=28.0,err=0,cmpfreq=0,mompow=1

  13. /AIRCON/GET_CONTROL_INFO % curl http://192.168.100.9/aircon/get_control_info ret=OK,pow=0,mode=0,adv=,stemp=M,shum=AUTO_L,dt1=M,dt2=M,dt3=25.0,dt4=25. 0,dt5=25.0,dt7=M,dh1=AUTO_L,dh2=55,dh3=0,dh4=0,dh5=0,dh7=AUTO_L,dhh=50,b_ mode=0,b_stemp=M,b_shum=AUTO_L,alert=16,stemp_a=0,dt1_a=0,dt7_a=0,b_stemp _a=0 pow: ిݯঢ়ଶ:

    (0→ఀࢭ, 1→Քಇத) mode: ӡసϞʔυ: (0,1,7→ࣗಈ, 2→আ࣪, 3→ྫྷ๪, 4→ஆ๪, 6→ૹ෩) stemp: target ͱ͢ΔԹ౓ shum: targetͱ͢Δ࣪౓
  14. /AIRCON/SET_CONTROL_INFO % curl http://192.168.100.9/aircon/set_control_info pow=1,mode=0,adv=,stemp=M,shum=AUTO_L,dt1=M,dt2=M,dt3=25.0,dt4=25.0,dt5=2 5.0,dt7=M,dh1=AUTO_L,dh2=55,dh3=0,dh4=0,dh5=0,dh7=AUTO_L,dhh=50,b_mode=0, b_stemp=M,b_shum=AUTO_L,alert=16,stemp_a=0,dt1_a=0,dt7_a=0,b_stemp_a=0 % curl http://192.168.100.9/aircon/set_control_info?

    pow=1&mode=0&adv=&stemp=M&shum=AUTO_L&dt1=M&dt2=M&dt3=25.0&dt4=25.0&dt5=2 5.0&dt7=M&dh1=AUTO_L&dh2=55&dh3=0&dh4=0&dh5=0&dh7=AUTO_L&dhh=50&b_mode=0& b_stemp=M&b_shum=AUTO_L&alert=16&stemp_a=0&dt1_a=0&dt7_a=0&b_stemp_a=0 , を & に変換してURLパラメータ化 get_control_infoͰऔಘͨ͠ύϥϝʔλΛݩʹͯ͠Ұ෦Λॻ͖׵͑Δ
  15. ղܾʂ ➤ GETϝιουͰୟ͚ΔͷͰɺͦΕͧΕͷURLΛεϚϗͷϒϥ΢βʹbookmarkͯ͠׬ ྃʂ

  16. ݁࿦ ➤ ΤΞίϯʹ͸ແઢLANΞμϓλΛ͚͓͚ͭͯ ➤ ͍͖ͳΓվѱ͞Εͯ΋ٽ͔ͣʹؤுΕ͹ͳΜͱͳ͔ͳΔ ➤ μΠΩϯɺ͓લ΄Μͱڐ͞Μ͔Βͳʂ