ael-code / daikin-control

Unofficial api documentation and web interface to control "Daikin Emura" air conditioner
GNU General Public License v2.0
295 stars 101 forks source link

Intelligent Eye API? #5

Open FezVrasta opened 9 years ago

FezVrasta commented 9 years ago

Hi,

thanks for the great document!

I'd like to know if there is a way to get informations from the Intelligent Eye, so I know if there is someone in the room of my Emura.

Thanks!

ael-code commented 9 years ago

On 06/11/2015 01:02 PM, Fez Vrasta wrote:

Hi,

thanks for the great document!

I'd like to know if there is a way to get informations from the Intelligent Eye, so I know if there is someone in the room of my Emura.

As far as I know there isn't any api to monitor/manage Intelligent Eye feature. If you'll find something about that please share :)

FezVrasta commented 9 years ago

I'll do! I'm still waiting that someone install my AC. After that I'm going to write a Node.js module to manage my AC.

I'll try to sniff the packets with wireshark to see if I find something useful and I'll even decompile the Android apk to see if I can find something :)

ael-code commented 9 years ago

I'll do! I'm still waiting that someone install my AC. After that I'm going to write a Node.js module to manage my AC.

Nice!

I'll try to sniff the packets with wireshark to see if I find something useful and I'll even decompile the Android apk to see if I can find something :)

This is what I did. Official android app do not support special functions like Intelligent Eye. This is why I think there are any api that provides these capabilities. The only way I found to control special functions is through official remote control.

daikin_app_screen

Anyway I would like to keep track of your future progress.

FezVrasta commented 9 years ago

I'll keep you informed here.

StarkJohan commented 9 years ago

I've also been trying to figure out if there is any support in the API for special functions like POWERFUL mode. I did a script to search for API responses on random strings burt with only one unit it would take years to go through the complete search... and the API isn't responsive while searching ... :-(

ael-code commented 9 years ago

I've also been trying to figure out if there is any support in the API for special functions like POWERFUL mode.

I think this is another special function not exposed by http api.

I did a script to search for API responses on random strings burt with only one unit it would take years to go through the complete search... and the API isn't responsive while searching ... :-(

The documentation on this repo is not well organized, I hope we can improve it together. Anyway during my research I found out that on http://daikinsmartdbt.jp/ there was some kind of dakin api documentation. Now the site require restricted access but you can find the source in this repo.

Few days ago I was in your city :)

FezVrasta commented 9 years ago

Do you think it would be possible to read the content of the hardware inside the AC to get maybe some xml or something where are listed the API?

ael-code commented 9 years ago

Do you think it would be possible to read the content of the hardware inside the AC to get maybe some xml or something where are listed the API?

I think that it's possible, but maybe it's a very hard procedure.

Puskaitis commented 5 years ago

