Actron Aircon / ESP32 Controller Help

Hello All,

I have been battling with this for a few weeks, and I was just wondering if someone might be able to provide a bit of assistance and advice. I am trying to get a ESP32 and ESPhome going to allow control of my Actron Air conditioner with a AM7 wall controller via home assistant.

I am basing my Esphome code and wiring off this similar project using a esp32 and Arduino code https://github.com/kursancew/actron-air-wifi

However I am having issues getting this working with Esphome and home assistant, I am a bit of an electronics newbie so not sure if I am doing something wrong, or missing something obvious.

Quick sketch of my current wiring for my setup below. which is very similar to the GitHub wiring diagram.

I am using the following parts based of the initial GitHub project as well.

1 x ESP-WROOM-32
1 x GP8403 DAC
1 x BC548 NPN Transistor
1 x 20k Ohm Reistor
1 x Arduino Voltage Sensor similar to this.

I have the esp32 hooked up to a gp8403 to be used as the DAC and then have output 0 from the DAC connected a 20k ohm 0.5 watt resistor connecting it to the base pin on the BC548 NPN transistor. I have the key wire from the wall panel connected to the collector on the 548 transistor and the emitter connected up to the VCC input on a 0-25V DC Arduino Voltage Sensor which is just a voltage divider.

However this doesn’t appear to be working as I would suspect. I have created a bunch of switches in Esphome that set the DAC output to restrict the voltage flowing via the 548 transistor to match the corresponding voltage that a keypress on the wall control panel does and and I can see the voltage drop on the voltage sensor matching what a keypress would when enabling these switches in home assistant. But the physical wall panel controls never updates to reflect any of the changes that I initiate via home assistant.

If I press the keypad buttons on the physical wall panel, I can see the voltage drops on the voltage sensor and the wall panel updates correctly to reflect these changes which has me a bit confused why the controls via the Esphome and 548 transistor don’t work as I see close to the the same voltage drops when using the ESPhome switches via home assistant in the ESPhome logs for the voltage sensor.

My ESPHome code is below

esphome:
  name: aircon
  friendly_name: Aircon
  on_boot:
      then:
        - switch.turn_on: constant_output_5v


esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:
 level: DEBUG

# Enable Home Assistant API
api:
  encryption:
    key: 

ota:
  password: 

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

# Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Aircon-Test Fallback Hotspot"
    password: ""

captive_portal:

#Number Component 
number:
  - platform: template
    name: "Aircon Temp"
    id: aircon_numb_temp
    optimistic: true
    min_value: 17
    max_value: 30
    step: 0.5
    unit_of_measurement: “°C” 
    
  
#Enable sensor to read external button Voltages 
#https://esphome.io/components/sensor/adc.html?highlight=gpio+sensor
sensor:
  - platform: adc
    pin: GPIO32
    name: "Aircon Wall Panel - Key Press"
    update_interval: 50ms
    accuracy_decimals: 3
    filters:   
    - multiply: 5.0
  - platform: homeassistant
    id: current_temperature_downstairs 
    entity_id: sensor.lumi_lumi_sensor_ht_temperature
    

#Setup i2c bus to controll gp8403
#https://esphome.io/components/i2c#i2c
i2c:
  sda: 21
  scl: 22
  scan: true
  id: bus_a

#GP8403 output to Send Voltages for key presses 
#https://esphome.io/components/output/gp8403
gp8403:
  id: my_gp8403
  voltage: 5V
  address: 0x5F

output:
  - platform: gp8403
    id: my_gp8403_output_1
    gp8403_id: my_gp8403
    channel: 0
  - platform: gp8403
    id: my_gp8403_output_2
    gp8403_id: my_gp8403
    channel: 1
    
switch:
#Contant 5v Output Switch
  - platform: output
    output: my_gp8403_output_2
    name:  Constant 5v Output Switch
    id: constant_output_5v
    on_turn_on:
        - output.set_level:
            id: my_gp8403_output_2
            level: 100%
    on_turn_off:
         - output.set_level:
            id: my_gp8403_output_2
            level: 0%           


