straga / scrivo_project

Scrivo - Helper for development for -Micropython/Python
12 stars 2 forks source link

Please help ) How to build your project with my config? #1

Open polsup2 opened 1 year ago

polsup2 commented 1 year ago

Cool implementation to control Hisense AC via modbus and mqtt. I'm not yet familiar with mycropython and have basic skills with esp32. I've checked modbus communications with AC using VS and c# on windows and usb-rs485 dongle. Everything works!

Now i'm trying to flash esp32 with your project. Can't find, how to reconfigure and rebuild it correctly with my config. I've flashed .bin files. But can't understand what to do after flashing.

Only for personal use. I've 6 Hisense internal units. Already attached them to HomeAssistant using IR. But your way to communicate is much more cooler!

straga commented 1 year ago

How is progress ?

polsup2 commented 1 year ago

Thanks to your great work, source code and comments in other github threads, i was able to understand protocol used by hisense. As I wrote above, i'm not familiar enough with advanced ESP programming and micropython. Also I found, that ESP32 hardware, that I have, are without PSRAM. My ESP's are simple "esp32 wroom" devboards.

So i've tried to rewrite your implementation using ESPHome and basic c++ knowledges.

image

Code itself looks like this:

image

image

Getting and setting values:

image

ESPhome logs looks like this:

image

And the result is sucessful:

image

image

But i've bought pair of ESPs with PSRAM and will try to deploy your project again. Just to understand how it works :) Please give me advice, which tool should i use to deploy you project to ESP's PSRAM?

Thank you for the great work and sharing it here! Thanks to your experience it becomes possible for me to connect my hisenses:)

straga commented 1 year ago

Nice !!!

1iverea9er commented 1 year ago

@polsup2 Hi. A good idea to implement on ESPHome!!! Can you share full code???

I use simple esp32 without PSRAM

image

And jast flash it through cmd.exe + esptool.py from scrivo_project-master\firmware\core_flash4mb_espnow: python -m esptool -p COM_PORT -b 460800 --before default_reset --after hard_reset --chip esp32 write_flash --flash_mode dio --flash_size detect --flash_freq 40m 0x1000 bootloader.bin 0x10000 partition-table.bin 0x15000 ota_data_initial.bin 0x20000 micropython.bin

After overwriting boot.py with the contents of scrivo_project-master\project\ac_xm_hisense_control\board_core using Thonny with my config json's. And, it jast work.

1iverea9er commented 1 year ago

@polsup2 What doing your code ?:

tempX = (c << 1);
tempX |= (1ul << 0);

if c=16deg. then tempX = 33, bat in bitarray it mast be 21 (I take it by reverse ingeneering).

I dont understand how temperature converts to hex: 16(C)<->21(hex) 24(C)<->33(hex) 25(C)<->31(hex) 32(C)<->41(hex)

polsup2 commented 1 year ago

@1iverea9er , don't waste your time. Get a share of sources.

In share you will find: ver1 of esphome implementation ver 2 of esphome implementation stl models to print boxes for different version of esp devkits for sbs plastic

image

link: https://syn.polsup.keenetic.pro/d/s/tdCAzZN1xpf4bW2ogWAG2Y2p7RXs68A6/c-E-hri6Wkj_7yJnDea5psRjL8GOIIrd-vL8gr8uLcwo

V.1 Stable Implementation Issues:

Commands could be written only 1 at a time. Refresh cycle: 2 seconds

HA Automation looks like this. Pay attention to delay:

alias: Охлаждение хозспальня description: Автоматизация охлаждения мастер-спальня trigger:

V.2 Implementation issues:

Commands could be written in a package simultaneously. Cycle 1.8 seconds.

TODO Repair current issues, due to writing 2 and more commands in 1 byte: Add appropriate bitmasks while writing to 1 byte to appropriate combine commands!

Impossible to set simultaneously in one package up-down & left-right! byte - 32 Impossible to set simultaneously in one package ac power & ac mode byte - 18 Impossible to set simultaneously in one package turbo & eco - byte 33

TODO Check additional bytes, which could contain 2 or more commands.

What doing your code ?:

As i remember, while reverse enginered hisense protocol from straga's sources, i've found, that for writing values to AC we need to shift one bit left in a byte and add value "1" as delimiter. That is why you get in DEC strange values. While reading, there is no such delimeter and you can read directly BIN to DEC.

1iverea9er commented 1 year ago

@polsup2 Thank you very much!!!! If you want to try the option with micropython + MQTT, then I will share a more or less working HA configuration.

There are also problems with sending multiple commands at the same time or with a small time interval

1iverea9er commented 1 year ago

With template climate Here is:

climate entity:

