SiloCityLabs / ac-infinity-esp32

Compilation of AC Infinity Vent custom pcbs
Other
0 stars 0 forks source link

Any issues with converting to the esp-idf framework and using these as bluetooth proxies? #1

Open dcgrove opened 3 days ago

dcgrove commented 3 days ago

Have you tried to use this as a blue tooth proxy as well as vent controllers?

ldrrp commented 3 days ago

Are you using the esp32c6? Theres some espidf issues. Have to use Arduino framework. the c6 doesnt support alot of things right now because of issues with esspressfi dropping community support with platformio used with the arduino framework setup.

Can you tell me a little more about your setup? Yaml?

Ive been using the proxy with the c3 fine

dcgrove commented 3 days ago

I have two of the 3 button rev1 boards that I am not going to be able to use unfortunately and was looking to repurpose them. I ordered the vents and boards at the same time, but inadvertently ordered the wrong size vents. When I returned/reordered, they sent me the updated vent with the larger screen so I ordered two more of the four button boards. I haven't flashed any of the boards yet. I was reading the docs for the bluetooth proxy and it recommends the esp-idf framework over Arduino so I though I would ask your thoughts.

ldrrp commented 3 days ago

I stopped offering the c6 boards for now because of lack of support. The community forked platformio to add support for newer chips. Its going to be at least 3-6 months i feel like before it trickles down to esphome.

For now i recommend sticking to the arduino platformio implementation.

What happened to you is the reason i created the 4 button one. They did the same to me :(.

ldrrp commented 3 days ago

Im planning to make a case to use these standalone withouth a vent too. Ill post those stl files here at some point. Unless you end up making one first

dcgrove commented 3 days ago

You wouldn't happen to have a cad file or drawing of the boards would you? Would save some measuring time!

ldrrp commented 3 days ago

I can send a step file when i get back home. Wont be till later tonight

ldrrp commented 3 days ago

Better yet. Ill publish the step files to the repo too

dcgrove commented 3 days ago

Awesome thanks!

dcgrove commented 3 days ago

Ive been using the proxy with the c3 fine

Are you using the Bluetooth proxy with the arduino framework?

ldrrp commented 3 days ago

Yes, below is my configuration. Im using bluetooth tracking and proxy

esphome:
  name: bedroom-vent
  friendly_name: Bedroom Vent

esp32:
  board: esp32-c3-devkitm-1
  framework:
    type: arduino

# Enable logging
logger:
  level: WARN

# Enable Home Assistant API
api:
  encryption:
    key: ""

ota:
  - platform: esphome
    password: ""

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

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

captive_portal:

esp32_ble_tracker:
  scan_parameters:
    interval: 1100ms
    window: 1100ms
    active: true

bluetooth_proxy:
  active: true

i2c:
  sda: GPIO6
  scl: GPIO7
  scan: True

globals:
  - id: fan_speed
    type: int
    restore_value: yes
    initial_value: '0'

button:
  - platform: restart
    icon: mdi:power-cycle
    name: "ESP Reboot"

number:
  - platform: template
    name: "Fan Speed"
    id: fan_speed_number
    min_value: 0
    max_value: 10
    step: 1
    restore_value: true
    set_action:
      - lambda: |-
          id(fan_speed) = (int)(x);
          id(fan_speed_number).publish_state(x);

sensor:
  - platform: ntc
    sensor: temp_resistance_reading
    calibration:      
      #Inversed for PTC
      - 3.389kOhm -> 0°C
      - 10.0kOhm -> 25°C
      - 27.219kOhm -> 50°C
    name: "AC Infinity Temperature"
    id: temp_sensor
    unit_of_measurement: "°C"
    accuracy_decimals: 2
    icon: "mdi:thermometer"

  - platform: resistance
    id: temp_resistance_reading
    sensor: adc_sensor
    configuration: DOWNSTREAM
    resistor: 10kOhm

  - platform: adc
    pin: GPIO4
    id: adc_sensor
    attenuation: 12db

output:
  - platform: ledc
    pin: GPIO2
    id: pwm_output_1
    frequency: 1000 Hz
    # power_supply: fan_speed

  - platform: ledc
    pin: GPIO3
    id: pwm_output_2
    frequency: 1000 Hz
    # power_supply: fan_speed

display:
  - platform: ssd1306_i2c
    model: "SSD1306 128x64"
    address: 0x3C
    # Celcius
    # lambda: |-
    #   it.printf(1, 0, id(myfont), "Airtap T4");
    #   it.printf(0, 14, id(myfont), "Temp: %.1f°C", id(temp_sensor).state);
    #   it.printf(0, 28, id(myfont), "Fan Speed: %d", id(fan_speed));
    # Fahrenheit
    lambda: |-
      it.printf(1, 0, id(myfont), "Airtap T4");
      float temp_f = (id(temp_sensor).state * 9.0 / 5.0) + 32.0;
      it.printf(0, 14, id(myfont), "Temp: %.1f°F", temp_f);
      it.printf(0, 28, id(myfont), "Fan Speed: %d", id(fan_speed));

font:
  - file: "fonts/Arial.ttf"
    id: myfont
    size: 12

binary_sensor:
  - platform: gpio
    pin: GPIO10
    name: "Mode Button"
    on_press:
      then:
        - lambda: |-
            if (id(fan_speed) == 0) {
              id(fan_speed) = 10;
            } else {
              id(fan_speed) = 0;
            }
            id(fan_speed_number).publish_state(id(fan_speed)); // Publish updated state

  - platform: gpio
    pin: GPIO8
    name: "Up Button"
    on_press:
      then:
        - lambda: |-
            if (id(fan_speed) < 10){
              id(fan_speed) += 1;
              id(fan_speed_number).publish_state(id(fan_speed)); // Publish updated state
            }

  - platform: gpio
    pin: GPIO9
    name: "Down Button"
    on_press:
      then:
        - lambda: |-
            if (id(fan_speed) > 0){
              id(fan_speed) -= 1;
              id(fan_speed_number).publish_state(id(fan_speed)); // Publish updated state
            }

light:
  - platform: monochromatic
    output: pwm_output_1
    name: "Fan 1 Speed"
    id: fan_1
    internal: true  # Hide this from Home Assistant

  - platform: monochromatic
    output: pwm_output_2
    name: "Fan 2 Speed"
    id: fan_2
    internal: true  # Hide this from Home Assistant

interval:
  - interval: 1s
    then:
      - light.turn_on:
          id: fan_1
          brightness: !lambda |-
            if (id(fan_speed) == 0) {
              return 0.0;
            } else if (id(fan_speed) == 1) {
              return 0.38;  // Minimum value to start the fan
            } else {
              return (id(fan_speed) + 3) / 13.0;
            }
      - light.turn_on:
          id: fan_2
          brightness: !lambda |-
            if (id(fan_speed) == 0) {
              return 0.0;
            } else if (id(fan_speed) == 1) {
              return 0.38;  // Minimum value to start the fan
            } else {
              return (id(fan_speed) + 3) / 13.0;
            }
ldrrp commented 3 days ago

You wouldn't happen to have a cad file or drawing of the boards would you? Would save some measuring time!

Just exported the OBJ file for use in 3d software. Note that some components might be missing since i solder them on after they are made.