# Temp Up Switch 
# Output Voltage 1.509 V 
  - platform: output
    output: my_gp8403_output_1
    name:  Switch Temp Up
    id: switch_temp_up
    icon: "mdi:thermometer-chevron-up"
    on_turn_on:
        - number.increment:
            id: aircon_numb_temp
            cycle: false
        - output.set_level:
            id: my_gp8403_output_1
            level: 42.2%
        - delay: 800ms  
        - switch.turn_off: switch_temp_up  
    on_turn_off:
         - output.set_level:
            id: my_gp8403_output_1
            level: 100%
          
# Temp Down Switch
# Output Voltage 2.872 V     
  - platform: output
    output: my_gp8403_output_1
    name:  Switch Temp Down
    id: switch_temp_down
    icon: "mdi:thermometer-chevron-down"
    on_turn_on:
        - number.decrement:
            id: aircon_numb_temp
            cycle: false
        - output.set_level:
            id: my_gp8403_output_1
            level: 68.7%
        - delay: 800ms  
        - switch.turn_off: switch_temp_down 
    on_turn_off:
        - output.set_level:
            id: my_gp8403_output_1
            level: 100%
            
# Aircon Mode Switch
# Output Voltage  0.452 V     
  - platform: output
    output: my_gp8403_output_1
    name:  Switch AC Mode
    id: switch_mode
    icon: "mdi:home-thermometer-outline"
    on_turn_on:
        - output.set_level:
            id: my_gp8403_output_1
            level: 19.4%
        - delay: 800ms  
        - switch.turn_off: switch_mode 
    #on_turn_off:
        - output.set_level:
            id: my_gp8403_output_1
            level: 100%    

# Fan Mode Switch
# Output Voltage 3.220 V    
  - platform: output
    output: my_gp8403_output_1
    name:  Switch Fan Mode
    id: switch_fan_mode
    icon: "mdi:fan"
    on_turn_on:
        - output.set_level:
            id: my_gp8403_output_1
            level: 73.9%
        - delay: 800ms  
        - switch.turn_off: switch_fan_mode
    #on_turn_off:
        - output.set_level:
            id: my_gp8403_output_1
            level: 100%

# Zone Down Staris Switch
# Output Voltage 3.650 V    
  - platform: output
    output: my_gp8403_output_1
    name:  Switch Down Stairs
    id: switch_down_staris
    icon: "mdi:stairs-down"
    on_turn_on:
        - output.set_level:
            id: my_gp8403_output_1
            level: 84.5%
        - delay: 800ms  
        - switch.turn_off: switch_down_staris
    on_turn_off:
        - output.set_level:
            id: my_gp8403_output_1
            level: 100%

# Output Voltage 3.875 V
# Zone Up Staris Switch    
  - platform: output
    output: my_gp8403_output_1
    name:  Switch Up Stairs 
    id: switch_up_staris
    icon: "mdi:stairs-up"
    on_turn_on:
        - output.set_level:
            id: my_gp8403_output_1
            level: 88.9%
        - delay: 800ms  
        - switch.turn_off: switch_up_staris
    on_turn_off:
        - output.set_level:
            id: my_gp8403_output_1
            level: 100%

#Aircon On/Off Switch
# Output Voltage 0.000 V    
  - platform: output
    output: my_gp8403_output_1
    name:  Switch On/Off
    id: switch_ac_on_off
    icon: "mdi:power"
    on_turn_on:
        - output.set_level:
            id: my_gp8403_output_1
            level: 0%
        - delay: 800ms  
        - switch.turn_off: switch_ac_on_off
    on_turn_off:
        - output.set_level:
            id: my_gp8403_output_1
            level: 100%                   

Here is an example of the logs from ESPhome with me using one of the homeassitant switches as well as pressing the physical buttons on the control panel.