climate:
  - platform: climate_template
    name: Livingroom Aircon
    modes:
      - "off"
      - "auto"
      - "cool"
      - "dry"
      - "fan_only"
      - "heat"
    fan_modes:
      - "auto"
      - "quiet"
      - "lower"
      - "low"
      - "medium"
      - "high"
      - "higher"
    swing_modes:
      - "horizontal"
      - "vertical"
      - "both"
      - "off"
    min_temp: 16
    max_temp: 30
    current_temperature_template: "{{ states('sensor.ac_lr_temperature') }}"
    target_temperature_template: "{{ states('number.ac_lr_temperature_set') }}"
    current_humidity_template: "{{ states('sensor.th_lr_humidity') }}"
    fan_mode_template: >
      {% if is_state('switch.ac_lr_mute', 'on') %}
        {{ 'quiet' }}
      {% elif is_state('select.ac_lr_fan_mode', 'off') %}
        {{ state_attr('climate.livingroom_aircon','fan_mode') }}
      {% else %}
        {{ states('select.ac_lr_fan_mode') }}
      {% endif %}
    swing_mode_template: >
      {% if is_state('switch.ac_lr_up_down', 'on') and is_state('switch.ac_lr_left_right', 'on') %}
        {{ 'both' }}
      {% elif is_state('switch.ac_lr_up_down', 'on') %}
        {{ 'vertical' }}
      {% elif is_state('switch.ac_lr_left_right', 'on') %}
        {{ 'horizontal' }}
      {% else %}
        {{ 'off' }}
      {% endif %}
    hvac_mode_template: >
      {% if is_state('switch.ac_lr', 'off') %}
        {{ 'off' }}
      {% elif is_state('input_select.lr_ac_mode', 'auto') %}
        {{ 'auto' }}
      {% else %}
        {{ states('select.ac_lr_hvac_mode') }}
      {% endif %}
    hvac_action_template: >
      {% if is_state('switch.ac_lr', 'off') %}
        {{ 'off' }}
      {% elif is_state('select.ac_lr_fan_mode', 'off') %}
        {{ 'idle' }}
      {% elif is_state('select.ac_lr_hvac_mode', 'cool') %}
        {{ 'cooling' }}
      {% elif is_state('select.ac_lr_hvac_mode', 'dry') %}
        {{ 'drying' }}
      {% elif is_state('select.ac_lr_hvac_mode', 'fan_only') %}
        {{ 'fan' }}
      {% elif is_state('select.ac_lr_hvac_mode', 'heat') %}
        {{ 'heating' }}
      {% endif %}
    availability_template: >
        {{ is_state('switch.ac_lr', 'on') or is_state('switch.ac_lr', 'off') }}
    set_hvac_mode:
      - choose:
          # IF AC turn OFF
          - conditions:
              - condition: template
                value_template: "{{ hvac_mode == 'off' and is_state('switch.ac_lr', 'on') }}"
            sequence:
                - service: switch.turn_off
                  target:
                    entity_id: switch.ac_lr
          # ELIF AC turn ON
          - conditions:
              - condition: template
                value_template: "{{ hvac_mode != 'off' and is_state('switch.ac_lr', 'off') }}"
            sequence:
                - service: switch.turn_on
                  target:
                    entity_id: switch.ac_lr
                - wait_template: "{{ is_state('switch.ac_lr', 'on') }}"
                  timeout: "00:00:30"
                  continue_on_timeout: false
      - choose:
          # IF AC mode change
          - conditions:
              - condition: template
                value_template: >
                  {{ (hvac_mode == 'cool' or hvac_mode == 'dry' or 
                      hvac_mode == 'fan_only' or hvac_mode == 'heat') and
                      hvac_mode != states('select.ac_lr_hvac_mode') and 
                      is_state('switch.ac_lr', 'on') }}
            sequence:
              - service: select.select_option
                target:
                  entity_id: select.ac_lr_hvac_mode
                data:
                  option: "{{ hvac_mode }}"
      - choose:
          # IF AC mode change
          - conditions:
              - condition: template
                value_template: >
                  {{ (hvac_mode == 'cool' or hvac_mode == 'dry' or 
                      hvac_mode == 'fan_only' or hvac_mode == 'heat') and
                      hvac_mode != states('input_select.lr_ac_mode') and 
                      is_state('switch.ac_lr', 'on') }}
            sequence:
              - service: input_select.select_option
                target:
                  entity_id: input_select.lr_ac_mode
                data:
                  option: "{{ hvac_mode }}"
    set_fan_mode:
      - choose:
          # IF AC quiet mode ON
          - conditions:
              - condition: template
                value_template: >
                  {{ is_state('switch.ac_lr', 'on') and 
                      fan_mode == 'quiet' and is_state('switch.ac_lr_mute', 'off') }}
            sequence:
                - service: switch.turn_on
                  target:
                    entity_id: switch.ac_lr_mute
          # ELIF AC quiet mode OFF
          - conditions:
              - condition: template
                value_template: >
                  {{ is_state('switch.ac_lr', 'on') and 
                      fan_mode != 'quiet' and is_state('switch.ac_lr_mute', 'on') }}
            sequence:
                - service: switch.turn_off
                  target:
                    entity_id: switch.ac_lr_mute
                - wait_template: "{{ is_state('switch.ac_lr_mute', 'off') }}"
                  timeout: "00:00:30"
                  continue_on_timeout: false
      - choose:
          # IF AC fan mode change
          - conditions:
              - condition: template
                value_template: >
                  {{ (fan_mode == 'auto' or fan_mode == 'lower' or 
                    fan_mode == 'low' or fan_mode == 'medium' or 
                    fan_mode == 'high' or fan_mode == 'higher') and
                      fan_mode != states('select.ac_lr_fan_mode') and 
                      is_state('switch.ac_lr', 'on') }}
            sequence:
              - service: select.select_option
                target:
                  entity_id: select.ac_lr_fan_mode
                data:
                  option: "{{ fan_mode }}"
    set_swing_mode:
      - choose:
          # IF AC vertical swing ON
          - conditions:
              - condition: template
                value_template: >
                  {{ swing_mode == 'both' or swing_mode == 'vertical' 
                      and is_state('switch.ac_lr_up_down', 'off') and 
                      is_state('switch.ac_lr', 'on') }}
            sequence:
                - service: switch.turn_on
                  target:
                    entity_id: switch.ac_lr_up_down
                - wait_template: "{{ is_state('switch.ac_lr_up_down', 'on') }}"
                  timeout: "00:00:30"
                  continue_on_timeout: false
          # IF AC vertical swing OFF
          - conditions:
              - condition: template
                value_template: >
                  {{ swing_mode != 'both' or swing_mode != 'vertical' 
                      and is_state('switch.ac_lr_up_down', 'on') and 
                      is_state('switch.ac_lr', 'on') }}
            sequence:
                - service: switch.turn_off
                  target:
                    entity_id: switch.ac_lr_up_down
                - wait_template: "{{ is_state('switch.ac_lr_up_down', 'off') }}"
                  timeout: "00:00:30"
                  continue_on_timeout: false
      - choose:
          # IF AC horizontal swing ON
          - conditions:
              - condition: template
                value_template: >
                  {{ swing_mode == 'both' or swing_mode == 'horizontal' 
                      and is_state('switch.ac_lr_left_right', 'off') and 
                      is_state('switch.ac_lr', 'on') }}
            sequence:
                - service: switch.turn_on
                  target:
                    entity_id: switch.ac_lr_left_right
          # IF AC horizontal swing OFF
          - conditions:
              - condition: template
                value_template: >
                  {{ swing_mode != 'both' or swing_mode != 'horizontal' 
                      and is_state('switch.ac_lr_left_right', 'on') and 
                      is_state('switch.ac_lr', 'on') }}
            sequence:
                - service: switch.turn_off
                  target:
                    entity_id: switch.ac_lr_left_right
    set_temperature:
      - choose:
          # IF temp set != {{ temperature }}
          - conditions:
              - condition: template
                value_template: >
                  {{ (states('select.ac_lr_hvac_mode') == 'cool' or 
                      states('select.ac_lr_hvac_mode') == 'heat') and
                      is_state('switch.ac_lr', 'on')  and 
                      temperature != states('number.ac_lr_temperature_set') }}
            sequence:
              - service: number.set_value
                target:
                    entity_id: number.ac_lr_temperature_set
                data:
                    value: "{{ temperature }}"
1iverea9er commented 1 year ago

And MQTT and other entities:

input_select:
  lr_ac_mode:
    name: Режим AC LR
    options:
      - "off"
      - "auto"
      - "cool"
      - "dry"
      - "fan_only"
      - "heat"
    initial: "off"
    icon: mdi:fan

