ouinouin / Berryton

Drive your airton AC unit from mqtt with an esp32 modulte with tasmota and a berry script
1 stars 0 forks source link

Add support API HTTP #1

Open julien8913 opened 3 months ago

julien8913 commented 3 months ago

Hello, As seen together I open this request to add support via HTTP API on your code . Thanks for all your work .

ouinouin commented 3 months ago

@julien8913 nice to see you there, i alreadey had good progress in objectification of berryton, and i begun to make some commands available as tasmota commands, unfortunately its a bit short to be a real API, but as my berry knowledge is increasing, i see that its possible to listen on http and do some replies. my plan is to have some http adress like http://whateveryounamedyourtasmotamodule/ACapi/ then i can make the status of the AC unit available via /GetACStatus the returned payload would be a json containing the AC mode ,the fan speed, the louvers position, the internal temperature value and the temperature set something like : {"ACMode" : "heat" , "FanSpeed" : "medium" , "OscillationMode" : "sweep 3-5" , "TemperatureSetpoint" : 31 , "InternalTemperatureValue" : 26} the internal temperature returned is an integer, normally, the plan is to have the temperaturesetpoint being a float since the thermostat function integrated in heat mode can compare to the value of an external temperature probe.

the vocabulary is amongst this list : var ACmodelist = ["auto","cool","dry","fan_only","heat","off",] var FanModeList = ["auto","low","low-medium","medium","medium-high","high","stepless","turbo"] var OscillationModeList = ["off", "on" ,"high","medium-high","medium","medium-low","low","sweep 3-5","sweep 3-5","sweep 2-5","sweep2-4","sweep1-4","sweep 1-3","sweep 4-6"]

then tho send some commands i hesitate between receiving a payload wiht all the values in json (i would prefer that , since the values are all sent together in the same frame to the ac unit, it makes sense to always send all the parameters together, unfortunately its not the case with the homeasistant mqt hvac model... so the payload sent would be sent to /SetAC with a payload looking like the previsou one, just without the InternalTemperatureValue.

this is just a beginning of a proposal, tell me what you think about that.

julien8913 commented 3 months ago

Hi, I don't have the necessary dev skills to advise you. However, from what I understand, from my side the payload can arrive at once or several times and doesn't seem to bother you. homey knows how to interpret Json and pass the data in variables. In order to prepare my ESP8266, can you please send me the wiring diagram for the ESP on the AC module port? thanks for everything.

ouinouin commented 3 months ago

@julien8913 : mind first that berry is available only to ESP32 ESP32-S2, ESP32-C3, ESP32-S3 (dont recommend esp32 S2 as i see some instabilities on the S2). i recommend the atom modules from M5stack , as they are small and can easily be installed in the AC unit. pictures are on the way (check readme.md by tomorrow.) edit, added something on the doc about hardware , on the Berryton object branch. (note that this branch shouldn't yet be used).

julien8913 commented 3 months ago

Hello, Sorry for the delay in getting back to you. If I understand correctly, I need to order this product, which will be enough? or do I need an additional module? If so, I'll order it quickly.

https://shop.m5stack.com/products/atoms3-lite-esp32s3-dev-kit

ouinouin commented 3 months ago

Hello, Sorry for the delay in getting back to you. If I understand correctly, I need to order this product, which will be enough? or do I need an additional module? If so, I'll order it quickly.

https://shop.m5stack.com/products/atoms3-lite-esp32s3-dev-kit

hi, yes, as explained in the readme of the Berryton_object branch , if you want to be fully sure you ll destroy nothing on your esp32 , you ll need bidirectionnal level shifters like this : https://www.amazon.fr/RUNCCI-YUN-Convertisseur-Logique-Bidirectionnel-3-3V-5V/dp/B082F6BSB5/

julien8913 commented 3 months ago

I hadn't seen your update with the photos. Thanks again, I'm ordering the modules.

ouinouin commented 6 days ago

@julien8913 some progress on this project ?