[19:05:42][D][switch:012]: 'Switch Temp Down' Turning ON.
[19:05:42][D][switch:055]: 'Switch Temp Down': Sending state ON
[19:05:42][D][number:088]: 'Aircon Temp' - Decrement number, without cycling
[19:05:42][D][number:113]:   New number value: 17.000000
[19:05:42][D][number:012]: 'Aircon Temp': Sending state 17.000000
[19:05:42][D][sensor:094]: 'Aircon Wall Panel - Key Press': Sending state 2.87000 V with 3 decimals of accuracy
[19:05:42][D][sensor:094]: 'Aircon Wall Panel - Key Press': Sending state 2.87500 V with 3 decimals of accuracy
[19:05:42][D][sensor:094]: 'Aircon Wall Panel - Key Press': Sending state 2.89000 V with 3 decimals of accuracy
[19:05:42][D][sensor:094]: 'Aircon Wall Panel - Key Press': Sending state 2.88000 V with 3 decimals of accuracy
[19:05:42][D][sensor:094]: 'Aircon Wall Panel - Key Press': Sending state 2.87000 V with 3 decimals of accuracy
[19:05:42][D][sensor:094]: 'Aircon Wall Panel - Key Press': Sending state 2.86000 V with 3 decimals of accuracy
[19:05:42][D][sensor:094]: 'Aircon Wall Panel - Key Press': Sending state 2.88500 V with 3 decimals of accuracy
[19:05:42][D][sensor:094]: 'Aircon Wall Panel - Key Press': Sending state 2.87500 V with 3 decimals of accuracy
[19:05:42][D][sensor:094]: 'Aircon Wall Panel - Key Press': Sending state 2.86000 V with 3 decimals of accuracy
[19:05:42][D][sensor:094]: 'Aircon Wall Panel - Key Press': Sending state 2.87500 V with 3 decimals of accuracy
[19:05:42][D][sensor:094]: 'Aircon Wall Panel - Key Press': Sending state 2.85000 V with 3 decimals of accuracy
[19:05:43][D][sensor:094]: 'Aircon Wall Panel - Key Press': Sending state 2.86000 V with 3 decimals of accuracy
[19:05:43][D][sensor:094]: 'Aircon Wall Panel - Key Press': Sending state 2.87000 V with 3 decimals of accuracy
[19:05:43][D][sensor:094]: 'Aircon Wall Panel - Key Press': Sending state 2.87500 V with 3 decimals of accuracy
[19:05:43][D][sensor:094]: 'Aircon Wall Panel - Key Press': Sending state 2.87500 V with 3 decimals of accuracy
[19:05:43][D][sensor:094]: 'Aircon Wall Panel - Key Press': Sending state 2.86500 V with 3 decimals of accuracy
[19:05:43][D][sensor:094]: 'Aircon Wall Panel - Key Press': Sending state 2.88500 V with 3 decimals of accuracy
[19:05:43][D][switch:016]: 'Switch Temp Down' Turning OFF.
[19:05:43][D][switch:055]: 'Switch Temp Down': Sending state OFF

Output from a Physical button press on the wall panel below.  


[19:05:51][D][sensor:094]: 'Aircon Wall Panel - Key Press': Sending state 2.90000 V with 3 decimals of accuracy
[19:05:51][D][sensor:094]: 'Aircon Wall Panel - Key Press': Sending state 2.88500 V with 3 decimals of accuracy
[19:05:51][D][sensor:094]: 'Aircon Wall Panel - Key Press': Sending state 2.87500 V with 3 decimals of accuracy
[19:05:51][D][sensor:094]: 'Aircon Wall Panel - Key Press': Sending state 2.88000 V with 3 decimals of accuracy
[19:05:51][D][sensor:094]: 'Aircon Wall Panel - Key Press': Sending state 2.90500 V with 3 decimals of accuracy
[19:05:51][D][sensor:094]: 'Aircon Wall Panel - Key Press': Sending state 2.87500 V with 3 decimals of accuracy
[19:05:51][D][sensor:094]: 'Aircon Wall Panel - Key Press': Sending state 4.41000 V with 3 decimals of accuracy

I am not sure what I am doing wrong here as it appears that this should all work but I must be missing something obvious.

For testing and just to make sure everything should work as intended I have created some other Esphome code below removing the BC548 NPN Transistor and, 20k Ohm Resistor and Arduino Voltage Sensor and have the output of the DAC directly connected to the key wire on the wall panel. And this appears to work fine I can send the corresponding voltage for each keypress that I am interested in and the wall panel correctly updates to reflect these changes. However the physical key panel buttons no longer works with this setup. I assume this might be due to me sending a constant 4.9-5v from the ESP32 on boot and the keypress not being able to reduce the resistance/voltage when I press the physical keys.

Example of the somewhat working ESPhome code below.

esphome:
  name: aircon
  friendly_name: Aircon
  on_boot:
      then:
        - output.set_level:
           id: my_gp8403_output_1
           level: 98%

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:
 level: DEBUG

# Enable Home Assistant API
api:
  encryption:
    key: 

ota:
  password: 

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Aircon-Test Fallback Hotspot"
    password: "bxbGyGC7zQA2"

captive_portal:
  
#Number Component 
number:
  - platform: template
    name: "Aircon Temp"
    id: aircon_numb_temp
    optimistic: true
    min_value: 17
    max_value: 30
    step: 0.5
    unit_of_measurement: “°C”

#Enable sensor to read external button Voltages 
#https://esphome.io/components/sensor/adc.html?highlight=gpio+sensor
sensor:
  - platform: adc
    pin: GPIO32
    name: "Aircon Wall Panel - Key Press"
    update_interval: 10ms
    accuracy_decimals: 3
    filters:   
    - multiply: 5.0
    #- offset: -0.375
    on_value_range:
      - below: 5.00
        above: 3.80
        then:
          - logger.log: "Zone Up Stairs Test Button Press"
          #- button.press: aircon_zone1_button
  - platform: homeassistant
    id: current_temperature_downstairs 
    entity_id: sensor.lumi_lumi_sensor_ht_temperature
    

#Setup i2c bus to controll gp8403
#https://esphome.io/components/i2c#i2c
i2c:
  sda: 21
  scl: 22
  scan: true
  id: bus_a

#GP8403 output to Send Voltages for key presses 
#https://esphome.io/components/output/gp8403
gp8403:
  id: my_gp8403
  voltage: 5V
  address: 0x5F

output:
  - platform: gp8403
    id: my_gp8403_output_1
    gp8403_id: my_gp8403
    channel: 0
    min_power: 0.01
  - platform: gp8403
    id: my_gp8403_output_2
    gp8403_id: my_gp8403
    channel: 1
    

# Button Configuration
button:
#Temp Up Button
  - platform: output
    name: Aircon Temp Up
    id: aircon_temp_up_button
    duration: 10ms
    output: my_gp8403_output_1
    # Optional variables:
    icon: "mdi:thermometer-chevron-up"
    on_press:
     then:
      - switch.turn_on: switch_temp_up 
             
#Temp Down Button
  - platform: output
    name: Aircon Temp Down
    id: aircon_temp_down_button
    duration: 10ms
    output: my_gp8403_output_1
    # Optional variables:
    icon: "mdi:thermometer-chevron-down"
    on_press:
     then:
      - switch.turn_off: switch_temp_down
   
#Fan Button Modes 
  - platform: output
    name: Aircon Fan
    id: aircon_fan_button
    duration: 10ms
    output: my_gp8403_output_1
    # Optional variables:
    icon: "mdi:fan"
    on_press:
     then:
      - switch.turn_on: switch_fan_mode

    
#Zone Down Staris Mode
  - platform: output
    name: Aircon Zone Down Staris
    id: aircon_zone1_button
    duration: 10ms
    output: my_gp8403_output_1
    # Optional variables:
    icon: "mdi:stairs-down"
    on_press:
     then:
      - switch.turn_on: switch_down_staris
  

#Zone Up Staris Mode
  - platform: output
    name: Aircon Zone Up Staris
    id: aircon_zone2_button
    duration: 300ms
    output: my_gp8403_output_1
    # Optional variables:
    icon: "mdi:stairs-up"
    on_press:
     then:
      - switch.turn_on: switch_up_staris
                                 

#Aircon Mode
  - platform: output
    name: Aircon Mode
    id: aircon_mode_button
    duration: 300ms
    output: my_gp8403_output_1
    # Optional variables:
    icon: "mdi:home-thermometer-outline"
    on_press:
     then:
      - switch.turn_on: switch_mode


#Aircon On/Off
  - platform: output
    name: Aircon On/Off
    id: aircon_on_off
    duration: 300ms
    output: my_gp8403_output_1
    # Optional variables:
    icon: "mdi:power"
    on_press:
     then:
       - switch.turn_off: switch_ac_on_off


switch:
#Temp Up Switch  
  - platform: output
    output: my_gp8403_output_1
    name:  Switch Temp Up
    id: switch_temp_up
    icon: "mdi:thermometer-chevron-up"
    on_turn_on:
        - number.increment: aircon_numb_temp
        - output.set_level:
            id: my_gp8403_output_1
            level: 30%
        - delay: 300ms  
        - switch.turn_off: switch_temp_up  
    on_turn_off:
         - output.set_level:
            id: my_gp8403_output_1
            level: 98%
          
#Temp Down Switch    
  - platform: output
    output: my_gp8403_output_1
    name:  Switch Temp Down
    id: switch_temp_down
    icon: "mdi:thermometer-chevron-down"
    on_turn_on:
        - number.decrement: aircon_numb_temp
        - output.set_level:
            id: my_gp8403_output_1
            level: 56%
        - delay: 300ms  
        - switch.turn_off: switch_temp_down 
    on_turn_off:
        - output.set_level:
            id: my_gp8403_output_1
            level: 98%
#Aircon Mode Switch    
  - platform: output
    output: my_gp8403_output_1
    name:  Switch AC Mode
    id: switch_mode
    icon: "mdi:home-thermometer-outline"
    on_turn_on:
        - output.set_level:
            id: my_gp8403_output_1
            level: 8%
        - delay: 300ms  
        - switch.turn_off: switch_mode 
    #on_turn_off:
        - output.set_level:
            id: my_gp8403_output_1
            level: 98%                       
#Fan Mode Switch    
  - platform: output
    output: my_gp8403_output_1
    name:  Switch Fan Mode
    id: switch_fan_mode
    icon: "mdi:fan"
    on_turn_on:
        - output.set_level:
            id: my_gp8403_output_1
            level: 65.5%
        - delay: 350ms  
        - switch.turn_off: switch_fan_mode
    #on_turn_off:
        - output.set_level:
            id: my_gp8403_output_1
            level: 98%
#Zone Down Staris Switch    
  - platform: output
    output: my_gp8403_output_1
    name:  Switch Down Stairs
    id: switch_down_staris
    icon: "mdi:stairs-down"
    on_turn_on:
        - output.set_level:
            id: my_gp8403_output_1
            level: 72%
        - delay: 300ms  
        - switch.turn_off: switch_down_staris
    on_turn_off:
        - output.set_level:
            id: my_gp8403_output_1
            level: 98%                
#Zone Up Staris Switch    
  - platform: output
    output: my_gp8403_output_1
    name:  Switch Up Stairs 
    id: switch_up_staris
    icon: "mdi:stairs-up"
    on_turn_on:
        - output.set_level:
            id: my_gp8403_output_1
            level: 76%
        - delay: 300ms  
        - switch.turn_off: switch_up_staris
    on_turn_off:
        - output.set_level:
            id: my_gp8403_output_1
            level: 98%
#Aircon On/Off Switch    
  - platform: output
    output: my_gp8403_output_1
    name:  Switch On/Off
    id: switch_ac_on_off
    icon: "mdi:power"
    on_turn_on:
        - output.set_level:
            id: my_gp8403_output_1
            level: 0%
        - delay: 300ms  
        - switch.turn_off: switch_ac_on_off
    on_turn_off:
        - output.set_level:
            id: my_gp8403_output_1
            level: 98%                   

My ideal setup would allow me to still use the physical wall control panel for easy of use of my wife and kids. However I would also like to be send controls via home assistant and the Esphome which is what I was hoping I would be able to achieve with the schematics based on the Github project but I just can’t seem to get that to work as I was hoping it would.

Any advice or assistant would be greatly appreciated!

Hey @lordvorta

Nice project. Have you solved the issue?

I too would love to see some support from the experts to see you up and running.

I’ve got an actron air with an LM7 controller which hopefully could be integrated in a similar way.

Not yet unfortunately I still have a bit more playing around and investigating to do. I was able to get some controls working with the DAC directly connected to the key wire bypassing the transistor setup and could see keypress reflected on the wall panel with temp up temp down etc… So in theory this should all work.

This was with the keywire not connected to the wall panel so there was no native controls via the wall panel. However sometimes the unit would turn on and off with this setup when I was testing the different button presses. I assume due to the dac briefly dropping to 0v when I send the different voltage levels so not ideal.

My next step was to maybe look at trying with a optocoupler that way I can keep the circuits separate for the esp32 and wall panel and see if that works any better.

If I get any further I will definitely look to update this thread.

1 Like

I’m thinking of setting up a breadboard to do some of my own testing and playing. I’m by no means and expert,but, can follow well in other people footsteps and use examples from other projects as learning.

Since you first post have you changed your wiring or parts list? This is of course not considering the octocoupler you recently mentioned?

Nope parts list is all still %100 the same as what I had posted so hopefully that would be a ok start for you to play around with.

I will let you know how I go with any further testing that I look at doing.

Hi @lordvorta - I think I might give this a try.

I assume you are using the voltage measurement just to verify the voltage generated and not to decode the LED statuses as in the original Github project (which measures voltage on the Power line)?

One point I note different between your circuit shown and the sample on Github is that you have your voltage divider for measuring the voltage in series with the transistor. My electronics knowledge is very rusty - but I would assume this would affect the resistance and thus the voltage at KEY.
Your diagram is also unclear (and there is no detail on the Voltage sensor module - but my guess is that this is just a voltage divider and the Vcc and + connections are both connected together) - if so and you have + connected to 3.3V on the ESP - that would be a problem.

Have you tried just removing the voltage divider (or connect VCC/+ direct to to KEY / collector) ?

I did some testing this weekend with this and replicated @lordvorta’s circuit as shown below.
When the KEY line voltage sensing circuit (highlighted R4/R5) was in place the keypad did not respond correctly. (I’m guessing higher resistor values with the same ratio might work better)

If I removed R4& R5 (which makes the circuit identical to the original circuit in the Github source) - I was able to get the circuit to emulate the keypad buttons by outputting different voltages from the MCP4725 DAC.

I used trial and error to get the required DAC output for a voltage measured on the KEY line (using a multimeter) would match the voltage when a specific button was pressed.

I don’t have a fully working config yet but thought I’d post this info in case it helps anyone.
My next focus (when time allows) will be to try get a working custom component to get the LED status by decoding the data on the Power-C line as done in the original Github project.

Wow nice work!, defiantly very helpful I hadn’t had a chance to bust out a multimeter yet so all your hard work is greatly appreciated. I might see if I can look at getting it all wired up minus the voltage sensor and fingers crossed I can get something working similar to what your results are.

I was hoping that I would have been able to get some sort of two way state checking of any changes that had been made via that key line voltage sensing circuit but it sounds like that might have been causing some of the issues was I was seeing. I think reading any changes that have been made via the physical keypad and reading that via the LED status on the power-c line would defiantly be the best option but that was defiantly well above my coding skill level :laughing:

As you said hopefully we could get a custom component using a lot the code that had initial been shared as part of the original GitHub project.

Out of curiosity what was the specific NPN transistor that you ended up using in the end was it the same BC548?

Glad to hear you managed to have some luck and thank you so much for sharing your results!

Yes - I used a BC548.
I was also hoping to measure the Key voltage to check for external state changes and was surprised that the external voltage divider circuit affected the voltage (since I chose the same resistor values from the photo of your module).
I actually decided to simulate (my understanding of) the Key voltage with different values of the top resistor in the sensing divider

(On the above link, open the circuit, click simulate - then Run DC Sweep)

This simulation shows that the voltage is being pulled down significantly by the divider and maybe if you used much higher resistors (47M/12M) - that might work. I haven’t tried it yet.

(Blue line is voltages with your divider 4.7k, orange is 47k, brown 47M)

Below is the ESPHome config I currently have working for button control of my keypad:

esphome:
  name: aircon-keypad
  friendly_name: Aircon Keypad

esp32:
  board: m5stack-core-esp32
  framework:
    type: arduino

# Enable logging
logger:
  level: DEBUG #INFO

# Enable Home Assistant API
api:
  encryption:
    key: !secret esphome_api_key

ota:
  password: !secret esphome_ota_password

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Aircon-Keypad Fallback Hotspot"
    password: "M3odvzX6U8gI"

captive_portal:


#Enable sensor to read external button Voltages 
#https://esphome.io/components/sensor/adc.html?highlight=gpio+sensor
#sensor:
#  - platform: adc
#    pin: GPIO32
#    name: "Aircon Wall Panel - Key Press"
#    update_interval: 50ms
#    accuracy_decimals: 3
#    filters:   
#    - multiply: 4.9166


#Setup i2c bus to controll MCP4725
#https://esphome.io/components/i2c#i2c
i2c:
  sda: 25
  scl: 21
  scan: true

#MCP4725 output to Send Voltages for key presses 
#https://esphome.io/components/output/mcp4725
output:
  - platform: mcp4725
    id: dac_output
    address: 0x62


##***TESTING***
# Define a number input component to output mV to the DAC
number:
  - platform: template
    name: "DAC Output miliVolts"
    min_value: 0
    max_value: 5000  # Adjust this value according to the DAC's range
    step: 1    # Adjust the step size as needed
    restore_value: true
    optimistic: true
    on_value:
      then:
        lambda: |-
          id(dac_output).set_level((x / 5000.0));
###############################################################


button:
  - platform: template
    name: "Power"
    on_press:
      - logger.log: Power Button Pressed
      - lambda: |-
          id(dac_output).set_level((5000.0 / 5000.0));
      - delay: 800ms
      - lambda: |-
          id(dac_output).set_level((0.0 / 5000.0));

  - platform: template
    name: "Fan"
    on_press:
      - logger.log: Fan Button Pressed
      - lambda: |-
          id(dac_output).set_level((718.0 / 5000.0));
      - delay: 800ms
      - lambda: |-
          id(dac_output).set_level((0.0 / 5000.0));

  - platform: template
    name: "Temp Up"
    on_press:
      - logger.log: Temp Up Button Pressed
      - lambda: |-
          id(dac_output).set_level((835.0/ 5000.0));
      - delay: 800ms
      - lambda: |-
          id(dac_output).set_level((0.0 / 5000.0));

  - platform: template
    name: "Temp Down"
    on_press:
      - logger.log: Temp Down Button Pressed
      - lambda: |-
          id(dac_output).set_level((741.0/ 5000.0));
      - delay: 800ms
      - lambda: |-
          id(dac_output).set_level((0.0 / 5000.0));


  - platform: template
    name: "Mode"
    on_press:
      - logger.log: Mode Button Pressed
      - lambda: |-
          id(dac_output).set_level((908.0/ 5000.0));
      - delay: 800ms
      - lambda: |-
          id(dac_output).set_level((0.0 / 5000.0));

  - platform: template
    name: "Timer"
    on_press:
      - logger.log: Timer Button Pressed
      - lambda: |-
          id(dac_output).set_level((810.0/ 5000.0));
      - delay: 800ms
      - lambda: |-
          id(dac_output).set_level((0.0 / 5000.0));

  - platform: template
    name: "Timer Up"
    on_press:
      - logger.log: Timer Up Button Pressed
      - lambda: |-
          id(dac_output).set_level((778.0/ 5000.0));
      - delay: 800ms
      - lambda: |-
          id(dac_output).set_level((0.0 / 5000.0));

  - platform: template
    name: "Timer Down"
    on_press:
      - logger.log: Timer Down Button Pressed
      - lambda: |-
          id(dac_output).set_level((763.0/ 5000.0));
      - delay: 800ms
      - lambda: |-
          id(dac_output).set_level((0.0 / 5000.0));

Hope it helps somebody

Hi,

Good to see progress on this. I am not that good with reading diagrams but I will like to try and replicate what you have done so far and learn how it works.

@brentk can you pleas post a list of materials that you have used and works with the ESPHome example you posted?

Also would you be able to describe how all is connected (and maybe some pics?). I am looking at the diagram you posted but yeah I am not that good at interpreting it. So a description in words and pics will work much better for me.

Many thanks and looking forward to control my Actron from HA :slight_smile:

Materials at this stage are:

1 x M5 Stack Atom Lite (or any other ESP32)
1 x MCP4725 Breakout board
1 x BC548 NPN Transistor
1 x 20k Resistor
1 x 4.7k Resistor
1 x 1.2k Resistor

I am still in testing phase (trying to decode LED and 7-segment display) but will also later test if we can eliminate the GP8403 DAC and instead use the built in DAC on the ESP32. (ESP32 DAC is lower resolution than the external one - my guess is it should still work. I think the external was used in original project because it was based on ESP8266)
When I am done - I can look at adding some pictures - but ideally you need to be able to follow a basic circuit diagram like I included to build and troubleshoot something like this. (just leave out R3 and R4 and any of the connections to them).

Hey Guys

Great contributing work on the @brentk. I’ve not used an M5 Stack Atom Lite,but, I can see some potential simplicity in using it as another remote keypad.

Whilst looking at buying options for the m5 stack I saw this new rotary dial product which could potentially add a nice remote control UI.

1 Like

Hi thank you for the reply. The intention here is to try and replicate your work so far and learn at the same time :slight_smile:
One question - the GP8403 DAC. Would you have a link to where you got this from? When I search for it I get all sorts of results and not sure which one I should be getting.

Thanks.

@MnM - My apologies - I copied and pasted the DAC from lordvorta’s post and that is actually not the one I used. I used a MCP4725 Breakout board like this or this . (Which I already had and matches the original Arduino project).
I have updated my parts list to reflect this.

If you use the M5 Stack - this one would be simpler for you to wire as it is a simple plug connection. You would still need to solder connect the transistor and resistors though.

Hey @brentk

I’m just being a little lazy here, but, can you recommend a local (aus) supplier for the m5 stack atom lite. I really want to give this a try rather than the usual ESP32s. Core electronics doesn’t stock it.

I have bought one directly from their website as well as from rs-online when buying other items (free shipping over $80). I was looking at the Atom Echo the other day for the new voice stuff and found Digikey sell them with free shipping over $60 link (picture looks wrong but description is correct)

@brentk - thank you for the update.

Just to make sure I understood and I will order the right hardware:

So if I get

M5 Stack
M5Stack DAC Converter

will be OK?

Also for the BC548 NPN Transistor - I tried searching DIGIKEY (keep the shipping costs down if I can) but I cant find an exact match. Will and of the below options work?
Option1 or Option 2

For resistors when I search on DIGIKEY site I get categories of products return but no actual products. I will appreciate if you can send me some direct URLs for the 20k, 4.7k and 1.2k resistors. I just dont know what to buy and dont want to get the wrong items. (I assume DIGIKEY do sell them)

Many thanks again.

M5Stack items should be good.
Easiest is probably to get transistors and resistors in small quantities from Jaycar - I doubt Digikey will sell in small lots.
Either of those transistors should do I think

One more question - for the resistors I see that Jaycar has 1W, 0.5W 5W ones. Which one do I need to get?