mqtt:
  sensor:
    - name: "AC LR Temperature"
      state_topic: "dev/ac_hisense_lr/event/ac_status/indoor_temperature_status/value"
      suggested_display_precision: 1
      unit_of_measurement: "°C"
    - name: "AC LR Pipe Temperature"
      state_topic: "dev/ac_hisense_lr/event/ac_status/indoor_pipe_temperature/value"
      suggested_display_precision: 1
      unit_of_measurement: "°C"
    - name: "AC LR Temperature Compensation"
      state_topic: "dev/ac_hisense_lr/event/ac_status/temperature_compensation/value"
      suggested_display_precision: 1
      unit_of_measurement: "°C"
    - name: "AC LR Outdoor Temperature"
      state_topic: "dev/ac_hisense_lr/event/ac_status/outdoor_temperature/value"
      suggested_display_precision: 1
      unit_of_measurement: "°C"
    - name: "AC LR Outdoor Condenser Temperature"
      state_topic: "dev/ac_hisense_lr/event/ac_status/outdoor_condenser_temperature/value"
      suggested_display_precision: 1
      unit_of_measurement: "°C"
    - name: "AC LR Compressor Exhaust Temperature"
      state_topic: "dev/ac_hisense_lr/event/ac_status/compressor_exhaust_temperature/value"
      suggested_display_precision: 1
      unit_of_measurement: "°C"

  switch:
      - command_topic: "dev/ac_hisense_lr/cmd/ac_control/run_status"
        state_topic: "dev/ac_hisense_lr/event/ac_status/run_status/value"
        name: "AC LR"
        optimistic: false
        payload_on: "on"
        payload_off: "off"
        state_on: "on"
        state_off: "off"

      - command_topic: "dev/ac_hisense_lr/cmd/ac_control/up_down"
        state_topic: "dev/ac_hisense_lr/event/ac_status/up_down/value"
        name: "AC LR Up Down"
        optimistic: false
        payload_on: "on"
        payload_off: "off"
        state_on: "on"
        state_off: "off"

      - command_topic: "dev/ac_hisense_lr/cmd/ac_control/left_right"
        state_topic: "dev/ac_hisense_lr/event/ac_status/left_right/value"
        name: "AC LR Left Right"
        optimistic: false
        payload_on: "on"
        payload_off: "off"
        state_on: "on"
        state_off: "off"

      - command_topic: "dev/ac_hisense_lr/cmd/ac_control/turbo"
        name: "AC LR Turbo"
        optimistic: false
        payload_on: "on"
        payload_off: "off"
        state_on: "on"
        state_off: "off"

      - command_topic: "dev/ac_hisense_lr/cmd/ac_control/quiet"
        state_topic: "dev/ac_hisense_lr/event/ac_status/mute/value"
        name: "AC LR Mute"
        optimistic: false
        payload_on: "on"
        payload_off: "off"
        state_on: "on"
        state_off: "off"

      - command_topic: "dev/ac_hisense_lr/cmd/ac_control/back_led"
        state_topic: "dev/ac_hisense_lr/event/ac_status/back_led/value"
        name: "AC LR LED"
        optimistic: false
        payload_on: "on"
        payload_off: "off"
        state_on: "on"
        state_off: "off"

      - command_topic: "dev/ac_hisense_lr/cmd/ac_control/low_electricity"
        state_topic: "dev/ac_hisense_lr/event/ac_status/low_electricity/value"
        name: "AC LR Economy"
        optimistic: false
        payload_on: "on"
        payload_off: "off"
        state_on: "on"
        state_off: "off"

  select:
      - command_topic: "dev/ac_hisense_lr/cmd/ac_control/wind_status"
        state_topic: "dev/ac_hisense_lr/event/ac_status/wind_status/value"
        name: "AC LR Fan mode"
        options:
          - "off"
          - "auto"
          - "lower"
          - "low"
          - "medium"
          - "high"
          - "higher"
          - "2"

      - command_topic: "dev/ac_hisense_lr/cmd/ac_control/mode_status"
        state_topic: "dev/ac_hisense_lr/event/ac_status/mode_status/value"
        name: "AC LR HVAC Mode"
        options:
          - "cool"
          - "dry"
          - "fan_only"
          - "heat"

  number:
    - command_topic: "dev/ac_hisense_lr/cmd/ac_control/temp_in"
      state_topic: "dev/ac_hisense_lr/event/ac_status/indoor_temperature_setting/value"
      name: "AC LR Temperature Set"
      unit_of_measurement: "°C"
      min: 16
      max: 30
noname-ever commented 11 months ago

Hello, @polsup2 !

Can you by any chance share how you managed to control Hisense AC without WIFI module using ESPHome?

BenJamesAndo commented 8 months ago

link: https://syn.polsup.keenetic.pro/d/s/tdCAzZN1xpf4bW2ogWAG2Y2p7RXs68A6/c-E-hri6Wkj_7yJnDea5psRjL8GOIIrd-vL8gr8uLcwo

This link has expired. @polsup2 are you able to provide a new link?

I've been trying to control my Hisense AC and just stumbled across this discussion. I've also been trying to control it based on the code discussed at https://community.home-assistant.io/t/aircon-international-hisense-mini-split-control/551716 I did get it to work, but the response codes are designed for a different type of AC. The ESPHome code discussed here seems really promising.

polsup2 commented 8 months ago

@BenJamesAndo , on vacation now. Will refresh the link this week.

I modified the solution, so it currently support accumulation of commands to AC and execute them in one package. It works now like ir does. iR always sends package of parameters to AC. You need to do the same from HA in automations.

You can for sure send only one parameter, but in some cases you will find, that AC will initialize some attributes with defaults. For example in case of changing mode from Cool to Heat.

So you need to send the mode and some additional parameters like temperature, wind and some others simultaneously. The window for parameters grouping is 1,5sec. It uses sliding expiration.

In latest versions of ESPHome it starts to send of warning long cycle execution on ESP (0.9 sec in case of something changes). So there still lot of points to be optimized.

I'm using the solution for almost 1 year, everything works as expected on 6 hisense AC units

BenJamesAndo commented 8 months ago

Sounds great. I'm looking forward to the new link. Enjoy your vacation!

My Hisense was recently installed and it came with the newer AEH-W4G2 Wifi controller which uses the ConnectLife app. It's got a cloud-only API. It wasn't super reliable so I bought the older model AEH-W4E1 but it's also not been super reliable. Interestingly though the AEH-W4G2 has an option to mute the buzzer. I quite like it as it allows me to change the AC without it going beep. The older AEH-W4E1 does not have such an option. I'm curious about learning how to capture the serial data it's sending out to see how it communicates commands without the buzzer. My remote doesn't have that option so it seems my only option would be to wire directly into the AEH-W4G2. Although I've been unsuccessfully at powering it up. Anyway, lots of exciting ways to improve all of this.

polsup2 commented 8 months ago

has an option to mute the buzzer

I think there is no such option :) I added small solid relay and just breaking the buzzer circuit, when i don't need "beeps".

I'm curious about learning how to capture the serial data it's sending out

You will get the answers in "uart debug" function in ESPHome. So did I to parse the feedback provided.

BenJamesAndo commented 7 months ago

@polsup2 any chance of refreshing that link soon? It still says expired.

I've used "uart debug" a little bit. But I would have to plug a UART debugger directly into the AEH-W4G2 as it would be a special no buzzer command that gets issued.

Screenshot_20240410-125701

That's a great idea with the solid relay to stop the buzzer circuit.

polsup2 commented 7 months ago

@polsup2 any chance of refreshing that link soon? It still says expired.

@BenJamesAndo,

Here you'll find updated link to project. The latest version is Version3 in folder.

BenJamesAndo commented 7 months ago

Thank you @polsup2. I'm able to control some aspects of my Hisense. The response readings aren't working properly though. I'm beginning to wonder if it's my particular AC or the ESP32 as uart_debug returns some different values than what you specified in the code. Or maybe the values are correct but the Reading lock is interfering?

It regularly says [11:21:45][D][READ SKIP:113]: Reading lock enabled. Skipping AC state reading.. I'll omit these from the logs below.

