Switches in ESPHome
HTML-код
- Опубликовано: 8 фев 2025
- #esphome #home_assistant #switch
Learn how to use pins of ESP8266 and ESP32 development boards as switches in Home Assistant. This is done with ESPHome add on.
Simple Switch:
switch:
platform: gpio
name: "Switch 1"
pin: xx
Define ID:
switch:
platform: gpio
name: "Switch 1"
pin: xx
id: relay
platform: gpio
name: "Switch 3"
pin: 5
restore_mode: RESTORE_default_ON
platform: gpio
name: "Switch 4"
pin: 12
inverted: true
platform: gpio
name: "Switch 6"
pin: 14
icon: "mdi:gate"
on_turn_on:
delay: 2000ms
switch.turn_off: relay
restore_mode (Optional): Control how the GPIO Switch attempts to restore state on bootup.
RESTORE_DEFAULT_OFF (Default) - Attempt to restore state and default to OFF if not possible to restore.
RESTORE_DEFAULT_ON - Attempt to restore state and default to ON.
RESTORE_INVERTED_OFF - Attempt to restore state inverted from the previous state and default to OFF.
RESTORE_INVERTED_ON - Attempt to restore state inverted from the previous state and default to ON.
ALWAYS_OFF - Always initialize the pin as OFF on bootup.
ALWAYS_ON - Always initialize the pin as ON on bootup.
Link of other tutorials:
Home Assistant integration with ESP32 flashed with ESPHome:
• Home Assistant integra...
Setup ESPHome with Home Assistant:
• Setup ESPHome with Hom...
Buy Me A Coffee:
www.buymeacoff...
#esp32 #esp8266 #nodemcu #development_board #esp #tasmota #wifi #tuya #inverted_switch #momentary_switch #icon #wled #automation #automations #blueprint #smart_home #home_automation #bms #iot #zwave #z_wave #zigbee #bluetooth #integration #add_on #peace #comfort #energy_saving #security #gpio #gpio_switch Наука
I really needed this kind of tutorial to understand the whole thing and I am happy to let you know that this is very beginner friendly and the way you have described the whole thing has earned the subscribtion to your channel and would really love to see more of these like with the DHT sensors and also how to setup a 4/8/16 channel relay with the esphome and control the whole thing with home assistant. Kudos to your efforts and please keep up the good work.
Thanks a million for your compliment, I will upload more videos for sure. I bought a DHT sensor but I broke it, I will upload related video soon.
Thanks for this excellent video
You are welcome
Hello, many thanks for your easy undestanding Video! But one question, why are these GPIOs the best for using Switches? I want to create an ESP8266 Wemos D1 Mini with an 8ch relay card - does that work? Or should i take an ESP32 Board?
Hello, Thank you for your support.
For switches you must use GPIOs. If I were you, I would use ESP32
What if I want the switch to be triggered from a toggle button in home-assistant dashboard ?
create an automation in home assistant
Hi sir! I'm new to Home Assistant. Let's say I program my esp32 to control my physical switch with esphome and relay. Will the relay work onchange of the switch when home assistant is down / when my router is damaged. Kindly advice on this.
Hi, Yes
Have you tried mcp23017 and momentary switches?
Can we use shift registers to increase the number of io pins and control it with SPI in ESPHome
I have to work on it to answer it
Buenas tardes se puede utilizar un pulsador físico con robotdyn ac dimmer esphome en una placa esp 32.
Gracias
output:
- platform: ac_dimmer
id: dimmer1
gate_pin: 23
zero_cross_pin:
number: 22
mode:
input: true
min_power: 30%
light:
- platform: monochromatic
output: dimmer1
name: luz parez
default_transition_length: 50ms
I gave to get one robotdyn to test to get sure about the lines and how to do it
Hi
Can you please make a video on removing ESPHOME and flashing factory firmware onto a NODEMCU
Hi, Sure, but I need time
@@kian.smarthome okay sir!
Thanks for replying 😃
@@PiyushNikam Sir, Have you watched this? ruclips.net/video/gL6Y9_Oo8Ss/видео.html
Is it helpful?
@@kian.smarthome yes, I have watched it. Its helpful and awesome! But I was having a doubt that will it work on the ESPHOME or not.
Its great sir!
@@PiyushNikam there mustn't be any issue.
سلام فارسی هم بزارید
سلام دوست عزیز، مخاطب فارسی زبان خیلی خیلی کم هست. شما میتونید از امکانات گوگل برای زیرنویس فارسی استفاده کنید