1 // Copyright 2016 sillyfrog 2 // Copyright 2017 sillyfrog, crankyoldgit 3 #ifndef IR_DAIKINH 4 #define IR_DAIKINH 5 6 #ifndef UNIT_TEST 7 #include 8 #else 9 #include 10 #endif 11 #include "IRremoteESP8266.h" 12 #include "IRrecv.h" 13 #include "IRsend.h" 14 15 // Option to disable the additional Daikin debug info to conserve memory 16 #define DAIKIN_DEBUG false 17 18 // DDDDD AAA IIIII KK KK IIIII NN NN 19 // DD DD AAAAA III KK KK III NNN NN 20 // DD DD AA AA III KKKK III NN N NN 21 // DD DD AAAAAAA III KK KK III NN NNN 22 // DDDDDD AA AA IIIII KK KK IIIII NN NN 23 24 / 25 Daikin AC map 26 byte 5=Current time, mins past midnight, low bits 27 byte 6 28 b0-b3=Current time, mins past midnight, high bits 29 byte 7= checksum of the first part (and last byte before a 29ms pause) 30 byte 13=mode 31 b7 = 0 32 b6+b5+b4 = Mode 33 Modes: b6+b5+b4 34 011 = Cool 35 100 = Heat (temp 23) 36 110 = FAN (temp not shown, but 25) 37 000 = Fully Automatic (temp 25) 38 010 = DRY (temp 0xc0 = 96 degrees c) 39 b3 = 1 40 b2 = OFF timer set 41 b1 = ON timer set 42 b0 = Air Conditioner ON 43 byte 14=temp2 (Temp should be between 10 - 32) 44 byte 16=Fan 45 FAN control 46 b7+b6+b5+b4 = Fan speed 47 Fan: b7+b6+b5+b4 48 0×3 = 1 bar 49 0×4 = 2 bar 50 0×5 = 3 bar 51 0×6 = 4 bar 52 0×7 = 5 bar 53 0xa = Auto 54 0xb = Quite 55 b3+b2+b1+b0 = Swing control up/down 56 Swing control up/down: 57 0000 = Swing up/down off 58 1111 = Swing up/down on 59 byte 17 60 Swing control left/right: 61 0000 = Swing left/right off 62 1111 = Swing left/right on 63 byte 18=On timer mins past midnight, low bits 64 byte 19 65 b0-b3=On timer mins past midnight, high bits 66 b4-b7=Off timer mins past midnight, low bits 67 byte 20=Off timer mins past midnight, high bits 68 byte 21=Aux -> Powerful (bit 1), Silent (bit 5) 69 byte 24=Aux2 70 b1: Sensor 71 b2: Econo mode 72 b7: Intelligent eye on 73 byte 25=Aux3 74 b1: Mold Proof 75 byte 26= checksum of the second part 76 / 77 78 // Constants 79 #define DAIKIN_COOL 0b011 80 #define DAIKIN_HEAT 0b100 81 #define DAIKIN_FAN 0b110 82 #define DAIKIN_AUTO 0b000 83 #define DAIKIN_DRY 0b010 84 #define DAIKIN_MIN_TEMP 10U // Celsius 85 #define DAIKIN_MAX_TEMP 32U // Celsius 86 #define DAIKIN_FAN_MIN (uint8_t) 1U 87 #define DAIKIN_FAN_MAX (uint8_t) 5U 88 #define DAIKIN_FAN_AUTO (uint8_t) 0b1010 89 #define DAIKIN_FAN_QUIET (uint8_t) 0b1011 90 91 #define DAIKIN_BYTE_POWER 13 92 #define DAIKIN_BIT_POWER 0b00000001 93 94 #define DAIKIN_BYTE_POWERFUL 21 95 #define DAIKIN_BIT_POWERFUL 0b00000001 96 #define DAIKIN_BYTE_SILENT 21 97 #define DAIKIN_BIT_SILENT 0b00100000 98 99 #define DAIKIN_BYTE_SENSOR 24 100 #define DAIKIN_BIT_SENSOR 0b00000010 101 #define DAIKIN_BYTE_ECONO 24 102 #define DAIKIN_BIT_ECONO 0b00000100 103 #define DAIKIN_BYTE_EYE 24 104 #define DAIKIN_BIT_EYE 0b10000000 105 #define DAIKIN_BYTE_MOLD 25 106 #define DAIKIN_BIT_MOLD 0b00000010 107 108 #define DAIKIN_BYTE_OFF_TIMER 13 109 #define DAIKIN_BIT_OFF_TIMER 0b00000100 110 #define DAIKIN_BYTE_ON_TIMER 13 111 #define DAIKIN_BIT_ON_TIMER 0b00000010 112 113 #define DAIKIN_CURBIT DAIKIN_COMMAND_LENGTH 114 #define DAIKIN_CURINDEX (DAIKIN_COMMAND_LENGTH + 1) 115 #define OFFSET_ERR 65432 116 117 #define DAIKIN_TOLERANCE 35 118 #define DAIKIN_MARK_EXCESS MARK_EXCESS 119 120 #define DAIKIN_HDR_MARK 3650U // DAIKIN_BIT_MARK 8 121 #define DAIKIN_HDR_SPACE 1623U // DAIKIN_BIT_MARK 4 122 #define DAIKIN_BIT_MARK 428U 123 #define DAIKIN_ZERO_SPACE 428U 124 #define DAIKIN_ONE_SPACE 1280U 125 #define DAIKIN_GAP 29000U 126 127 // Note bits in each octet swapped so can be sent as a single value 128 #define DAIKIN_FIRST_HEADER64 \ 129 0b1101011100000000000000001100010100000000001001111101101000010001 130 131 class IRDaikinESP { 132 public: 133 explicit IRDaikinESP(uint16_t pin); 134 135 #if SEND_DAIKIN 136 void send(); 137 #endif 138 void begin(); 139 void on(); 140 void off(); 141 void setPower(bool state); 142 bool getPower(); 143 void setTemp(uint8_t temp); 144 uint8_t getTemp(); 145 void setFan(uint8_t fan); 146 uint8_t getFan(); 147 uint8_t getMode(); 148 void setMode(uint8_t mode); 149 void setSwingVertical(bool state); 150 bool getSwingVertical(); 151 void setSwingHorizontal(bool state); 152 bool getSwingHorizontal(); 153 bool getQuiet(); 154 void setQuiet(bool state); 155 bool getPowerful(); 156 void setPowerful(bool state); 157 void setSensor(bool state); 158 bool getSensor(); 159 void setEcono(bool state); 160 bool getEcono(); 161 void setEye(bool state); 162 bool getEye(); 163 void setMold(bool state); 164 bool getMold(); 165 void enableOnTimer(uint16_t starttime); 166 void disableOnTimer(); 167 uint16_t getOnTime(); 168 bool getOnTimerEnabled(); 169 void enableOffTimer(uint16_t endtime); 170 void disableOffTimer(); 171 uint16_t getOffTime(); 172 bool getOffTimerEnabled(); 173 void setCurrentTime(uint16_t time); 174 uint16_t getCurrentTime(); 175 uint8_t getRaw(); 176 void setRaw(uint8_t new_code[]); 177 #if DAIKIN_DEBUG 178 void printState(); 179 #endif // DAIKIN_DEBUG 180 uint32_t getCommand(); 181 void setCommand(uint32_t value); 182 static bool validChecksum(const uint8_t state[], 183 const uint16_t length = DAIKIN_COMMAND_LENGTH); 184 #ifdef ARDUINO 185 String toString(); 186 static String renderTime(uint16_t timemins); 187 #else 188 std::string toString(); 189 static std::string renderTime(uint16_t timemins); 190 #endif 191 192 private: 193 // # of bytes per command 194 uint8_t daikin[DAIKIN_COMMAND_LENGTH]; 195 void stateReset(); 196 static uint8_t calcBlockChecksum(const uint8_t *block, const uint16_t length); 197 void checksum(); 198 void setBit(uint8_t byte, uint8_t bitmask); 199 void clearBit(uint8_t byte, uint8_t bitmask); 200 uint8_t getBit(uint8_t byte, uint8_t bitmask); 201 IRsend _irsend; 202 }; 203 204 #endif // IR_DAIKINH