Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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

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

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

Yukimitsu Izawa

August 21, 2021
Tweet

More Decks by Yukimitsu Izawa

Other Decks in How-to & DIY

Transcript

  1. ΤΞίϯͷ


    ૢ࡞ʹ͍ͭͯͷ࿩
    ҪᖒΏ͖Έͭ


    2021೥8݄21೔ Kanazawa.rb meetup #108

    View full-size slide

  2. ࣗݾ঺հ
    ➤ YouTuber


    ➤ My Outdoor Life (https://kanazawa.camp/)


    ➤ ത࢜(৘ใՊֶ)


    ➤ ΠϯλʔωοτΛ࢖ͬͨૄ݁߹෼ࢄγεςϜͷݚڀΛ͍ͯ͠·͢


    ➤ גࣜձࣾΫϧ΢Οοτ औక໾COO ݉ ๺཮ࢧࣾ௕


    ➤ Code for Kanazawa ཧࣄ


    ➤ ిࢠ޻࡞ͱφΠϑΛࣗ࡞͢Δͷ͕झຯͰ͢

    View full-size slide

  3. ৸ࣨͷΤΞίϯ
    ग़య: https://www.daikinaircon.com/roomaircon/products/r_series/index.html#spec?tab=18 ΑΓ

    View full-size slide

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

    View full-size slide

  5. ൵ܶ͸ಥવʹ

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  8. զ͕ՈͷηΩϡϦςΟϙϦγతʹΞ΢τ
    ➤ ୐಺ͷIoTػث͸Πϯλʔωοτଆ͔ΒϦʔνϟϒϧʹ͠ͳ͍


    ➤ DAIKINΫϥ΢υ͕ؕམͨ͠Βզ͕ՈͷΤΞίϯͷૢ࡞ݖ͕ୣऔ͞ΕΔϦεΫ


    ➤ ΤΞίϯͷૢ࡞͸ਓʹة֐ΛՃ͑ΔखஈͱͳΓ͑Δ(೤த঱ͳͲɺಛʹ࿝ਓ)
    ίϯτϩʔϥʔ͙Β͍؆୯ʹ࡞ΕΔͬ͠ΐ

    View full-size slide

  9. άάΔͱ͍Ζ͍Ζͱ৘ใ͕ग़ͯ͘Δ
    ➤ port 80 Ͱ Web API͕ޱΛ։͚͍ͯΔ


    ➤ GET ϝιουͰશ෦׬݁Ͱ͖ͦ͏


    ➤ ΤϯυϙΠϯτͷURL͸άάΔͱग़͖ͯͨ


    ➤ ͭ·Γcurlఔ౓Ͱ׬݁ͦ͠͏͡ΌͶʁ

    View full-size slide

  10. API END POINT
    ➤ /common/basic_info جຊతͳ৘ใ


    ➤ /aircon/get_sensor_info ηϯα৘ใ


    ➤ /aircon/get_control_info ઃఆऔಘ


    ➤ /aircon/set_control_info ઃఆมߋ

    View full-size slide

  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


    View full-size slide

  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


    View full-size slide

  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ͱ͢Δ࣪౓

    View full-size slide

  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Ͱऔಘͨ͠ύϥϝʔλΛݩʹͯ͠Ұ෦Λॻ͖׵͑Δ

    View full-size slide

  15. ղܾʂ
    ➤ GETϝιουͰୟ͚ΔͷͰɺͦΕͧΕͷURLΛεϚϗͷϒϥ΢βʹbookmarkͯ͠׬
    ྃʂ

    View full-size slide

  16. ݁࿦
    ➤ ΤΞίϯʹ͸ແઢLANΞμϓλΛ͚͓͚ͭͯ


    ➤ ͍͖ͳΓվѱ͞Εͯ΋ٽ͔ͣʹؤுΕ͹ͳΜͱͳ͔ͳΔ


    ➤ μΠΩϯɺ͓લ΄Μͱڐ͞Μ͔Βͳʂ

    View full-size slide