ouinouin / Berryton

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

Wiring diagram #3

Open tompointexe opened 4 months ago

tompointexe commented 4 months ago

Hi, finaly took time to get back into this Do you have a basic wiring diagram ? or is it as simple as plugging tx in rx and rx in tx ? i plan to use an ESP8266 or ESP32 if needed Thanks :)

ouinouin commented 4 months ago

Hi @tompointexe , i ll take time to make a sketch for the serial connection, but basically , if you re taking the quick and dirty way, without level shifters, you ll only need to wire tx to rx and rx to tx. in the berryton object branche, i published some pictures to show the connection. however i remind you that berryton is running through berry interpreter which is only supported on ESP32 variants and not on esp8266. regards.

tompointexe commented 4 months ago

Awesome Thanks Yeah i figured out that i will need an ESP32, so i've tryed it and i'm only able to read data but not write it, might need higher voltaged than the one provided by my esp32

RaceX58 commented 1 month ago

Hello,

Is it possible to have the connector wiring diagram ? Which color of the connector goes to VCC, GND, RX and TX ?

Thanks in advance and congrats for your awesome work !

Sébastien

ouinouin commented 1 month ago

@RaceX58 : i mseeking for it in my flying notes collection, and pictures , i ll post it here while found .

RaceX58 commented 1 month ago

@ouinouin Thank you ! I've already flashed an ESP32, imported your code and configured Home Assistant. It seems to work. Now it's time to connect it :-)

ouinouin commented 1 month ago

couldnt find anything on my computer now that shows something 100% clear, the yellow is the 12V and the black is the GND apparently , (but im not confident that the colors of the wires doesnt change. @RaceX58 do you mind posting a picture of the connector so i can cross check while home? fot the TX and RX, you ll have to give a try (not dangerous).

RaceX58 commented 1 month ago

couldnt find anything on my computer now that shows something 100% clear, the yellow is the 12V and the black is the GND apparently , (but im not confident that the colors of the wires doesnt change. @RaceX58 do you mind posting a picture of the connector so i can cross check while home? fot the TX and RX, you ll have to give a try (not dangerous).

Did you say 12V ?? Shouldn't it be 5V? I was planning to connect directly to the VIN pin of my ESP32. Not sure it can handled that much.

Yes no problem I'll take some pictures later today. I will check with a multimeter. For the RX/ TX no problem

RaceX58 commented 1 month ago

PXL_20240923_155145470 PXL_20240923_155159313

Hi again, There are some photos of the connector. I've tested it with a multimeter. Vcc is the yellow and gnd is the white. I've found 8V. I have to check if I can connect directly on the Vin of the esp32

RaceX58 commented 1 month ago

I'm looking at your code and it seems there's a little issue at line 364

StoreIfDifferent(TemperatureSetpointToACunit , TemperatureSetpointToACunit)

Shouldn't the second parameter be a string ?

ouinouin commented 1 month ago

@RaceX58 the Vin CANNOT be connected directly to the controller, on my unit its 12V , you have to place a small dc dc converter here the only pictures i have for now, not very informative , but can confirm on the small wires side, the red is +12V , blac is GND.

20221209_104849 20221209_104843 20240314_181430 20240314_180421 20240314_180406 20240314_180311 20240314_180305 20240314_180301 20240314_175623 20240314_175701 20240314_181433 20240427_015740 20240427_015726

20221209_104833

20221211_101620 20221212_134032 20221209_140448

20221212_134022 20221209_142903 20221209_114434 20221209_112522

ouinouin commented 1 month ago

I'm looking at your code and it seems there's a little issue at line 364

StoreIfDifferent(TemperatureSetpointToACunit , TemperatureSetpointToACunit)

Shouldn't the second parameter be a string ?

good catch , correcting it immediately.

RaceX58 commented 1 month ago

hey again.

I'm almost good. I can get all the values from the AC but I have a problem with the TemperatureSetpoint. You can see it's initializing at 20 then it always returns nil.

There are the logs. Do you have an idea of what can causes this problem ?

00:00:00.002 HDW: ESP32-D0WDQ6 v1.0 00:00:00.015 UFS: FlashFS mounted with 284 kB free 00:00:00.027 CFG: Loaded from File, Count 17 00:00:00.038 QPC: Count 1 00:00:00.070 BRY: Berry initialized, RAM used 3764 bytes 00:00:00.080 Project tasmota - Tasmota Version 14.2.0(release-tasmota32)-3_0_4(2024-08-14T12:39:45) 00:00:00.221 starting program : mqtt topics cmnd/climate-salon/ tele/climate-salon/ 00:00:00.236 persistance : setting a default temperature setpoint 00:00:00.237 persistance : retrieving TemperatureSetpointToACunit from tasmota flash 00:00:00.251 BRY: Successfully loaded 'autoexec.be' 00:00:02.000 WIF: Connecting to AP1 RaceX-Wifi-24 Channel 1 BSSId 6C:61:F4:02:02:B6 in mode HT20 as tasmota-969845-6213... 00:00:03.643 WIF: Connected 00:00:03.850 HTP: Web server active on tasmota-969845-6213 with IP address 192.168.1.77 19:11:45.856 MQT: Attempting connection... 19:11:46.495 MQT: Connected 19:11:46.499 MQT: tele/tasmota_969845/LWT = Online (retained) 19:11:46.503 MQT: cmnd/tasmota_969845/POWER = 19:11:46.511 MQT: tele/tasmota_969845/INFO1 = {"Info1":{"Module":"ESP32-DevKit","Version":"14.2.0(release-tasmota32)","FallbackTopic":"cmnd/DVES_969845_fb/","GroupTopic":"cmnd/tasmotas/"}} 19:11:46.527 MQT: tele/tasmota_969845/INFO2 = {"Info2":{"WebServerMode":"Admin","Hostname":"tasmota-969845-6213","IPAddress":"192.168.1.77","IP6Global":"","IP6Local":"fe80::b6e6:2dff:fe96:9845%st1"}} 19:11:46.542 MQT: tele/tasmota_969845/INFO3 = {"Info3":{"RestartReason":"Software reset CPU","BootCount":11}} 19:11:47.778 MQT: stat/tasmota_969845/STATUS1 = {"StatusPRM":{"Baudrate":115200,"SerialConfig":"8N1","GroupTopic":"tasmotas","OtaUrl":"http://ota.tasmota.com/tasmota32/release/tasmota32.bin","RestartReason":"Software reset CPU","Uptime":"0T00:00:06","StartupUTC":"2024-09-24T18:11:41","Sleep":50,"CfgHolder":4617,"BootCount":10,"BCResetTime":"2024-09-23T18:14:45","SaveCount":17}} 19:11:47.833 MQT: stat/tasmota_969845/STATUS11 = {"StatusSTS":{"Time":"2024-09-24T19:11:47","Uptime":"0T00:00:06","UptimeSec":6,"Heap":133,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":42,"MqttCount":1,"Berry":{"HeapUsed":18,"Objects":268},"Wifi":{"AP":1,"SSId":"RaceX-Wifi-24","BSSId":"6C:61:F4:02:02:B6","Channel":1,"Mode":"HT20","RSSI":74,"Signal":-63,"LinkCount":1,"Downtime":"0T00:00:03"}}} 19:11:48.988 QPC: Reset 19:11:49.977 MQT: tele/tasmota_969845/STATE = {"Time":"2024-09-24T19:11:49","Uptime":"0T00:00:08","UptimeSec":8,"Heap":133,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":23,"MqttCount":1,"Berry":{"HeapUsed":19,"Objects":304},"Wifi":{"AP":1,"SSId":"RaceX-Wifi-24","BSSId":"6C:61:F4:02:02:B6","Channel":1,"Mode":"HT20","RSSI":72,"Signal":-64,"LinkCount":1,"Downtime":"0T00:00:03"}} 19:12:01.020 function MQTTSubscribeDispatcher : message received from mqtt 19:12:01.022 function MQTTSubscribeDispatcher : actual ACmode = nil 19:12:01.033 function MQTTSubscribeDispatcher : actual FanSpeedSetpoint = nil 19:12:01.034 function MQTTSubscribeDispatcher : actual OscillationModeSetpoint = nil 19:12:01.046 function MQTTSubscribeDispatcher : actual TemperatureSetpoint = 20 19:12:01.047 function MQTTSubscribeDispatcher : received a temperature value from external thermometer : 23.5 19:12:01.059 function MQTTSubscribeDispatcher : Some of the variables are not yet received , escaping 19:12:17.415 function GetFrametype : valid message from AC unit : bytes('7A7AD521220000A30A0A190000114700400000000001640298444231313337302A3D') 19:12:17.427 function GetACmode : ACmodeString = off 19:12:17.429 function GetFanSpeed : FanModeString = low 19:12:17.430 function GetOscillationMode : OscillationModeString = off 19:12:17.442 function GetInternalTemperature : internal unit temperature: 25 19:12:17.444 function GetTemperatureSetpoint : TemperatureSetpoint retrieved from persistent memory : nil 19:12:17.455 recovered FanSpeedSetpoint : low 19:12:17.457 recovered OscillationModeSetpoint : off 19:12:17.468 no TemperatureSetpoint available, check persistance file value : nil 19:12:17.469 recovered ACmode : off 19:12:17.470 function PublishFeedback : got all needed value, publishing in mqtt topics 19:12:17.485 MQT: tele/climate-salon/mode/get = off 19:12:17.489 MQT: tele/climate-salon/fan/get = low 19:12:17.493 MQT: tele/climate-salon/swing/get = off 19:12:17.497 MQT: tele/climate-salon/Actualtemp/get = 25 19:12:17.501 MQT: tele/climate-salon/Actualsetpoint/get = nil 19:13:00.844 function MQTTSubscribeDispatcher : message received from mqtt 19:13:00.845 function MQTTSubscribeDispatcher : actual ACmode = off 19:13:00.857 function MQTTSubscribeDispatcher : actual FanSpeedSetpoint = low 19:13:00.858 function MQTTSubscribeDispatcher : actual OscillationModeSetpoint = off 19:13:00.871 function MQTTSubscribeDispatcher : actual TemperatureSetpoint = nil 19:13:00.873 function MQTTSubscribeDispatcher : received a temperature value from external thermometer : 23.5 19:13:00.886 function MQTTSubscribeDispatcher : Some of the variables are not yet received , escaping 19:13:17.359 function GetFrametype : valid message from AC unit : bytes('7A7AD521220000A30A0A190000114700400000000001640298444231313337302A3D') 19:13:17.372 function GetACmode : ACmodeString = off 19:13:17.374 function GetFanSpeed : FanModeString = low 19:13:17.377 function GetOscillationMode : OscillationModeString = off 19:13:17.379 function GetInternalTemperature : internal unit temperature: 25 19:13:17.392 function GetTemperatureSetpoint : TemperatureSetpoint retrieved from persistent memory : nil 19:13:17.404 no TemperatureSetpoint available, check persistance file value : nil 19:13:17.405 function PublishFeedback : got all needed value, publishing in mqtt topics 19:13:17.420 MQT: tele/climate-salon/mode/get = off 19:13:17.424 MQT: tele/climate-salon/fan/get = low 19:13:17.426 MQT: tele/climate-salon/swing/get = off 19:13:17.428 MQT: tele/climate-salon/Actualtemp/get = 25 19:13:17.430 MQT: tele/climate-salon/Actualsetpoint/get = nil 19:14:01.074 function MQTTSubscribeDispatcher : message received from mqtt 19:14:01.075 function MQTTSubscribeDispatcher : actual ACmode = off 19:14:01.077 function MQTTSubscribeDispatcher : actual FanSpeedSetpoint = low 19:14:01.089 function MQTTSubscribeDispatcher : actual OscillationModeSetpoint = off 19:14:01.101 function MQTTSubscribeDispatcher : actual TemperatureSetpoint = nil 19:14:01.103 function MQTTSubscribeDispatcher : received a temperature value from external thermometer : 23.5 19:14:01.116 function MQTTSubscribeDispatcher : Some of the variables are not yet received , escaping 19:14:17.392 function GetFrametype : valid message from AC unit : bytes('7A7AD521220000A30A0A190000114700400000000001640298444231313337302A3D') 19:14:17.406 function GetACmode : ACmodeString = off 19:14:17.408 function GetFanSpeed : FanModeString = low 19:14:17.410 function GetOscillationMode : OscillationModeString = off 19:14:17.423 function GetInternalTemperature : internal unit temperature: 25 19:14:17.425 function GetTemperatureSetpoint : TemperatureSetpoint retrieved from persistent memory : nil 19:14:17.437 no TemperatureSetpoint available, check persistance file value : nil 19:14:17.439 function PublishFeedback : got all needed value, publishing in mqtt topics 19:14:17.454 MQT: tele/climate-salon/mode/get = off 19:14:17.456 MQT: tele/climate-salon/fan/get = low 19:14:17.458 MQT: tele/climate-salon/swing/get = off 19:14:17.460 MQT: tele/climate-salon/Actualtemp/get = 25 19:14:17.472 MQT: tele/climate-salon/Actualsetpoint/get = nil 19:15:00.989 function MQTTSubscribeDispatcher : message received from mqtt 19:15:00.990 function MQTTSubscribeDispatcher : actual ACmode = off 19:15:01.001 function MQTTSubscribeDispatcher : actual FanSpeedSetpoint = low 19:15:01.003 function MQTTSubscribeDispatcher : actual OscillationModeSetpoint = off 19:15:01.014 function MQTTSubscribeDispatcher : actual TemperatureSetpoint = nil 19:15:01.016 function MQTTSubscribeDispatcher : received a temperature value from external thermometer : 23.5 19:15:01.028 function MQTTSubscribeDispatcher : Some of the variables are not yet received , escaping 19:15:17.466 function GetFrametype : valid message from AC unit : bytes('7A7AD521220000A30A0A190000114700400000000001640298444231313337302A3D') 19:15:17.479 function GetACmode : ACmodeString = off 19:15:17.481 function GetFanSpeed : FanModeString = low 19:15:17.483 function GetOscillationMode : OscillationModeString = off 19:15:17.495 function GetInternalTemperature : internal unit temperature: 25 19:15:17.497 function GetTemperatureSetpoint : TemperatureSetpoint retrieved from persistent memory : nil 19:15:17.509 no TemperatureSetpoint available, check persistance file value : nil 19:15:17.511 function PublishFeedback : got all needed value, publishing in mqtt topics 19:15:17.527 MQT: tele/climate-salon/mode/get = off 19:15:17.528 MQT: tele/climate-salon/fan/get = low 19:15:17.531 MQT: tele/climate-salon/swing/get = off 19:15:17.533 MQT: tele/climate-salon/Actualtemp/get = 25 19:15:17.545 MQT: tele/climate-salon/Actualsetpoint/get = nil 19:16:00.915 function MQTTSubscribeDispatcher : message received from mqtt 19:16:00.917 function MQTTSubscribeDispatcher : actual ACmode = off 19:16:00.918 function MQTTSubscribeDispatcher : actual FanSpeedSetpoint = low 19:16:00.930 function MQTTSubscribeDispatcher : actual OscillationModeSetpoint = off 19:16:00.942 function MQTTSubscribeDispatcher : actual TemperatureSetpoint = nil 19:16:00.944 function MQTTSubscribeDispatcher : received a temperature value from external thermometer : 23.5 19:16:00.957 function MQTTSubscribeDispatcher : Some of the variables are not yet received , escaping

RaceX58 commented 1 month ago

I've found it.

Had to replace

persist.TemperatureSetpoint = TemperatureSetpoint

by

persist.TempSetpoint = TemperatureSetpoint

ouinouin commented 1 month ago

@RaceX58 : thanks for correction, corrected and pushed it . feel free to open new issues for anything you find in the code (i m not a great coder, and i m half time veeeeery far from the unit so i tend to not touch this one so often in case i cant remotely recover a disaster :-) .

RaceX58 commented 1 month ago

@ouinouin I'll do. I've implemented the lcd backlight with success. I've also started to rewrite the script in pure Arduino.

I'm a C# developper. I'm far to be a good C developper. Also the bytes and bits give me headaches... My ultimate goal would be to be able to connect it to Tuya.

RaceX58 commented 1 month ago

Also I'd like to implement the fan "mute" mode (Silence in french)

tompointexe commented 1 month ago

My ultimate goal would be to be able to connect it to Tuya.

Why would you like to connect it to tuya ?? and not HomeAssistant or another local smart home app, wich is the goal of this app

RaceX58 commented 1 month ago

My family have some Airton climate and I would like them to be able to control using a simple app. If I start to tell them about HA or other domotic servers they would call me crazy...

tompointexe commented 1 month ago

Haha fair enough, personaly i managed to get everyone to use homeassistant with simple dashboards ;)

ouinouin commented 1 month ago

@RaceX58 i dont feel connecting to tuya is a good thing, this is really bad to let everybody enter our homes. For me , something nice would be to have a small webinterface over tasmota with all the controls. an intermediate thing can also be to interact with the excellent android opensource app http shortcuts. i hop that there will soon be some interrest towards integration of wireguard on tasmota as it was done on esphome, this could open opportunities for remote control (fixed ip address problem remains unfortunately.) with ouar association, we have a small group having reflexion to build some iot services in a open and transparent way , but we ra far from a solution yet, the problem effectively is that requiring to have hardware in the house is boring for most people. unfortunately, we all have powerful internet boxe without any access, and there is no obligation even to provide full stack IPV6 yet and to provide a domain for free with any internet subscription + automatic dynamic dns on operators boxes.

RaceX58 commented 1 month ago

@ouinouin I get your point. The web interface is an idea I also had. The problem of static IP and blocked firewall still remains. That's why I tought about trying to link it to Tuya. I will problably end using my own Home Assistant to manage my family AC units. It's still not clear for me.

Back to the code, can you tell me what means stepless ? I haven't tried it yet

ouinouin commented 1 month ago

Stepless is a functionality of the fans apprently with the remote control you chan change the fan speed percent by percent. so entering the stepless mode is not enough , you have to know where the steps are encoded, but honestly this function has low value, since there ares already enough selectable speeds to overcharge a UI.

RaceX58 commented 1 month ago

Stepless is a functionality of the fans apprently with the remote control you chan change the fan speed percent by percent. so entering the stepless mode is not enough , you have to know where the steps are encoded, but honestly this function has low value, since there ares already enough selectable speeds to overcharge a UI.

Okay that's not what I'm looking for. I'm looking for the mute option. I'm able to set on my official Wifi module using HomeAssistant but not using SmartLife.

ouinouin commented 1 month ago

@RaceX58 i didnt see any control that can toggle off the buzzer, for me its hardwired to te main controller of the unit, the only volume control was sticking a screw in the buzzer

RaceX58 commented 1 month ago

@RaceX58 i didnt see any control that can toggle off the buzzer, for me its hardwired to te main controller of the unit, the only volume control was sticking a screw in the buzzer

I was not talking about the buzzer (I've removed it physically lol). I'm talking about the fan speed called "Silence" in french. This mode is lower that low.

fan_speed_silent

ouinouin commented 1 month ago

@RaceX58 its most likely the lowest possible speed , i dont know if its a special mode, or if its just the mode with the first bit to 1.

RaceX58 commented 1 month ago

@ouinouin I can't seem to be able to get the correct frame using an Arduino script. I always get 39 or 64 bytes. I've tried many things but never been able to get a correct 34 bytes frame. DO you have an idea what could cause this problem ?

Here is an example (int values formatted with '-')

122-122-209-33-13-0-0-164-10-10-0-37-37-122-122-209-33-13-0-0-164-10-10-0-37-37-122-122-209-33-13-0-0-164-10-10-0-37-37- buffer filled with 39 bytes 122-122-209-33-13-0-0-164-10-10-0-37-37-122-122-209-33-13-0-0-164-10-10-0-37-37-122-122-213-33-34-0-0-163-10-10-23-5-0-0-1-0-8-0-0-0-0-0-100-2-159-68-66-49-49-51-55-48-189-120-122-122-213-33- buffer filled with 64 bytes

ouinouin commented 3 weeks ago

@RaceX58 maybe the framerate /stop bits ? , ca you convert your sequence to hex ( i m lazy to format your output) , to see if the frame looks like the same ? , but 122 is 7A in hex, so it looks like a framestart. the problem being how the library you are using ins behaving , when does it fills the buffer etc etc, i dont know enough about arduino, but sure you ll have to know what is the method of your library to fill its buffer and to signal you there is something in the buffer, since in serial the challenge is always to detect the start of a message .

marcoLPT commented 2 weeks ago

Be careful , i wiring TTL direct to the TX RX and after 10mn the RX TX stop to work.. next update lever shifter for communication.