[11:23:18][D][uart_debug:114]: <<< 77 7B FF BF FF FF 77 77 F7 37 FF 77 FF 3F F7 F7 7F D9 F7 FF FF 33 FF BB FF F3 EF 37 77 FF F7 7F FF FF BF FF 7F FF FD 77 FF FF BF 77 FF 7F FD 77 FD 77 FF FF FF 77 73 FF 7B DB BF FF BF FD DD 77 F7 FF FD FF F7 FF FF 7B 3F 7F 7F 33 DD F3 77 FF F3 77 77 F7 B3 73 FF F7 FF DD FB F3 37 FD 77 FF FF 37 FF FF FF FF BF F7 77 7F 33 FF 77 77 BF FF 7F 3F FF FD FF FF F3 FF
[11:23:18][W][component:232]: Component uart took a long time for an operation (52 ms).
[11:23:18][W][component:233]: Components should block for at most 30 ms.
[11:23:20][D][uart_debug:114]: <<< FB 9D F3 FF FF 7B F7 DD B7 7F B3 FF FF 77 FF 7F FF F7 33 F7 FF FF B7 FF 7F B3 FF F7 B3 FF EE 33 FF F7 F7 F7 F7 77 FB 3F FF 33 FF FF FF B7 FF 37 F9 FF 7F 77 FF 3F 73 F3 7F FF FF FF FF FF 77 FF FF 37 F7 77 FD 3B FD DF 77 FF B7 FF FF 7F FF 7F 77 DD FF FF FF DD 37 77 F3 73 B3 FF FF FF FF 73 77 FF FF 77 FF FF FB 77 FF DD FF 77 FF FF FF FF 77 FF B3 FF 77 77 7B F7
[11:23:22][D][uart_debug:114]: <<< B3 FF DD FF FF FF BB FF FF FF F7 F3 FF FF 77 77 FF BF 7F FF FF B3 7F 7F FF 77 33 F9 FE 7F FE FF FF 37 FF FF B3 BB FF DD FF F7 3B 77 7F DF 76 FF FF 7F FF FB F7 7F 7F FF 7F D3 FF FF DF FF FB 77 FF DD FF F7 3B FF FF FF FF FF DF F7 BB FE 7F FF FB FF F3 7F 37 FF FF DD 37 BF FF F7 FF FF FF FF FF 33 FF 3B DD 7F B3 77 B3 7F FF BF FF F3 FF 77 FF 77 BB FF 93 DF DD FF
[11:25:53][D][button:010]: 'Test ON' Pressed.
[11:25:53][D][uart_debug:114]: <<< FF
[11:25:53][D][uart_debug:114]: >>> F4 F5 00 40 29 00 00 01 01 FE 01 00 00 65 00 00 00 00 0C 00 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 DF F4 FB
[11:25:53][D][uart_debug:114]: >>> F4 F5 00 40 29 00 00 01 01 FE 01 00 00 65 00 00 00 00 0C 00 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 DF F4 FB
[11:25:53][W][component:232]: Component web_server took a long time for an operation (67 ms).
[11:25:53][W][component:233]: Components should block for at most 30 ms.
[11:25:53][D][uart_debug:114]: <<< F4 F5 00 40 29 00 00 01 01 FE 01 00 00 65 00 00 00 00 0C 00 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 DF F4 FB
[11:25:53][D][uart_debug:114]: <<< F4 F5 00 40 29 00 00 01 01 FE 01 00 00 65 00 00 00 00 0C 00 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 DF F4 FB
[11:25:53][D][uart_debug:114]: <<< FF 41 41 7F 09 FD FF 03 7F 7F 7F 7F 35 FF FD FF FF EF CF CD D5 FF FE FD FD FF FF FF FF FF FF FF FF FF FF FF F5 FF FF FF FF FF C9 CD B5 FF FF FF 33 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F7 8D 41 E0 FF FF FF FF FF FF
[11:25:54][D][uart_debug:114]: <<< FF FF FF
[11:25:54][D][uart_debug:114]: <<< FF

Most of the statuses are either NA or OFF and never change. No statuses update regardless of if I use the remote, ESPHome controls or Test buttons.

1iverea9er commented 7 months ago

@BenJamesAndo Hi If you have done everything right and still no response from AC I would do reverse engineering if I were you. You can connect AEH-W4G2 directly to the Uart (TTL) converter and read the commands that AEH-W4G2 sends to AC. The same can be done for AC responses. However, the @polsup2 code needs to be shortened to get a pure UART response (without processing). Next, it is necessary to decipher the AC commands and responses according to the protocol.

I've used "uart debug" a little bit. But I would have to plug a UART debugger directly into the AEH-W4G2 as it would be a special no buzzer command that gets issued.

I did the same thing with the AEH-W4G1. Unfortunately the special no buzzer command is sent in "silent" mode (nothing comes to the UART in this case)

polsup2 commented 7 months ago

Reading lock

I think that Reading lock occurs because of some unhandled exceptions caused by unexpected response from AC.

As @1iverea9er said , you should clean or comment response processing and you will get the " uart debugger".

So you could step by step find values to parse from response.

For me during parsing were very helpful Straga's sources and playing with IR remote changing 1 variable per iteration. Maybe you will be able to find some description in Google or reverse-engineer w4g2 commands

straga commented 7 months ago

next week, I will some check.

вт, 16 апр. 2024 г., 01:30 Ben @.***>:

@polsup2 https://github.com/polsup2 any chance of refreshing that link soon? It still says expired.

I've used "uart debug" a little bit. But I would have to plug a UART debugger directly into the AEH-W4G2 as it would be a special no buzzer command that gets issued.

Screenshot_20240410-125701.jpg (view on web) https://github.com/straga/scrivo_project/assets/44917135/880ffeaf-3620-4f77-b520-09c7a8a8040a

That's a great idea with the solid relay to stop the buzzer circuit.

— Reply to this email directly, view it on GitHub https://github.com/straga/scrivo_project/issues/1#issuecomment-2057918307, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAINZE2RTM4EA5ZWQ4425DY5RIGXAVCNFSM6AAAAAAUCUEJDCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJXHEYTQMZQG4 . You are receiving this because you commented.Message ID: @.***>

eae3001 commented 7 months ago

Here you'll find updated link to project. The latest version is Version3 in folder.

@polsup2, Hi, Can You update this link?

BenJamesAndo commented 7 months ago

@eae3001 I'm sure the link will get refreshed soon. I was gonna give you my copy of the download but unfortunately I can't locate it. I can provide my current ESPHome config based on the download if that helps. hisense.zip

Thanks as well to everyone that has helped me so far. I don't have any updates to share but I do feel more confident that I could decipher more of the serial codes someday.

polsup2 commented 7 months ago

@eae3001 , link updated.

straga commented 6 months ago

I am update code. Now just copy to board file. Add Mqtt autodiscovery for homeassistant. Also mode: will be

BenJamesAndo commented 6 months ago

@straga I can't figure out how to run this. I'm using Thonny to load in the files. Do I upload all the contents from the root folder into the root of the ESP32? Do I also upload the boot.py & boot_cg.py ? I've modified the secrets file and tried to run main.py and this is what I get

MPY: soft reboot
Rollback: (-261, 'ESP_ERR_NOT_FOUND')
sys path: [Errno 2] ENOENT
Import Safe
Hostname: Init
Hostname: g12.hisense
STA: Init
scan: (b'TP-LINK_9E35', b'\xa8^E\x98&\xe8', 8, -53, 3, False)
scan: (b'IoT', b'\xa8^E\x98&\xe9', 8, -53, 4, False)
scan: (b'Optus_B628_E04F', b'\xa2\x908O\xe0\xb7', 6, -85, 7, False)
scan: (b'NOKIA-1F6A', b'8\xa0g\xb2\x1fs', 11, -87, 7, False)
scan: (b'TelstraA5D7B9', b'\xf8\xab\x05\xa5\xd7\xbf', 2, -88, 3, False)
scan: (b'Solar-WiFi19AW3585', b'\x98\xd8c\x901\xb9', 3, -90, 3, False)
scan: (b'WiFi-E8ZX8', b'\xd83\xb7\x15\xb6\x86', 11, -90, 7, False)
scan: (b'TelstraE1921E', b'\xbc0\xd9\xe1\x92 ', 13, -93, 3, False)
scan: (b'', b'\x04\x17\xb6"5\xff', 12, -94, 4, False)
STA: ('0.0.0.0', '0.0.0.0', '0.0.0.0', '0.0.0.0')
STA running on channel: 1
FTP: Init
FTP server started on 0.0.0.0:21
Telnet: Init
Telnet server started on 0.0.0.0:23

