mansgueg
(Cedric)
November 29, 2024, 10:19am
1
How to simply set pin GPIO02 to HIGH ? I am lost
substitutions:
name: esphome-web-5822df
friendly_name: ESP-HUMIDITY
esphome:
name: ${name}
friendly_name: ${friendly_name}
min_version: 2024.6.0
name_add_mac_suffix: false
project:
name: esphome.web
version: dev
esp8266:
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
# Allow Over-The-Air updates
ota:
- platform: esphome
# Allow provisioning Wi-Fi via serial
improv_serial:
wifi:
# Set up a wifi access point
ap: {}
# In combination with the `ap` this allows the user
# to provision wifi credentials to the device via WiFi AP.
captive_portal:
dashboard_import:
package_import_url: github://esphome/example-configs/esphome-web/esp8266.yaml@main
import_full_config: true
sensor:
- platform: dht
pin: GPIO0 #Pin D3
temperature:
name: "Living Room Temperature"
humidity:
name: "Living Room Humidity"
update_interval: 2s
switch:
- platform: gpio
name: "GPIO13 Switch"
pin: GPIO02
id: GPIO02_switch
internal: true
web_server:
port: 80
tom_l
November 29, 2024, 12:36pm
2
When do you want to turn the switch on (GPIO02 → High)?
You can control it from your dashboard in home assistant. Or in ESPHome you can use the switch.turn_on
action. See: Actions, Triggers, Conditions — ESPHome
Protoncek
(Pavel)
November 29, 2024, 1:04pm
3
mansgueg:
internal: true
Is there any reason that you set it as internal? This way it’s not accessible from HA. Delete that line and it will appear.
mansgueg
(Cedric)
November 29, 2024, 5:14pm
4
tom_l:
switch.turn_on
Full time without condition
Hellis81
(Hellis81)
November 29, 2024, 8:14pm
5
Why use a gpio then?
Why not use the 3.3 v pin?
mansgueg
(Cedric)
November 29, 2024, 8:25pm
6
That’s an excellent question I did not partially responded:
Because I am testing a lot of sensors that have Fix pin that are all in front of my ESP8266 PIN.
So, instead of prototyping a lot of hardware, I just want to set the right “voltage” on PINs. (And yes, the current consumed by the sensor is lower than the electrical capability of the output pin.)
EBME2
(Ebme2)
November 29, 2024, 11:15pm
7
Add the following to your switch
restore_mode: ALWAYS_ON
1 Like
Spiro
November 29, 2024, 11:24pm
8
on_boot:
priority: 1000
then:
- lambda: |-
pinMode(02, OUTPUT);
digitalWrite(02, HIGH);
Do it in lambda. This should set it high very early on the boot.
1 Like