[No Coding Required] Connect ESP8266 NodeMCU to Home Assistant using ESPHome (007E)

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ก.ค. 2024
  • Please be aware that the way to add new NodeMCU on the newer version of the ESPHome has been changed significantly. I separately uploaded a video to cover this process. Please check below link.
    • Changed Method to Add ...
    ----------------------------------------------------------------------------------------------------------------------
    I forgot to mention one thing.
    After the first uploading is done, please be sure to reserve the IP address of NodeMCU in the router setting.
    ----------------------------------------------------------------------------------------------------------------------
    In this video,
    - Introduction of NodeMCU & ESPHome
    - Install ESPHome Add-on
    - OTA Uploading
    - Control Output Pin by 'switch'
    - Sense Input Pin using 'binary_sensor'
    - Connection status check from both NodeMCU & Home Assistant
    Chapter
    0:00 Intro
    2:45 ESPHome Add-on
    5:09 The First 'Wired' Uploading
    6:59 Output Pin Control By Switch
    9:21 The First 'OTA' Uploading
    13:34 Input Pin Sensing with Binary Sensor
    18:49 Monitoring the Connection Status
    Contents of 'test01.yaml' file.
    ----------------------------------------------------------------------------------------------------------------------
    esphome:
    name: test01
    platform: ESP8266
    board: nodemcuv2
    wifi:
    ssid: "Your Wi-Fi"
    password: "Your Wi-FI Password"
    Enable fallback hotspot (captive portal) in case wifi connection fails
    ap:
    ssid: "Test01 Fallback Hotspot"
    password: "to be set by your ESPHome"
    captive_portal:
    Enable logging
    logger:
    Enable Home Assistant API
    api:
    password: "otapassword"
    ota:
    password: "otapassword"
    switch: #HA -) ESP -) Pin
    - platform: gpio
    pin: D4 #Internal LED switching
    name: "NodeMCU Internal LED"
    id: internal_led
    binary_sensor: # Pin or Internal Status -) ESP -) HA
    - platform: gpio
    pin:
    number: D2
    mode: INPUT_PULLUP
    inverted: True
    name: "Door 1"
    - platform: status
    name: "NodeMCU1 Connection Status"
    interval:
    - interval: 1sec
    then:
    - if:
    condition: api.connected
    then:
    - switch.toggle: internal_led
    -------------------------------------------------------------------------------------------
    #ESPHome
    #ESP8266
    #NodeMCU
    #Over-The-Air
    #OTA
    #ESP32
    #DoorAlarm
    #DoorSwitch
    #HomeAssistant
    #HomeAutomation
    #SmartHome
    #RaspberryPi
    #makeshift
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 49

  • @_tim
    @_tim ปีที่แล้ว +5

    This is a ridiculously well explained video. Thank you so much!

  • @ArranAsh
    @ArranAsh 2 ปีที่แล้ว +2

    Amazing tutorial, saved £10 buying a door sensor and found a use for my 4 unused esp32s!

  • @joelfrojmowicz
    @joelfrojmowicz 3 ปีที่แล้ว

    Amazing video. I went from 0 regarding ESPHome and I've learned a lot with this video! Thanks!

  • @christiand2426
    @christiand2426 2 ปีที่แล้ว +7

    "No Coding Required" > Proceeds to show us how to Code.

  • @olethronborg6240
    @olethronborg6240 2 ปีที่แล้ว

    Thanks. Finally someone describe ALL steps slow and understandable..

  • @impartialx7182
    @impartialx7182 2 ปีที่แล้ว +7

    This new channel is a hidden gem on youtube! Excellent videos with really well structured top notch content and editing. Props sir! Thank you for sharing it. It really helps and inspire us. New subscriber and smashing the like button while binge watching your videos. Cheers

    • @makeshiftsmarthome6748
      @makeshiftsmarthome6748  2 ปีที่แล้ว +1

      Thank you very much for your positive feedback. Will try harder to meet your expectations!

    • @benoitbilliau5731
      @benoitbilliau5731 ปีที่แล้ว +1

      @@makeshiftsmarthome6748 just discovering your channel, immediately subbed. thank you

    • @makeshiftsmarthome6748
      @makeshiftsmarthome6748  ปีที่แล้ว

      @@benoitbilliau5731 Thanks. This week, I uploaded one video after more than 1 year of hiatus. New videos are being prepared. Stay tuned!

  • @Vietnamcamping89
    @Vietnamcamping89 8 หลายเดือนก่อน +1

    Very good teaching. Thank you

  • @giorgosiotis1557
    @giorgosiotis1557 2 ปีที่แล้ว +1

    Bravo from Greece. Top Video.

  • @Passco666
    @Passco666 ปีที่แล้ว +1

    Thank you for your tutorial .. very clear for me

  • @reeberom1
    @reeberom1 ปีที่แล้ว +1

    This is so well done, THANK YOU! If I had seen this video first, it would've saved me hours of watching not so helpful videos. Subscribed!👴

  • @BSOArtMagedon
    @BSOArtMagedon 2 ปีที่แล้ว +1

    Very good job!!! A real good configuration, complete, secured... A professional job.
    In case anybody can add an answer to this question:
    How many magnetics sensors can be connected at the same time on the same Node MCU? (Same ESP8266)
    It seems to be only D1, D2, D5, D6 and D7
    And of course on which GPIO? (considering that some cannot be used or make problems)
    Is there a way to use also one of the D0, D3, D4, D8 for the same purpose with may be a different programmation to escape the restrictions?

    • @makeshiftsmarthome6748
      @makeshiftsmarthome6748  2 ปีที่แล้ว +2

      Thanks for watching. Pin D1, D2, D5, D6 and D7 correspond to GPIO 5, 4, 14, 12, 13 respectively. I once used one NodeMCU to connect 7 magnetic sensors. At first it worked well for months. Then, when there's a power outage, it stopped working. After long times of search, I realized that D0, D3, D4 and D8 pins have restrictions. Especially, some pins requires to be high or low voltage state during powering up. Otherwise, the NodeMCU will go to some special mode or just stop working. So, for my understanding, if you want connect sensors to such pins, you need to power up the NodeMCU first then connect sensor few moments later which would be very impractical for IoT application.

  • @kalvinwui1154
    @kalvinwui1154 2 ปีที่แล้ว +1

    Appreciate for your help

    • @makeshiftsmarthome6748
      @makeshiftsmarthome6748  2 ปีที่แล้ว

      Thanks. Please be informed that one video will be uploaded soon to deal with adding NodeMCU in the newer version of ESPHome add-on since the method has been changed alot.

  • @KenIdo
    @KenIdo ปีที่แล้ว

    How to make the initial setting for led OFF after rebooting the nodemcu?

    • @makeshiftsmarthome6748
      @makeshiftsmarthome6748  ปีที่แล้ว

      Please check below link and try to use on_boot automation and make the led switched off when ESP is booted.
      esphome.io/components/esphome.html?highlight=on_boot

  • @springer0965
    @springer0965 3 ปีที่แล้ว

    Super erklärt
    Schnell zum nachbauen
    Bitte weiter Projekte mit Home Assistant und ESPHome (in Englisch)

  • @bearpawbite6836
    @bearpawbite6836 ปีที่แล้ว +1

    very helpful,thank u

  • @rickhehe
    @rickhehe 2 ปีที่แล้ว +1

    Thanks a lot!

  • @n.r.2258
    @n.r.2258 2 ปีที่แล้ว

    Hmm, my problem is, I have a reading in the esp protocol and the sensor shows up in HA, but it shows no value, instead it says on the Loveles card instead of value: unknown. (i made it with a distance sensor)

    • @makeshiftsmarthome6748
      @makeshiftsmarthome6748  2 ปีที่แล้ว

      Hi, I don't know exactly which distance sensor you are using. But in order to use a sensor, it has to be supported by esphome. in my video, my example is a simple on/off switch so that one gpio pin could measure voltage status and send binary state to HA. For distance sensor, it cannot be a simple on/off status. Possibly there's some protocol between NodeMCU and distance sensor to exchange value of the distance. If the sensor you are using is a ultrasonic distance sensor which is commonly used in DIY project, such as HC-SR04, I suggest you read the link and follow example. if your distance sensor is not a kind of this type, it might not be easy to use ESPHome. esphome.io/components/sensor/ultrasonic.html

    • @n.r.2258
      @n.r.2258 2 ปีที่แล้ว +1

      @@makeshiftsmarthome6748
      Thank you very much for your kind reply. I really appreciate it. Also thank you for the link.
      Yes, I am using the sensor and have also followed the linked specifications so far. I have tried both with a D1 mini and now with the nodmcuv2 and always got the same result.
      Sensor is visible, but no values are transmitted. Your instruction was reproducible so far and works very well as far as LED control is concerned. I had hoped to be able to apply it to transmitting values as well, but I guess I can't.
      I will stop my ESP experiments now, after 2 weeks of unsuccessful research and attempts.
      But thank you for your answer.

  • @giantbrain5793
    @giantbrain5793 ปีที่แล้ว

    how far wiring do you use from esp32 to magnetic door (in meter), i want to try to make 5 meter long from esp32 to magnetic door, maybe there are powerloss 5 volt.maybe you can share your experince about range your device, thanks

    • @makeshiftsmarthome6748
      @makeshiftsmarthome6748  ปีที่แล้ว

      Hi, for my home, wires were preinstalled inside walls from the utility room to all the ways to the windows and doors. They are definitely longer than 5m, and using magnetic door switches at the end of this wire doesn't cause any problem for my esp8266 detects opening and closing of windows and doors.

    • @giantbrain5793
      @giantbrain5793 ปีที่แล้ว

      @@makeshiftsmarthome6748 thanks alot.

  • @nics8040
    @nics8040 2 ปีที่แล้ว

    I’m getting a fail needs to be in download mode message. Do you know what’s wrong?

    • @makeshiftsmarthome6748
      @makeshiftsmarthome6748  2 ปีที่แล้ว

      Hi, thanks for watching my video and I am sorry to know that you are having a problem. Can you please tell me more specifically about 'being in download mode'? The way of adding ESP devices is keep changing in ESPHome and I uploaded another video(th-cam.com/video/nocvhj--l7s/w-d-xo.html) months ago to deal with a changed method. However, I noticed that there's some more changes afterwards.

  • @TheDjexcessive
    @TheDjexcessive ปีที่แล้ว +1

    Great video! I followed step by step and when uploading I get this error:
    Cannot resolve pin name 'D4' for board esp01_1m.
    pin: D4
    name: NodeMCU Internal LED
    id: internal_led
    This is also indicated in the yaml file. Any help would be highly appreciated!

    • @makeshiftsmarthome6748
      @makeshiftsmarthome6748  ปีที่แล้ว

      Hi, thanks for watching my video. For my video, I used NodeMCU ESP8266 and the name of the pin such as D4 was defined for that device. However, if you are using NodeMCU ESP32, the name of the pin is defined differently like GPIOXX. If you use and selected different type of the device, please check below link and correct it. If the issue still persists, please let me know. Thank you. esphome.io/devices/

    • @TheDjexcessive
      @TheDjexcessive ปีที่แล้ว

      @@makeshiftsmarthome6748 Thank you!

  • @chesshooligan1282
    @chesshooligan1282 ปีที่แล้ว

    OK, now I know how to send a boolean value to ESPHome. How do you send an integer or float value?

    • @makeshiftsmarthome6748
      @makeshiftsmarthome6748  ปีที่แล้ว +1

      If you are referring receiving and transmitting numerical value through sensor or display device, we usually use ESPHome library to do this. this is an example of getting distance info from Ultrasonic sensor attached to ESP device. esphome.io/components/sensor/ultrasonic.html
      If you want to send some character or number to a display device, you can refer to this example.
      esphome.io/components/display/max7219.html
      If you are referring different way of sending integer or float values, please give me more detail.

    • @chesshooligan1282
      @chesshooligan1282 ปีที่แล้ว +1

      @@makeshiftsmarthome6748 Thank you.

  • @hechmi
    @hechmi 15 วันที่ผ่านมา

    pin: D4 does not work anymore with new ESP-01 use pin: GPIO2 instead

  • @AntonioMarchina
    @AntonioMarchina 3 ปีที่แล้ว

    Can this be done with a D1 Mini?

    • @makeshiftsmarthome6748
      @makeshiftsmarthome6748  3 ปีที่แล้ว

      I didn't use D1 mini but since it is based on ESP8266, I think you can use it by selecting 'generic ESP8266' option from ESPHome.

  • @corporalmcmuffin7562
    @corporalmcmuffin7562 3 ปีที่แล้ว +1

    Using an mcu without code is like eating vegan ice cream

  • @basilbinu4933
    @basilbinu4933 2 ปีที่แล้ว

    wow really great video with great explanation. ❤❤
    Actually am planning on making my home smart with home assistant and esp8266.
    I am a begginer and dont know much. So can you please help me through the steps.
    I have some ideas in my mind which i wanna make in real but dont know how to do that.
    How can i contact you? Can you provide your email id?

    • @makeshiftsmarthome6748
      @makeshiftsmarthome6748  2 ปีที่แล้ว

      Hello Basil, thank you for watching my video. If you need a contact, you can click my channel page and hit information tab. There is a clickable text that reveals my e-mail address. Thank you.