Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support API HTTP #1

Open
julien8913 opened this issue Mar 11, 2024 · 11 comments
Open

Add support API HTTP #1

julien8913 opened this issue Mar 11, 2024 · 11 comments

Comments

@julien8913
Copy link

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

@ouinouin
Copy link
Owner

@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
Copy link
Author

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
Copy link
Owner

ouinouin commented Mar 14, 2024

@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
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

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

@ouinouin
Copy link
Owner

@julien8913 some progress on this project ?

@julien8913
Copy link
Author

Hello @ouinouin ,I'm sorry I've completely dropped out of all my projects this summer.

I ordered last week the voltage regulator, I tried this day to connect to the air conditioning (I have output 5.1V on the ATOM side ) but the ATOMS3 does not seem to start (no http access).

I followed the color code for the connection by following your photos. (ATOM lite connection.jpg)

I also tried to run the BERRYTON script, but I must be doing it wrong because I don't see any log in the console linked to the script that would indicate that the script is running, nor do I see any log in the mqtt grinder ( I do see those on the ATOMS3 when it's powered by USB-C ) .

I hope to get it up and running this evening.
I've also read up on how to create an app for Homey to make access easier with BERRYTON.
I'll keep you posted.

have a good day

@julien8913
Copy link
Author

My air conditioning only sends 7V I think the power is too low. I don't understand why, I'll test it on the second split later.

@ouinouin
Copy link
Owner

ouinouin commented Oct 9, 2024 via email

@julien8913
Copy link
Author

julien8913 commented Oct 9, 2024

No, I have 7V at the air conditioning output instead of 12V.
Edit:
I tested on my second, same thing 7,5V, but the original Wifi module indicates that it is 12V on these pins.

To test, I can fit an 18650 battery to power the ESP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants