Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dcgrove opened this issue Nov 28, 2024 · 13 comments

Comments

@dcgrove
Copy link

dcgrove commented Nov 28, 2024

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

@ldrrp
Copy link
Contributor

ldrrp commented Nov 28, 2024

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
Copy link
Author

dcgrove commented Nov 28, 2024

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
Copy link
Contributor

ldrrp commented Nov 28, 2024

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
Copy link
Contributor

ldrrp commented Nov 28, 2024

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
Copy link
Author

dcgrove commented Nov 28, 2024

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

@ldrrp
Copy link
Contributor

ldrrp commented Nov 28, 2024

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

@ldrrp
Copy link
Contributor

ldrrp commented Nov 28, 2024

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

@dcgrove
Copy link
Author

dcgrove commented Nov 28, 2024

Awesome thanks!

@dcgrove
Copy link
Author

dcgrove commented Nov 28, 2024

Ive been using the proxy with the c3 fine

Are you using the Bluetooth proxy with the arduino framework?

@ldrrp
Copy link
Contributor

ldrrp commented Nov 29, 2024

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
Copy link
Contributor

ldrrp commented Nov 29, 2024

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.

@ldrrp
Copy link
Contributor

ldrrp commented Dec 5, 2024

@dcgrove can i close this? Also made a ticket for the case #3

@dcgrove dcgrove closed this as completed Dec 5, 2024
@dcgrove
Copy link
Author

dcgrove commented Dec 5, 2024

Thanks for all the help! The vents are working great now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants