Hi there. I have started my smart home journey a while ago and i have arrived at the point where I don’t like ready-made solutions for some of my wishes. I was wondering if it is possible to use a single ESP32 board with multiple platforms? For example i want to make an AC IR remote and Bluetooth proxy on the same device, since it is going to be constantly powered on, why not use it for something else So my question is if it is possible to combine those two, or any other integrations that don’t conflict with each other ?
Hi,
I am not quite sure, if I understand your request correctly - but you should be able to use IR and BTProxy together, the same way as you can use “lights” together with Bluetooth and so on…
Here’s an example I am using on one of my model builds.
The esp is being used to illuminate parts on the model, but also acting as a BT Proxy at the same time.
If I add the hardware, it would also work as a thermometer / hygrometer… not an issue
esphome:
name: ${device_name}
friendly_name: ${friendly_name}
comment: ${comment}
platformio_options:
board_build.flash_mode: dio
project:
name: ${project_name}
version: ${project_version}
min_version: ${min_esp_version}
esp32:
board: esp32dev
framework:
type: esp-idf
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "xyz"
ota:
password: "xyz"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: $(wifi_hotspot_ssid)
password: $(wifi_hotspot_password)
captive_portal:
bluetooth_proxy:
active: true
sensor:
# Wifi-Information
- platform: wifi_signal
name: "WiFi Signal dB"
id: wifi_signal_db
update_interval: 60s
entity_category: "diagnostic"
# ESP Chip-Temperatur
- platform: internal_temperature
name: "Internal Temperature"
entity_category: "diagnostic"
- platform: dht
model: dht11
pin: GPIO16
temperature:
name: "Temperature Living-Room"
humidity:
name: "Humidity Living-Room"
update_interval: 10s
# Device Uptime Information
- platform: uptime
name: Uptime
id: uptime_sensor
entity_category: "diagnostic"
update_interval: $wifi_update_interval
on_raw_value:
then:
- text_sensor.template.publish:
id: uptime_human
state: !lambda |-
int seconds = round(id(uptime_sensor).raw_state);
int days = seconds / (24 * 3600);
seconds = seconds % (24 * 3600);
int hours = seconds / 3600;
seconds = seconds % 3600;
int minutes = seconds / 60;
seconds = seconds % 60;
return (
(days ? to_string(days) + "d " : "") +
(hours ? to_string(hours) + "h " : "") +
(minutes ? to_string(minutes) + "m " : "") +
(to_string(seconds) + "s")
).c_str();
text_sensor:
# Wifi-Information
- platform: wifi_info
ip_address:
update_interval: 60s
name: IP Address
entity_category: "diagnostic"
ssid:
update_interval: 60s
name: Connected SSID
entity_category: "diagnostic"
bssid:
update_interval: 60s
name: Connected BSSID
entity_category: "diagnostic"
mac_address:
name: Mac Wifi Address
entity_category: "diagnostic"
scan_results:
update_interval: 60s
name: Latest Scan Results
entity_category: "diagnostic"
# Device Uptime Information
- platform: template
name: Uptime Human Readable
id: uptime_human
icon: mdi:clock-start
binary_sensor:
# Touch-Sensor Switch
- platform: gpio
name: touch_switch
pin: GPIO04
filters:
- delayed_on: 5ms
on_press:
then:
- light.toggle: eyes_led
# Enable Buttons in HA UI
button:
- platform: restart
name: "Restart Device"
entity_category: "diagnostic"
- platform: shutdown
name: "Shutdown Device"
entity_category: "diagnostic"
- platform: template
name: "Mode: Dead London"
on_press:
then:
- light.turn_on:
id: eyes_led
effect: Dead London
- delay: 10s
- light.turn_off: eyes_led
light:
# Figure Eye-LED
- platform: monochromatic
name: Eyes
id: eyes_led
output: eye_led
restore_mode: RESTORE_DEFAULT_OFF
effects:
- flicker:
name: Dead London
alpha: 95%
intensity: 50%
# ESP Status LED
- platform: status_led
name: Status LED
entity_category: "diagnostic"
pin:
number: GPIO2
inverted: false
output:
- platform: ledc
id: eye_led
pin:
number: GPIO26
Just look at some of the examples in the cookbook.