__main__fe: 1
File System Size 2,097,152 - Free Space 1,613,824
Create Event Tasks
Start Event Loop in thread: NonBlock Repl
Main: Done
> 

Part Name: /
INFO:MBUS:START
CORE: init
Parse Config: board.yml

INFO:CORE:Load: board
INFO:CORE:  Module: board - Sub: None
ERROR:CORE:  Mod Runner: no module named 'scrivo_board'

INFO:CORE:Load: pin
INFO:CORE:  Module: pin - Sub: None
ERROR:CORE:  Mod Runner: no module named 'scrivo_pin'

INFO:CORE:Load: led-status
INFO:CORE:  Module: led-status - Sub: None
ERROR:CORE:  Mod Runner: no module named 'scrivo_led-status'

INFO:CORE:Load: wifi_runner
INFO:CORE:  Module: wifi - Sub: runner
ERROR:CORE:  Mod Runner: no module named 'scrivo_wifi'

INFO:CORE:  Wrong secret: - ssid: !secret home_ssid
INFO:CORE:  Wrong secret: password: !secret home_password

INFO:CORE:Load: wifi_networks
INFO:CORE:  Module: wifi - Sub: networks
ERROR:CORE:  Mod Runner: no module named 'scrivo_wifi'

INFO:CORE:Load: mqtt
INFO:CORE:  Module: mqtt - Sub: None
ERROR:CORE:  Mod Runner: no module named 'scrivo_mqtt'

INFO:CORE:Load: acxm
INFO:CORE:  Module: acxm - Sub: None
ERROR:CORE:  Mod Runner: no module named 'scrivo_acxm'

INFO:CORE:Load: telemetry
INFO:CORE:  Module: telemetry - Sub: None
ERROR:CORE:  Mod Runner: no module named 'scrivo_telemetry'

image

straga commented 6 months ago

What is inside in the module folder ?

straga commented 6 months ago

image

DimaVins89 commented 6 months ago

@polsup2 any chance of refreshing that link soon? It still says expired.

@BenJamesAndo,

Here you'll find updated link to project. The latest version is Version3 in folder.

Thank you for your hard work, could you post the latest version? your link is not working.

DimaVins89 commented 6 months ago

Спасибо @polsup2. Я могу контролировать некоторые аспекты моего Hisense. Однако показания ответов работают неправильно. Я начинаю задаваться вопросом, это мой конкретный кондиционер или ESP32, как uart_debugвозвращает несколько значений, отличных от тех, которые вы указали в коде. А может быть значения правильные, но мешает блокировка чтения?

Он регулярно говорит [11:21:45][D][READ SKIP:113]: Reading lock enabled. Skipping AC state reading.. Я опущу их из журналов ниже.

[11:23:18][D][uart_debug:114]: <<< 77 7B FF BF FF FF 77 77 F7 37 FF 77 FF 3F F7 F7 7F D9 F7 FF FF 33 FF BB FF F3 EF 37 77 FF F7 7F FF FF BF FF 7F FF FD 77 FF FF BF 77 FF 7F FD 77 FD 77 FF FF FF 77 73 FF 7B DB BF FF BF FD DD 77 F7 FF FD FF F7 FF FF 7B 3F 7F 7F 33 DD F3 77 FF F3 77 77 F7 B3 73 FF F7 FF DD FB F3 37 FD 77 FF FF 37 FF FF FF FF BF F7 77 7F 33 FF 77 77 BF FF 7F 3F FF FD FF FF F3 FF
[11:23:18][W][component:232]: Component uart took a long time for an operation (52 ms).
[11:23:18][W][component:233]: Components should block for at most 30 ms.
[11:23:20][D][uart_debug:114]: <<< FB 9D F3 FF FF 7B F7 DD B7 7F B3 FF FF 77 FF 7F FF F7 33 F7 FF FF B7 FF 7F B3 FF F7 B3 FF EE 33 FF F7 F7 F7 F7 77 FB 3F FF 33 FF FF FF B7 FF 37 F9 FF 7F 77 FF 3F 73 F3 7F FF FF FF FF FF 77 FF FF 37 F7 77 FD 3B FD DF 77 FF B7 FF FF 7F FF 7F 77 DD FF FF FF DD 37 77 F3 73 B3 FF FF FF FF 73 77 FF FF 77 FF FF FB 77 FF DD FF 77 FF FF FF FF 77 FF B3 FF 77 77 7B F7
[11:23:22][D][uart_debug:114]: <<< B3 FF DD FF FF FF BB FF FF FF F7 F3 FF FF 77 77 FF BF 7F FF FF B3 7F 7F FF 77 33 F9 FE 7F FE FF FF 37 FF FF B3 BB FF DD FF F7 3B 77 7F DF 76 FF FF 7F FF FB F7 7F 7F FF 7F D3 FF FF DF FF FB 77 FF DD FF F7 3B FF FF FF FF FF DF F7 BB FE 7F FF FB FF F3 7F 37 FF FF DD 37 BF FF F7 FF FF FF FF FF 33 FF 3B DD 7F B3 77 B3 7F FF BF FF F3 FF 77 FF 77 BB FF 93 DF DD FF
[11:25:53][D][button:010]: 'Test ON' Pressed.
[11:25:53][D][uart_debug:114]: <<< FF
[11:25:53][D][uart_debug:114]: >>> F4 F5 00 40 29 00 00 01 01 FE 01 00 00 65 00 00 00 00 0C 00 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 DF F4 FB
[11:25:53][D][uart_debug:114]: >>> F4 F5 00 40 29 00 00 01 01 FE 01 00 00 65 00 00 00 00 0C 00 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 DF F4 FB
[11:25:53][W][component:232]: Component web_server took a long time for an operation (67 ms).
[11:25:53][W][component:233]: Components should block for at most 30 ms.
[11:25:53][D][uart_debug:114]: <<< F4 F5 00 40 29 00 00 01 01 FE 01 00 00 65 00 00 00 00 0C 00 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 DF F4 FB
[11:25:53][D][uart_debug:114]: <<< F4 F5 00 40 29 00 00 01 01 FE 01 00 00 65 00 00 00 00 0C 00 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 DF F4 FB
[11:25:53][D][uart_debug:114]: <<< FF 41 41 7F 09 FD FF 03 7F 7F 7F 7F 35 FF FD FF FF EF CF CD D5 FF FE FD FD FF FF FF FF FF FF FF FF FF FF FF F5 FF FF FF FF FF C9 CD B5 FF FF FF 33 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF F7 8D 41 E0 FF FF FF FF FF FF
[11:25:54][D][uart_debug:114]: <<< FF FF FF
[11:25:54][D][uart_debug:114]: <<< FF

Большинство статусов либо NA, либо OFF и никогда не меняются. Статусы не обновляются независимо от того, использую ли я пульт, элементы управления ESPHome или кнопки тестирования.

Hi, do you still have the v3 project? Can you share it?

polsup2 commented 6 months ago

@DimaVins89 , hisense ac v3: http://gofile.me/67ejO/5hlPPRK3T

pio2398 commented 6 months ago

I don't know if this is the right place for such questions but I'm wondering about another solution. AEH-W4G2 seem to base on RTL8710BL with UM3352EESA as RS485 convector. Source: https://fccid.io/2AGCCAEH-W4G2/Users-Manual/User-Manual-5281170

So maybe just flash custom firmware with this metod: https://docs.libretiny.eu/docs/platform/realtek-ambz/#wiring?

