AZ-Touch and ESP32

Has anyone had success with the AZ-Delivery AZ-Touch unit? I’m trying to use it with an ESP32 but it didn’t come with documentation and the documentation I have found seems to be for an older version.

Mine is labelled AZ-Touch MOD, Version 01-03 on the PCB.

It is the pins used that I’m after but if anyone has working yaml code that would be even better!

Thanks.

I figured it out, I managed to find a German version of the documentation for the MOD version!

esphome:
  name: sensor-thermostat
  platform: ESP32
  board: esp32dev

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

wifi:
  ssid: !secret wifi_name
  password: !secret wifi_password
  domain: !secret wifi_domain

spi:
 clk_pin: 18
 mosi_pin: 23
 miso_pin: 19


xpt2046:
  id: touchscreen
  cs_pin: 14 
  irq_pin: 27 
  update_interval: 50ms
  report_interval: 1s
  dimension_x: 240
  dimension_y: 320
  on_state:
    - lambda: |-
        if (touched)
          ESP_LOGI("cal", "x=%d, y=%d, x_raw=%d, y_raw=%d",
              id(touchscreen).x,
              id(touchscreen).y,
              id(touchscreen).x_raw,
              id(touchscreen).y_raw
              );

binary_sensor:
  - platform: xpt2046
    xpt2046_id: touchscreen
    id: touch_key0
    x_min: 80
    x_max: 160
    y_min: 106
    y_max: 212
    on_state:
      - lambda: 'ESP_LOGI("main", "key0: %s", (x ? "touch" : "release"));'
           
display:
  - platform: ili9341
    model: TFT 2.4
    cs_pin: 5 
    dc_pin: 4 
    led_pin: 15 
    reset_pin: 22 
    rotation: 90
    id: tft_ha      

    lambda: |-
      it.fill(COLOR_BLACK);
      it.print(0, 0, id(my_font), id(my_red), TextAlign::TOP_LEFT, "Hello World!");    
    
color:
  - id: my_red
    red: 100%
    green: 3%
    blue: 5%    
    
    
font:
  - file: "arial.ttf"
    id: my_font
    size: 20   
 
 
output:
  - platform: ledc
    pin: 15
    id: gpio_32_backlight_pwm
    inverted: true

# Define a monochromatic, dimmable light for the backlight
light:
  - platform: monochromatic
    output: gpio_32_backlight_pwm
    name: "ILI9341 Display Backlight"
    id: back_light
    restore_mode: ALWAYS_ON

Now I can push on and try to turn this into a thermostat before winter.

1 Like

Another option for you might be openhasp.

https://haswitchplate.github.io/openHASP-docs/0.6/

1 Like

Thank you - that is interesting and I will explore further.

Does it work as expected?
Can you click on the screen and create actions from it in HA?

This is very interesting device…

At a crude, basic level yes. It detects clicks on the screen and provides the co-ordinates.

I’ve not done any more testing yet and still need to calibrate it and then start exploring capabilities but everything looks like it should work much as expected now that I’ve actually got it talking.

I plan to add a temperature sensor (maybe ds18b20 or bme280) and a PIR sensor so the screen wakes up as you approach it.

Then I’ll work on the interface.

The more I look at this the more interesting it seems.
But one thing I noticed is that it/you use pin 15 (GPIO15?) for the LEDs.
But GPIO15 is not PWM? Or is it?
I’m thinking of using it as a clock/display by the bed so it’s rather important to dim it.

I myself feel that the bezel is a little excessive. Ugly excessive.

Is there a definitive az-delivery website? Googling seems to find next to useless amazon adverts.

@Hellis81 It is GPIO15 and it is PWM

1 Like

The AZ-Delivery brand appears to be German - it may be useful in German but I found it a struggle in English https://www.az-delivery.de/

So much so that I ended up using a multimeter to identify many of the pins needed!

Bezel is large but it’s not so bad ‘in the flesh’ and the overall housing is no bigger than the existing thermostat I wish to replace.

1 Like

I know you already have one, but if you, or other readers, want alternatives, there are quite a few devices supported by openhasp now, and you can make lovely home assistant dashboards. Its just had an update to 0.6.1 and there are more devices supported now openHASP

Both the AZ-Delivery screen and touch controller are supported. I love esphome, but for dashboards I am rather taken with openhasp!

1 Like

AZ-Delivery is a german seller. Some guys invented it, to get cheaper prices via direct import from China, as it is kind of annoying to buy over chinese websites from Germany (customs, warranty, refund).

In the end, they are just another B2C shop, that has specialized on branded chips, imported directly from China and sold with all the advantages we have in Germany, when sold and bought in Germany.

If someone needs assistance with their website, let me know, I’m happy to translate or do some questioning. :slight_smile:

The “problem” with their instructions is, most of the info is “hidden” in their free of charge e-books. And these are a pain to download. You have to register an account, put the e-book in the shopping cart, checkout (without paying) and then you get a link to download the e-book… As I said, if somebody needs something here, let me know.

As I live in Germany, most of my components are from them, can’t say anything bad about them, everything works great and in most cases they are the cheapest possibilty to get your hands on ESPs in Germany. :slight_smile:

Thanks, @nickrout - I am looking at that, too, and have ordered another display it supports as a comparison. Does it allow the addition of, say, a PIR and temperature sensor?

Thanks, @paddy0174 - that’s interesting as I did wonder what the story was. I’ve ordered a fair amount of stuff from them - it mostly ‘just works’ and doesn’t need detailed manuals etc.

These AZ-Touch boards are a little different and the manuals (when I found them - what a hassle!) were not available in English for the MOD version. I got some pointers from an earlier version and a multi-meter sorted the rest.

Kind of you to offer - I may take you up on that! Thanks.

1 Like

Everytime! :slight_smile: Just ask, I’m happy to help! :slight_smile:

Thanks @RGN01 - your yaml snippet saved me a lot of time.

I accidentally ordered the AZTouch MKR but wanted to use the ESP32 so ended up manually wiring all of the pins. But all working. Great little board and box - would highly recommend (case, power supply, touchscreen, place to solder extra things, wall mountable box - great value).

Only negative point so far is that the display viewing angle is not great - maybe around 30degrees before the colours start going weird.

Hello @RGN01 any news to your project?
I am planing a similar thermostat and collect some info.

No, sorry, this one is on back burner for now. Too much else going on!

Have you find a PIR to use?

I use PIRs similar to these for most of my projects that require them https://www.amazon.co.uk/Detector-HC-SR312-Pyroelectric-Infrared-Automatic/dp/B07XLKTQMG

I always add a ferrite bead (something like these https://www.amazon.co.uk/Axial-Cylinder-Ferrite-Beads-Leads/dp/B00EZBI2WS) to the signal line to help minimise false triggers.

I’ve not tested these on this board, but believe they will work OK.