No extra hardware will be required in AC unit. No problem with power or case.

At the moment, I see only one problem. How access CEN and serial port of RTL8710BL. From the bottom of the PCB, test pins are available. Maybe serial and CEN is available via this test pins?

fccid got PCB scan/layout but I don't see connection to RTL8710BL.

straga commented 6 months ago

You need just in parallel connect RS485+ESP32 and use esp32 like sniffer get data and check it is same protocol.

straga commented 6 months ago

I am added (https://github.com/straga/scrivo_project/blob/master/project/ac_xm_hisense_control/tools/manual.py) for example from log: hex_string = "F4 F5 00 40 29 00 00 01 01 FE 01 00 00 65 00 00 00 00 0C 00 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 DF F4 FB"

Change that in file, and run manual.py on the PC. You get some information.

INFO:AC_XM: Request: to AC
INFO:AC_XM: Data hex: f4 f5 00 40 29 00 00 01 01 fe 01 00 00 65 00 00 00 00 0c 00 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 df f4 fb
INFO:AC_XM: header:             f4 f5
INFO:AC_XM: paket_type: dec:    0 :  0x0
INFO:AC_XM: padding_byte_1:     0x40
INFO:AC_XM: packet_length:      0x29
INFO:AC_XM: padding_byte_2:     00 00 01 01 fe 01 00 00
INFO:AC_XM: m_packet_type: dec: 101 : 0x65 - m_sub_type: dec: 0 : 0x0
INFO:AC_XM: padding_byte_3:     0x0
INFO:AC_XM: msg_data:           00 00 0c 00 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:AC_XM: msg_sum:            01 df
INFO:AC_XM: footer:             f4 fb
INFO:AC_XM:
INFO:AC_XM: CRC:                479 == 479 
INFO:AC_XM: Data size:          -1 bit
INFO:AC_XM: Data binary: 11000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
INFO:AC_XM: 0ffset where bit == 1 :    [0, 1, 41]
INFO:AC_XM:AC: 102_0
INFO:AC_XM: 192 : wind_status, info: 0 - 18: Super High Wind, 
INFO:AC_XM: 0 : sleep_status, info: 1
INFO:AC_XM: 0 : mode_status, info: 2
INFO:AC_XM: 0 : run_status, info: 3
INFO:AC_XM: 0 : direction_status, info: 4 - wind direction
INFO:AC_XM: 0 : indoor_temperature_setting, info: 5
INFO:AC_XM: 0 : indoor_temperature_status, info: 6
INFO:AC_XM: 64 : indoor_pipe_temperature, info: 7
INFO:AC_XM: 0 : indoor_humidity_setting, info: 8
INFO:AC_XM: 0 : indoor_humidity_status, info: 9
INFO:AC_XM: 0 : somatosensory_temperature, info: 10
INFO:AC_XM: 0 : somatosensory_compensation, info: 11
INFO:AC_XM: 0 : somatosensory_compensation_ctrl, info: 12
INFO:AC_XM: 0 : temperature_compensation, info: 13
INFO:AC_XM: 0 : temperature_Fahrenheit, info: 14 - Fahrenheit display
INFO:AC_XM: 0 : timer, info: 15
INFO:AC_XM: 0 : hour, info: 16
INFO:AC_XM: 0 : minute, info: 18
INFO:AC_XM: 0 : poweron_hour, info: 19
INFO:AC_XM: 0 : poweron_minute, info: 20
INFO:AC_XM: 0 : poweron_status, info: 21
INFO:AC_XM: 0 : poweroff_hour, info: 22
INFO:AC_XM: 0 : poweroff_minute, info: 23
INFO:AC_XM: 0 : poweroff_status, info: 24
INFO:AC_XM: 0 : drying, info: 25
INFO:AC_XM: 0 : wind_door, info: 26
INFO:AC_XM: 0 : up_down, info: 27
INFO:AC_XM: 0 : left_right, info: 28
INFO:AC_XM: 0 : nature, info: 29 - natural wind
INFO:AC_XM: 0 : heat, info: 30 - heating wind
INFO:AC_XM: 0 : low_power, info: 31 - energy saving
INFO:AC_XM: 0 : low_electricity, info: 32 - eco - energy saving
INFO:AC_XM: 0 : efficient, info: 33
INFO:AC_XM: 0 : dual_frequency, info: 34
INFO:AC_XM: 0 : dew, info: 35
INFO:AC_XM: 0 : swap, info: 36
INFO:AC_XM: 0 : indoor_clear, info: 37
INFO:AC_XM: 0 : outdoor_clear, info: 38
INFO:AC_XM: 0 : smart_eye, info: 39
INFO:AC_XM: 0 : mute, info: 40 - quite mode
INFO:AC_XM: 0 : voice, info: 41
INFO:AC_XM: 0 : smoke, info: 42
INFO:AC_XM: 0 : back_led, info: 43
INFO:AC_XM: 0 : display_led, info: 44
INFO:AC_XM: 0 : indicate_led, info: 45
INFO:AC_XM: 0 : indoor_led, info: 46
INFO:AC_XM: 0 : filter_reset, info: 47
INFO:AC_XM: 0 : left_wind, info: 48
INFO:AC_XM: 0 : right_wind, info: 49
INFO:AC_XM: 0 : indoor_electric, info: 50
INFO:AC_XM: 0 : auto_check, info: 51
INFO:AC_XM: 0 : time_laps, info: 52
INFO:AC_XM: 0 : sample, info: 
INFO:AC_XM: 0 : indoor_eeprom, info: 
INFO:AC_XM: 0 : indoor_temperature_sensor, info: 
INFO:AC_XM: 0 : indoor_temperature_pipe_sensor, info: 
INFO:AC_XM: 0 : indoor_humidity_sensor, info: 
INFO:AC_XM: 0 : indoor_water_pump, info: 
INFO:AC_XM: 0 : indoor_machine_run, info: 
INFO:AC_XM: 0 : indoor_bars, info: 
INFO:AC_XM: 0 : indoor_zero_voltage, info: 
INFO:AC_XM: 0 : indoor_outdoor_communication, info: 
INFO:AC_XM: 0 : display_communication, info: 
INFO:AC_XM: 0 : keypad_communication, info: 
INFO:AC_XM: 0 : wifi_communication, info: 
INFO:AC_XM: 0 : electric_communication, info: 
INFO:AC_XM: 0 : eeprom_communication, info: 
INFO:AC_XM: 0 : eeprom_communication, info: 
INFO:AC_XM: 0 : compressor_frequency, info: 
INFO:AC_XM: 0 : compressor_frequency_setting, info: 
straga commented 6 months ago

Example Data from my AC

INFO:AC_XM: Response: from AC
INFO:AC_XM: Data hex: f4 f5 01 40 49 01 00 fe 01 01 01 01 00 66 00 01 00 00 00 18 1b 1b 80 80 00 01 01 00 00 00 00 00 00 00 00 00 00 00 05 00 00 00 00 00 1d 17 3e 47 00 00 ec 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 ee f4 fb
INFO:AC_XM: header:             f4 f5
INFO:AC_XM: paket_type: dec:    1 :  0x1
INFO:AC_XM: padding_byte_1:     0x40
INFO:AC_XM: packet_length:      0x49
INFO:AC_XM: padding_byte_2:     01 00 fe 01 01 01 01 00
INFO:AC_XM: m_packet_type: dec: 102 : 0x66 - m_sub_type: dec: 0 : 0x0
INFO:AC_XM: padding_byte_3:     0x1
INFO:AC_XM: msg_data:           00 00 00 18 1b 1b 80 80 00 01 01 00 00 00 00 00 00 00 00 00 00 00 05 00 00 00 00 00 1d 17 3e 47 00 00 ec 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
INFO:AC_XM: msg_sum:            04 ee
INFO:AC_XM: footer:             f4 fb
INFO:AC_XM:
INFO:AC_XM: CRC:                1262 == 1262 
INFO:AC_XM: Data size:          496 bit
INFO:AC_XM: Data binary: 0000000000000000000000000001100000011011000110111000000010000000000000000000000100000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101000000000000000000000000000000000000000000011101000101110011111001000111000000000000000011101100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
INFO:AC_XM: 0ffset where bit == 1 :    [27, 28, 35, 36, 38, 39, 43, 44, 46, 47, 48, 56, 79, 87, 181, 183, 227, 228, 229, 231, 235, 237, 238, 239, 242, 243, 244, 245, 246, 249, 253, 254, 255, 272, 273, 274, 276, 277]
INFO:AC_XM:AC: 102_0
INFO:AC_XM: 0 : wind_status, info: 0 - 18: Super High Wind, 
INFO:AC_XM: 0 : sleep_status, info: 1
INFO:AC_XM: 0 : mode_status, info: 2
INFO:AC_XM: 0 : run_status, info: 3
INFO:AC_XM: 0 : direction_status, info: 4 - wind direction
INFO:AC_XM: 24 : indoor_temperature_setting, info: 5
INFO:AC_XM: 27 : indoor_temperature_status, info: 6
INFO:AC_XM: 27 : indoor_pipe_temperature, info: 7
INFO:AC_XM: 128 : indoor_humidity_setting, info: 8
INFO:AC_XM: 128 : indoor_humidity_status, info: 9
INFO:AC_XM: 0 : somatosensory_temperature, info: 10
INFO:AC_XM: 0 : somatosensory_compensation, info: 11
INFO:AC_XM: 1 : somatosensory_compensation_ctrl, info: 12
INFO:AC_XM: 0 : temperature_compensation, info: 13
INFO:AC_XM: 0 : temperature_Fahrenheit, info: 14 - Fahrenheit display
INFO:AC_XM: 0 : timer, info: 15
INFO:AC_XM: 0 : hour, info: 16
INFO:AC_XM: 0 : minute, info: 18
INFO:AC_XM: 0 : poweron_hour, info: 19
INFO:AC_XM: 0 : poweron_minute, info: 20
INFO:AC_XM: 0 : poweron_status, info: 21
INFO:AC_XM: 0 : poweroff_hour, info: 22
INFO:AC_XM: 0 : poweroff_minute, info: 23
INFO:AC_XM: 0 : poweroff_status, info: 24
INFO:AC_XM: 0 : drying, info: 25
INFO:AC_XM: 0 : wind_door, info: 26
INFO:AC_XM: 0 : up_down, info: 27
INFO:AC_XM: 0 : left_right, info: 28
INFO:AC_XM: 0 : nature, info: 29 - natural wind
INFO:AC_XM: 0 : heat, info: 30 - heating wind
INFO:AC_XM: 0 : low_power, info: 31 - energy saving
INFO:AC_XM: 0 : low_electricity, info: 32 - eco - energy saving
INFO:AC_XM: 0 : efficient, info: 33
INFO:AC_XM: 0 : dual_frequency, info: 34
INFO:AC_XM: 0 : dew, info: 35
INFO:AC_XM: 0 : swap, info: 36
INFO:AC_XM: 0 : indoor_clear, info: 37
INFO:AC_XM: 0 : outdoor_clear, info: 38
INFO:AC_XM: 0 : smart_eye, info: 39
INFO:AC_XM: 0 : mute, info: 40 - quite mode
INFO:AC_XM: 0 : voice, info: 41
INFO:AC_XM: 0 : smoke, info: 42
INFO:AC_XM: 0 : back_led, info: 43
INFO:AC_XM: 0 : display_led, info: 44
INFO:AC_XM: 0 : indicate_led, info: 45
INFO:AC_XM: 0 : indoor_led, info: 46
INFO:AC_XM: 0 : filter_reset, info: 47
INFO:AC_XM: 0 : left_wind, info: 48
INFO:AC_XM: 0 : right_wind, info: 49
INFO:AC_XM: 0 : indoor_electric, info: 50
INFO:AC_XM: 0 : auto_check, info: 51
INFO:AC_XM: 0 : time_laps, info: 52
INFO:AC_XM: 1 : rev23, info: 
INFO:AC_XM: 0 : sample, info: 
INFO:AC_XM: 1 : indoor_eeprom, info: 
INFO:AC_XM: 0 : indoor_temperature_sensor, info: 
INFO:AC_XM: 0 : indoor_temperature_pipe_sensor, info: 
INFO:AC_XM: 0 : indoor_humidity_sensor, info: 
INFO:AC_XM: 0 : indoor_water_pump, info: 
INFO:AC_XM: 0 : indoor_machine_run, info: 
INFO:AC_XM: 0 : indoor_bars, info: 
INFO:AC_XM: 0 : indoor_zero_voltage, info: 
INFO:AC_XM: 0 : indoor_outdoor_communication, info: 
INFO:AC_XM: 0 : display_communication, info: 
INFO:AC_XM: 0 : keypad_communication, info: 
INFO:AC_XM: 0 : wifi_communication, info: 
INFO:AC_XM: 0 : electric_communication, info: 
INFO:AC_XM: 0 : eeprom_communication, info: 
INFO:AC_XM: 0 : rev25, info: 
INFO:AC_XM: 0 : eeprom_communication, info: 
INFO:AC_XM: 0 : compressor_frequency, info: 
INFO:AC_XM: 0 : compressor_frequency_setting, info: 
INFO:AC_XM: 0 : compressor_frequency_send, info: 
INFO:AC_XM: 29 : outdoor_temperature, info: 
INFO:AC_XM: 23 : outdoor_condenser_temperature, info: 
INFO:AC_XM: 62 : compressor_exhaust_temperature, info: 
INFO:AC_XM: 71 : target_exhaust_temperature, info: 
INFO:AC_XM: 0 : expand_threshold, info: 
INFO:AC_XM: 0 : UAB_HIGH, info: 
INFO:AC_XM: 236 : UAB_LOW, info: 
INFO:AC_XM: 0 : UBC_HIGH, info: 
INFO:AC_XM: 0 : UBC_LOW, info: 
INFO:AC_XM: 0 : UCA_HIGH, info: 
INFO:AC_XM: 0 : UCA_LOW, info: 
INFO:AC_XM: 0 : IAB, info: 
INFO:AC_XM: 0 : IBC, info: 
INFO:AC_XM: 0 : ICA, info: 
INFO:AC_XM: 0 : generatrix_voltage_high, info: 
INFO:AC_XM: 0 : genertarix_voltage_low, info: 
INFO:AC_XM: 0 : IUV, info: 
INFO:AC_XM: 0 : rev46, info: 
INFO:AC_XM: 0 : four_way, info: 
INFO:AC_XM: 0 : outdoor_machine, info: 
INFO:AC_XM: 0 : wind_machine, info: 
INFO:AC_XM: 0 : rev47, info: 
INFO:AC_XM: 0 : rev48, info: 
INFO:AC_XM: 0 : rev49, info: 
INFO:AC_XM: 0 : rev50, info: 
INFO:AC_XM: 0 : rev51, info: 
INFO:AC_XM: 0 : rev52, info: 
INFO:AC_XM: 0 : rev53, info: 
INFO:AC_XM: 0 : rev54, info: 
INFO:AC_XM: 0 : rev55, info: 
INFO:AC_XM: 0 : rev56, info: 
DimaVins89 commented 6 months ago

@DimaVins89 , hisense ac v3: http://gofile.me/67ejO/5hlPPRK3T

It works on my ac, esp8266 wemos d1 and rs485 are connected. I see a problem in randomly rebooting my wemos, I have no idea what to do.

polsup2 commented 5 months ago

I'm sure you have to use esp32 to being stable. I use 7 devices for more than 1 year with no issues.

1iverea9er commented 5 months ago

@DimaVins89 ACs like fridges are very humming on Wi-Fi frequencies when they are running. I assume that your problems may be related to this issue. I had to use the wired version of the ESP32 - WT32-ETH01 336874754-390d5891-a35a-4ce9-a922-412a4ee48eb8

TokarevSergey commented 5 months ago

@DimaVins89 Кондиционеры, такие как холодильники, во время работы очень гудят на частотах Wi-Fi. Я предполагаю, что ваши проблемы могут быть связаны с этой проблемой. Пришлось использовать проводную версию ESP32 — WT32-ETH01. 336874754-390d5891-a35a-4ce9-a922-412a4ee48eb8

Hi. I have a Galactic GK07H-S1 air conditioner made by Hisense. Remote control DG11Zh1-91. Board PCB05-404-V02, 1553856, B. Support for the Galactic GKZ09HM-S air conditioner was announced here on the forum. Please tell me where on the board to connect your device to esphome. Thank you.

TokarevSergey commented 5 months ago

@DimaVins89 Кондиционеры, такие как холодильники, во время работы очень гудят от периодического Wi-Fi. Я предполагаю, что ваши проблемы могут быть рассмотрены как эти проблемы. Пришлось использовать проводную версию ESP32 — WT32-ETH01. 336874754-390d5891-a35a-4ce9-a922-412a4ee48eb8

My body is similar to yours. Help.

1iverea9er commented 5 months ago

@TokarevSergey On AC Hisense ESP is not connected directly to the control board. These ACs are "Wi-Fi ready" and have a special terminal outside the control board box. If your manufacturer uses the same control board as hisense, this terminal is probably available on the control board itself.

TokarevSergey commented 5 months ago

@TokarevSergey На AC Hisense ESP не подключен напрямую к плате управления. Эти кондиционеры готовы к Wi-Fi и имеют специальный терминал снаружи блока платы управления. Если ваш производитель использует ту же плату управления, что и hisense, этот терминал, вероятно, имеется на самой плате управления.

@TokarevSergey На AC Hisense ESP не подключен напрямую к плате управления. Эти кондиционеры готовы к Wi-Fi и имеют специальный терминал снаружи блока платы управления. Если ваш производитель использует ту же плату управления, что и hisense, этот терминал, вероятно, имеется на самой плате управления.

How do I know which connector on the board I need? Thank you.

fixtee commented 5 months ago

@DimaVins89 , hisense ac v3: http://gofile.me/67ejO/5hlPPRK3T

Hi @polsup2! Can you please update the link? not working anymore :(

fixtee commented 5 months ago

alright, for the moment I picked the code snapshot from @BenJamesAndo above moy initial setup. signals went to the AC but reading lock was applied, thus no feedbacks processed. After debugging I understood that in my particular case initial check of "bytes" size didn't pass, because it contained just 20 elements, whereas in the code I used the check expcted to have more than 20, thus I checnged the comparison operator to be '>=' rather than '>' and it did work for me perfectly. image Anyway I would still appreciate to have the v3 from @polsup2 :)

TokarevSergey commented 5 months ago

How do I know which connector on the board I need? Thank you.

How do I know which connector on the board I need? Thank you.

TokarevSergey commented 5 months ago

@TokarevSergey На AC Hisense ESP не подключен напрямую к плате управления. Эти AC «Wi-Fi ready» и имеют специальный терминал снаружи блока платы управления. Если ваш производитель использует ту же плату управления, что и hisense, этот терминал, вероятно, доступен на самой плате управления.

How do I know which connector on the board I need? Thank you.

fixtee commented 5 months ago

@TokarevSergey do you mean AC control board or ESP32? In my case e.g. I have Hisense AC from 2016 model year and mine didn't have Wi-Fi plug on the control board. I have bought a control board on AliExpress which has necessary plug: image In fact the one above didn't work well for me - it functions but AC behaves strange sometimes, so I got another board which is currently installed, but still that other one has the port to connect Wi-fi stick (or ESP32+Serial-to-RS485).

Below is the original board for comparison: image

TokarevSergey commented 5 months ago

@TokarevSergeyВы имеете в виду плату управления AC или ESP32? В моем случае, например, у меня Hisense AC 2016 модельного года, и на плате управления не было разъема Wi-Fi. Я купил плату управления на AliExpress, на которой есть необходимый разъем: На самом деле, та, что выше, мне не подошла - она ​​работает, но AC иногда ведет себя странно, поэтому я купил другую плату, которая сейчас установлена, но у той, другой, все еще есть порт для подключения Wi-Fi-модема (или ESP32+Serial-to-RS485). изображение

Ниже для сравнения представлена ​​оригинальная плата: изображение

How can you find out what board you have installed? Can you tell me? so I can order. Thank you.

fixtee commented 5 months ago

I got it here: https://aliexpress.ru/item/1005002747448458.html?spm=a2g2w.orderdetail.0.0.5e384aa6X3rOes&sku_id=12000021949546570 As you see tha part number of my original board is 1550982, B, My "hardware" knowledge is not that high to understand via remote how to identify the ideal board - more or less those are the same. So in fact I did a visual search over the AliExpress - number of cables, location of connectors, size and form of the board, input/output on the board, electric elements.. I.e. to control all the stuff my AC has - vertical, horizontal swings + Wi-Fi :) PCB05-433-V03 matched the best. Currently I can't see it in the shop I've sent. So, my reco here would be to check your existing board visually and try to find closest match.

TokarevSergey commented 5 months ago

Я купил его здесь: https://aliexpress.ru/item/1005002747448458.html?spm=a2g2w.orderdetail.0.0.5e384aa6X3rOes&sku_id=12000021949546570 Как видите, номер детали моей оригинальной платы - 1550982, B, Мои познания в "железе" не настолько высоки, чтобы понять с помощью пульта, как определить идеальную плату - более или менее они одинаковы. Так что на самом деле я провел визуальный поиск по AliExpress - количество кабелей, расположение разъемов, размер и форма платы, входы/выходы на плате, электрические элементы.. То есть, чтобы управлять всем, что есть в моем кондиционере - вертикальные, горизонтальные колебания + Wi-Fi :) PCB05-433-V03 подошла лучше всего. В настоящее время я не могу увидеть ее в магазине, который я отправил. Поэтому я бы рекомендовал вам визуально проверить имеющуюся плату и попытаться найти наиболее близкое соответствие.

Please tell me if it is possible to connect esphome instead of the display (as if in parallel. Connect in parallel) that is, connect esphome to the same connector as the display. As I understand, control comes from the display and feedback also comes to the display.

fixtee commented 5 months ago

No, not like this: it's just coincidence that in my original board the display output port is located in the same place (pic 2) where X402 Wi-Fi is located in the Wi-Fi ready board (pic 1). If you check closely you will see that in the pic 1 there is also a serpate display port. So you can't use Display port to connect the Wi-Fi module. The control board must have a separate port. image