{"id":28726,"date":"2026-04-12T13:18:13","date_gmt":"2026-04-12T13:18:13","guid":{"rendered":"https:\/\/www.horter.de\/blog\/?p=28726"},"modified":"2026-04-12T13:54:48","modified_gmt":"2026-04-12T13:54:48","slug":"mcp3424-mit-esphome-in-home-assistant","status":"publish","type":"post","link":"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/","title":{"rendered":"MCP3424 in Home Assistant mit ESPHome einbinden"},"content":{"rendered":"<p>Der MCP3424 ist ein pr\u00e4ziser 18-Bit-ADC mit vier analogen Eing\u00e4ngen und ideal, um Spannungen oder 4\u201320-mA-Sensoren in Home Assistant einzubinden.<br data-start=\"949\" data-end=\"952\" \/>In diesem Beitrag zeige ich dir Schritt f\u00fcr Schritt, wie du den MCP3424 mit ESPHome konfigurierst, an einen ESP8266 anschlie\u00dft und die Messwerte sauber im Home Assistant Dashboard darstellst.<br data-start=\"1145\" data-end=\"1148\" \/>Als Beispiel verwende ich unsere analoge Eingangskarte I2AE18 f\u00fcr die Hutschiene.<\/p>\n<p>Unsere Analoge Eingangskarte I2AE18 f\u00fcr Hutschienenmontage kann als Bausatz im Onlineshop bezogen werden. <a href=\"https:\/\/www.horter-shop.de\/de\/i2c-hutschienen-module\/249-453-bausatz-i2c-analog-input-4-kanal-18-bit-mit-mcp3424-4260404260899.html\" target=\"_blank\" rel=\"noopener\">Bausatz I2C Analog Input 4 Kanal 18 Bit mit MCP3424<\/a><\/p>\n<p>Als I2C-Master wird dieses mal der <strong>I2C-Master<\/strong> f\u00fcr NodeMCU ESP8266-12F verwendet.<\/p>\n<p>Am Ende des Beitrags steht eine vollst\u00e4ndige YAML-Datei zum Download sowie ein Beispiel, wie die Aufl\u00f6sung des MCP3424 eingestellt und die Messwerte in Home Assistant dargestellt werden.<\/p>\n<h2>Schaltplan Analoge Eingangskarte I2AE18 mit MCP3424<\/h2>\n<p>Einens Schaltplan zum Modul findest du hier:\u00a0<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.horter-shop.de\/images\/pdf_icon_mini.png\" alt=\"\" width=\"45\" height=\"45\" \/><a href=\"http:\/\/www.horter.de\/doku\/i2c-hs-analog-in_18Bit_db.pdf\" target=\"_blank\" rel=\"noreferrer noopener\">Datenblatt<\/a><\/strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<strong><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.horter-shop.de\/images\/pdf_icon_mini.png\" alt=\"\" width=\"45\" height=\"45\" \/>\u00a0<a href=\"http:\/\/www.horter.de\/doku\/i2c-hs-analog-in_18Bit_sp.pdf\" target=\"_blank\" rel=\"noreferrer noopener\">Schaltplan<\/a><\/strong><\/p>\n\n\n<h2 class=\"wp-block-heading\">Hardware I2C-Master f\u00fcr NodeMCU ESP8266-12F<\/h2>\n\n\n\n<figure class=\"wp-block-image size-medium\"><a href=\"https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/01\/perspektiv_SKMCU-1.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"300\" src=\"https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/01\/perspektiv_SKMCU-1-300x300.jpg\" alt=\"ESP8266 Modul f\u00fcr die Hutschiene\" class=\"wp-image-28675\" srcset=\"https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/01\/perspektiv_SKMCU-1-300x300.jpg 300w, https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/01\/perspektiv_SKMCU-1-150x150.jpg 150w, https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/01\/perspektiv_SKMCU-1-125x125.jpg 125w, https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/01\/perspektiv_SKMCU-1.jpg 760w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption class=\"wp-element-caption\">ESP8266 Modul f\u00fcr die Hutschiene<\/figcaption><\/figure>\n\n\n<p>Der Bausatz <a href=\"https:\/\/www.horter-shop.de\/de\/i2c-master-module\/304-568-bausatz-esp8266-i2c-master-fuer-nodemcu-esp8266-12f-4260404260936.html\" target=\"_blank\" rel=\"noopener\">Bausatz ESP8266 I2C-Master f\u00fcr NodeMCU ESP8266-12F<\/a> hat den Pegelwandler PCA9517 on Board, der die I2C-Signale von der <strong>ESP8266 Node-MCU <\/strong>von 3,3 auf 5V anhebt. An drei Status-LEDs kann man die Pegel der I2C-SIgnale <strong><span style=\"color: #008000;\">SDA<\/span><\/strong>, <strong><span style=\"color: #ffcc00;\">SCL<\/span> <\/strong>und <strong><span style=\"color: #ff0000;\">INT<\/span> <\/strong>beobachten.<\/p>\n<p>\u00dcber unsere Busverbindern lassen sich die neueren E\/A-Module im Handumdrehen mit dem Master verbinden.<br \/>Die &#8222;\u00e4lteren&#8220; SPS-Baugruppen k\u00f6nnen wie gewohnt \u00fcber den Stecker verkabelt werden.<\/p>\n\n\n<h2 class=\"wp-block-heading\">Aufbau der Peripherie<\/h2>\n\n\n\n<figure class=\"wp-block-image size-medium\"><a href=\"https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/04\/I2NO2_AE18-Aufbau.png\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"251\" src=\"https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/04\/I2NO2_AE18-Aufbau-300x251.png\" alt=\"Hardware-Aufbau I2NO2-Testboard mit MCP3424\" class=\"wp-image-28728\" srcset=\"https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/04\/I2NO2_AE18-Aufbau-300x251.png 300w, https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/04\/I2NO2_AE18-Aufbau-150x126.png 150w, https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/04\/I2NO2_AE18-Aufbau.png 564w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/figure>\n\n\n<h2>ESPHome in Home Assistant<\/h2>\n<p>Voraussetzung f\u00fcr die Funktion ist, dass ESPHome in Home Assistant installiert und gestartet ist.<br \/>Eine Anleitung gibt es hier: Getting Started with ESPHome and Home Assistant<\/p>\n<p>Zus\u00e4tzlich habe ich den File editor installiert. Mit ihm kann man Konfigurations-Dateien wie z.B. die Datei <strong>secrets.yaml<\/strong> anlegen und editieren.<\/p>\n<h2>Neuen ESP8266 in ESPHome anlegen<\/h2>\n<p>Um einen neuen ESP8266 in ESPHome f\u00fcr Home Assistant einzurichten, gehst du folgenderma\u00dfen vor:<\/p>\n<ul>\n<li>ESPHome Dashboard \u00f6ffnen:<br \/>In Home Assistant \u00f6ffnest du das ESPHome\u2011Add\u2011on (oben in der Seitenleiste). Dort siehst du eine \u00dcbersicht deiner ESP\u2011Boards.<\/li>\n<li>Neues Ger\u00e4t erstellen:<br \/>Klicke auf \u201e+ New Device\u201c oder \u201eGer\u00e4t hinzuf\u00fcgen\u201c.<br \/>Du wirst durch einen kleinen Assistenten gef\u00fchrt:<br \/>\u2013 Gib einen Ger\u00e4tenamen ein (z.\u202fB. i2no2-testboard).<br \/>\u2013 W\u00e4hle den Board\u2011Typ aus \u2013 f\u00fcr den I2NO2-Bausatz ist das der esp8266<br \/>\u2013 Trage dein WLAN SSID und Passwort ein oder verwende die Datei <strong>secrets.yaml<\/strong> f\u00fcr alle Passw\u00f6rter<\/li>\n<li>Erste Konfiguration speichern:<br \/>Nach Abschluss erstellt ESPHome f\u00fcr dich eine Basis\u2011YAML\u2011Datei \u2013 du kannst sie im Editor \u00f6ffnen und nach deinen Bed\u00fcrfnissen erweitern.<\/li>\n<li>Firmware installieren:<br \/>Verbinde den ESP per USB am Besten mit dem Ger\u00e4t, auf dem Home Assistant l\u00e4uft. Das funktioniert am einfachsten.<br \/>Klicke im Dashboard auf \u201eInstall\u201c \u2192 \u201ePlug into the computer running ESPHome Device Builder\u201c und folge den Anweisungen.<br \/>ESPHome kompiliert die Firmware und spielt sie auf die ESP8266 Node-MCU.<\/li>\n<li>Verbinden mit Home Assistant:<br \/>Sobald der ESP gestartet ist und sich mit deinem WLAN verbunden hat, sollte Home Assistant das Ger\u00e4t automatisch erkennen.<br \/>Alternativ kannst du es manuell \u00fcber Einstellungen \u2192 Ger\u00e4te &amp; Dienste \u2192 Integration hinzuf\u00fcgen \u2192 ESPHome eintragen.<\/li>\n<\/ul>\n<p>Nach dem ersten Flashen kannst du weitere \u00c4nderungen drahtlos Over\u2011The\u2011Air (OTA) aktualisieren \u2013 das erspart erneutes USB\u2011Anschlie\u00dfen.<\/p>\n<h2>YAML-Datei anpassen<\/h2>\n<p>In der automatisch von ESPHome angelegten Konfigurationsdatei m\u00fcssen jetzt einige Eintragungen vorgenommen werden.<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; title: ; notranslate\" title=\"\">\nesphome:\n  name: i2no2-testboard\n  friendly_name: I2NO2-Testboard\n\nesp8266:\n  board: nodemcuv2\n\n# Enable logging\nlogger:\n  level: DEBUG\n  logs:\n    sensor: ERROR # Unterdr\u00fcckt die &quot;Sending state&quot;-Meldungen im Log-Fenster\n\n# Sensible Daten sind in der Datei &quot;secrets.yaml&quot; abgelegt\n# ========================================================\n# Enable Home Assistant API\napi:\n  encryption:\n    key: !secret i2no2_api_key\n\nota:\n  - platform: esphome\n    password: !secret i2no2_ota_password\n\nwifi:\n  ssid: !secret wifi_ssid\n  password: !secret wifi_password\n\ncaptive_portal:\n    \n# ========= I2C-Pins festlegen ========= # \ni2c:\n  id: i2c_bus\n  sda: 4\n  scl: 5\n  scan: true\n  frequency: 70000\n\n# ========= Aufl\u00f6sung und Adresse vom MCP3424 festlegen ========= # \nsubstitutions:\n  mcp_address:     &quot;0x68&quot;   # I2C-Adresse des MCP3424 (0x68 \u2013 0x6F m\u00f6glich)\n  voltage_divider: &quot;5.0&quot;    # Spannungsteiler auf dem Board (1:5 \u2192 Faktor 5)\n\n\n# ========= Globale Variablen anlegen ========= # \nglobals:\n  - id: mcp_channel         # Aktuell gemessener Kanal (0 = CH1 \u2026 3 = CH4)\n    type: int\n    initial_value: &#039;0&#039;\n\n  - id: mcp_values          # Letzte Messwerte in Volt je Kanal\n    type: float&#x5B;4]\n\n  - id: mcp_busy            # true = Messung l\u00e4uft, noch kein Ergebnis\n    type: bool\n    initial_value: &#039;false&#039;\n\n  - id: mcp_resolution_idx  # Aufl\u00f6sung: 0=12Bit  1=14Bit  2=16Bit  3=18Bit\n    type: int\n    initial_value: &#039;3&#039;      # Standard: 18 Bit (h\u00f6chste Aufl\u00f6sung)\n\n  - id: mcp_gain_idx        # PGA-Verst\u00e4rkung: 0=1x  1=2x  2=4x  3=8x\n    type: int\n    initial_value: &#039;0&#039;      # Standard: 1x (kein Gain, voller Eingangsbereich)\n\n\n# \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n#  Auswahl-Entit\u00e4ten \u2013 in Home Assistant sichtbar und \u00e4nderbar\n# \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nselect:\n  # Aufl\u00f6sung \/ Sample-Rate des MCP3424\n  # Je h\u00f6her die Aufl\u00f6sung, desto langsamer die Messung\n  - platform: template\n    name: &quot;MCP3424 Aufl\u00f6sung&quot;\n    id: sel_resolution\n    options:\n      - &quot;12 Bit  (240 SPS)&quot;    # schnellste Messung, geringste Aufl\u00f6sung\n      - &quot;14 Bit  ( 60 SPS)&quot;\n      - &quot;16 Bit  ( 15 SPS)&quot;\n      - &quot;18 Bit  (3.75 SPS)&quot;   # langsamste Messung, h\u00f6chste Aufl\u00f6sung\n    initial_option: &quot;18 Bit  (3.75 SPS)&quot;\n    restore_value: true\n    optimistic: true\n    on_value:\n      then:\n        - globals.set:\n            id: mcp_resolution_idx\n            value: !lambda &#039;return (int)id(sel_resolution).active_index().value_or(3);&#039;\n\n\n# ========= Hauptprogramm MCP3424-Messwerte lesen ========= # \n\n  # \u2500\u2500 MCP3424 Messmotor \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n  #  Dieser interne Sensor liest die vier Kan\u00e4le des MCP3424\n  #  nacheinander im One-Shot-Verfahren aus und speichert die\n  #  umgerechneten Spannungswerte in mcp_values&#x5B;0..3].\n  #  Er ist in Home Assistant nicht sichtbar (internal: true).\n  # \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nsensor:\n  - platform: template\n    name: &quot;MCP3424 Engine&quot;\n    internal: true\n    update_interval: 100ms\n    lambda: |-\n      const uint8_t ADDR = ${mcp_address};\n      const float DIVIDER = ${voltage_divider};\n\n      int ch = id(mcp_channel);\n      int res_idx = id(mcp_resolution_idx);\n      int gain_idx = id(mcp_gain_idx);\n\n      int data_bytes = (res_idx == 3) ? 3 : 2;\n\n      uint8_t config = 0x80\n        | (ch &lt;&lt; 5)\n        | (res_idx &lt;&lt; 2)\n        | gain_idx;\n\n      if (!id(mcp_busy)) {\n        id(i2c_bus).write(ADDR, &amp;config, 1);\n        id(mcp_busy) = true;\n        return id(mcp_values)&#x5B;ch];\n      }\n\n      uint8_t data&#x5B;4] = {0};\n      id(i2c_bus).read(ADDR, data, data_bytes + 1);\n\n      if (data&#x5B;data_bytes] &amp; 0x80) {\n        return id(mcp_values)&#x5B;ch];\n      }\n\n      int32_t raw = 0;\n\n      switch (res_idx) {\n        case 0: {  \/\/ 12 Bit\n          raw = ((uint16_t)data&#x5B;0] &lt;&lt; 8) | data&#x5B;1];\n          raw &amp;= 0x0FFF;\n          if (raw &amp; 0x0800) raw -= 0x1000;  \/\/ Vorzeichen erweitern\n          break;\n        }\n\n        case 1: {  \/\/ 14 Bit\n          raw = ((uint16_t)data&#x5B;0] &lt;&lt; 8) | data&#x5B;1];\n          raw &amp;= 0x3FFF;\n          if (raw &amp; 0x2000) raw -= 0x4000;  \/\/ Vorzeichen erweitern\n          break;\n        }\n\n        case 2: {  \/\/ 16 Bit\n          raw = ((int16_t)data&#x5B;0] &lt;&lt; 8) | data&#x5B;1];\n          if (raw &amp; 0x8000) raw -= 0x10000;\n          break;\n        }\n\n        case 3: {  \/\/ 18 Bit\n          raw = ((int32_t)(data&#x5B;0] &amp; 0x03) &lt;&lt; 16) | ((int32_t)data&#x5B;1] &lt;&lt; 8) | data&#x5B;2];\n          if (raw &amp; 0x20000) raw -= 0x40000;\n          break;\n        }\n      }\n\n      static const int res_bits&#x5B;] = {12, 14, 16, 18};\n      int gain_val = 1 &lt;&lt; gain_idx;\n      float lsb = 2.048f \/ (float)(1 &lt;&lt; (res_bits&#x5B;res_idx] - 1)) \/ gain_val;\n      float voltage = (float)raw * lsb * DIVIDER;\n\n      id(mcp_values)&#x5B;ch] = voltage;\n      id(mcp_channel) = (ch + 1) % 4;\n      id(mcp_busy) = false;\n\n      switch (ch) {\n        case 0: id(sensor_ch1).publish_state(voltage); break;\n        case 1: id(sensor_ch2).publish_state(voltage); break;\n        case 2: id(sensor_ch3).publish_state(voltage); break;\n        case 3: id(sensor_ch4).publish_state(voltage); break;\n      }\n      return NAN;\n\n\n# ========= Hier werden die Anzeigen der Messwerte vom MCP3424 konfiguriert ========= # \n  - platform: template\n    name: &quot;MCP3424 Kanal 1&quot;\n    id: sensor_ch1\n    unit_of_measurement: &quot;V&quot;\n    accuracy_decimals: 2\n    filters: \n      - delta: 0.1\n    on_value:\n      then:\n        - logger.log:\n            format: &quot;MCP3424 Kanal 1: %.2f V&quot;\n            args: &#x5B;&#039;x&#039;]\n\n  - platform: template\n    name: &quot;MCP3424 Kanal 2&quot;\n    id: sensor_ch2\n    unit_of_measurement: &quot;V&quot;\n    accuracy_decimals: 2\n    filters: \n      - delta: 0.1\n    on_value:\n      then:\n        - logger.log:\n            format: &quot;MCP3424 Kanal 2: %.2f V&quot;\n            args: &#x5B;&#039;x&#039;]\n\n  - platform: template\n    name: &quot;MCP3424 Kanal 3&quot;\n    id: sensor_ch3\n    unit_of_measurement: &quot;V&quot;\n    accuracy_decimals: 2\n    filters: \n      - delta: 0.1\n    on_value:\n      then:\n        - logger.log:\n            format: &quot;MCP3424 Kanal 3: %.2f V&quot;\n            args: &#x5B;&#039;x&#039;]\n\n  - platform: template\n    name: &quot;MCP3424 Kanal 4&quot;\n    id: sensor_ch4\n    unit_of_measurement: &quot;V&quot;\n    accuracy_decimals: 2\n    filters: \n      - delta: 0.1\n    on_value:\n      then:\n        - logger.log:\n            format: &quot;MCP3424 Kanal 4: %.2f V&quot;\n            args: &#x5B;&#039;x&#039;]\n\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">Ansicht im Home Assistant Dashboard<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/04\/I2NO2_I2AE18-HomeAssistant_Dashboard.png\"><img loading=\"lazy\" decoding=\"async\" width=\"339\" height=\"444\" src=\"https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/04\/I2NO2_I2AE18-HomeAssistant_Dashboard.png\" alt=\"I2NO2+I2AE18-HomeAssistant Dashboard\" class=\"wp-image-28731\" srcset=\"https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/04\/I2NO2_I2AE18-HomeAssistant_Dashboard.png 339w, https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/04\/I2NO2_I2AE18-HomeAssistant_Dashboard-229x300.png 229w, https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/04\/I2NO2_I2AE18-HomeAssistant_Dashboard-115x150.png 115w\" sizes=\"auto, (max-width: 339px) 100vw, 339px\" \/><\/a><\/figure>\n\n\n<h2>Komplette YAML-Datei zum Download<\/h2>\n<table style=\"border-collapse: collapse; width: 100%;\">\n<tbody>\n<tr>\n<td style=\"width: 11.1221%;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-28376\" src=\"https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/01\/YAML-Icon.png&quot;\" alt=\"\" width=\"70\" height=\"69\" \/><\/td>\n<td style=\"width: 88.8779%;\">Hier kann die komplette YAML-Datei f\u00fcr das I2NO2_I2AE18-Testboard heruntergeladen werden. <br \/><a  data-e-Disable-Page-Transition=\"true\" class=\"download-link\" title=\"\" href=\"https:\/\/www.horter.de\/blog\/download\/28735\/?tmstv=1776324923\" rel=\"nofollow\" id=\"download-link-28735\" data-redirect=\"false\" >\n\tYAML_I2NO2-I2AE18-Testboard.zip\t(3 Downloads\t)\n<\/a>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Ich w\u00fcrde die nicht in ESPHome direkt importieren sondern besser in einem Editor wie Notepad++ \u00f6ffnen und in die vorbereitete Konfigurationsdatei rein kopieren ..um die bestehende substitutions und wifi Struktur deiner eigenen Installation nicht zu \u00fcberschreiben.<\/p>\n<p><strong>Achtung:<\/strong><br \/>Wie bereits oben besprochen, sind in der YAML-Datei meine sicherheitsrelevanten Daten nicht mit enthalten. Ich habe die in meinem ESPHome in einer separaten Datei <strong>secrets.yaml<\/strong> abgespeichert.<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: yaml; title: ; notranslate\" title=\"\">\n# Sensible Daten sind in der Datei &quot;secrets.yaml&quot; abgelegt\n# ========================================================\n# Enable Home Assistant API\napi:\n  encryption:\n    key: !secret i2no2_api_key\n\nota:\n  - platform: esphome\n    password: !secret i2no2_ota_password\n\nwifi:\n  ssid: !secret wifi_ssid\n  password: !secret wifi_password\n<\/pre><\/div>\n\n\n<p>Die <strong>secrets.yaml<\/strong> muss im gleichen Ordner liegen wie die Konfigurationsdatei vom ESP!<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">\/config\/\n\u2514\u2500\u2500 esphome\/\n    \u251c\u2500\u2500 I2NO2-Testboard.yaml  &lt;-- Deine Hauptdatei\n    \u2514\u2500\u2500 secrets.yaml          &lt;-- Hier m\u00fcssen <span class=\"hljs-keyword\">die<\/span> Zugangsdaten rein<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code-Sprache:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Fazit<\/h2>\n\n\n\n<p>Mit ESPHome lassen sich auch eigene oder spezielle I2C-Module sehr flexibel in Home Assistant integrieren \u2013 selbst dann, wenn es daf\u00fcr keine fertigen Komponenten gibt.<br>Durch den Einsatz von template-Sensoren, und etwas lambda-Code k\u00f6nnen analoge und digitale Signale sauber abgebildet und gesteuert werden.<\/p>\n\n\n\n<p>Die hier gezeigte YAML-Struktur dient als Grundlage, die sich leicht auf weitere Module, Kan\u00e4le oder Projekte erweitern l\u00e4sst.<br>So entsteht eine transparente, wartbare L\u00f6sung, bei der Hardware-Funktion und Home-Assistant-Darstellung klar miteinander verkn\u00fcpft sind.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Der MCP3424 ist ein pr\u00e4ziser 18-Bit-ADC mit vier analogen Eing\u00e4ngen und ideal, um Spannungen oder 4\u201320-mA-Sensoren in Home Assistant einzubinden.In diesem Beitrag zeige ich dir Schritt f\u00fcr Schritt, wie du den MCP3424 mit ESPHome konfigurierst, an einen ESP8266 anschlie\u00dft und&#8230; <a class=\"continue-reading-link\" href=\"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/\">mehr lesen<\/a><\/p>\n","protected":false},"author":3,"featured_media":28419,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[306,287],"tags":[308,309,310,230,316,286,314,302,312,7,315,114,313,231,311,307,85],"class_list":["post-28726","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-home_assistant","category-i2c-master","tag-12-bit-2","tag-14-bit-2","tag-16-bit-2","tag-18-bit","tag-4-20-ma-sensor-mit-esphome","tag-ad-wandler","tag-analogwerte-in-home-assistant-auslesen","tag-esp8266","tag-esphome-mcp3424-konfigurieren","tag-i2c","tag-i2c-adc-esphome","tag-i2c-bus","tag-mcp-yaml-beispiel","tag-mcp3424","tag-mcp3424-in-home-assistant-einbinden","tag-node-mcu","tag-raspberry-pi"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>MCP3424 in Home Assistant mit ESPHome einbinden - Horter &amp; Kalb Blog<\/title>\n<meta name=\"description\" content=\"\u201eAnleitung: So binden Sie das MCP3424 18-Bit Analog-Input-Modul von Horter &amp; Kalb via ESPHome in Home Assistant ein. Inkl. YAML-Konfiguration &amp; Schaltplan.\u201c\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MCP3424 in Home Assistant mit ESPHome einbinden - Horter &amp; Kalb Blog\" \/>\n<meta property=\"og:description\" content=\"\u201eAnleitung: So binden Sie das MCP3424 18-Bit Analog-Input-Modul von Horter &amp; Kalb via ESPHome in Home Assistant ein. Inkl. YAML-Konfiguration &amp; Schaltplan.\u201c\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/\" \/>\n<meta property=\"og:site_name\" content=\"Horter &amp; Kalb Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-04-12T13:18:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-12T13:54:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/01\/ESPH-Logo_250.png\" \/>\n\t<meta property=\"og:image:width\" content=\"250\" \/>\n\t<meta property=\"og:image:height\" content=\"252\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"JH\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Verfasst von\" \/>\n\t<meta name=\"twitter:data1\" content=\"JH\" \/>\n\t<meta name=\"twitter:label2\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data2\" content=\"6\u00a0Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/\"},\"author\":{\"name\":\"JH\",\"@id\":\"https:\/\/www.horter.de\/blog\/#\/schema\/person\/a8a4c3c5d3167dce7c7d31df6088b5d2\"},\"headline\":\"MCP3424 in Home Assistant mit ESPHome einbinden\",\"datePublished\":\"2026-04-12T13:18:13+00:00\",\"dateModified\":\"2026-04-12T13:54:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/\"},\"wordCount\":752,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.horter.de\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/01\/ESPH-Logo_250.png\",\"keywords\":[\"12-Bit\",\"14-Bit\",\"16-Bit\",\"18-Bit\",\"4\u201320 mA Sensor mit ESPHome\",\"AD-Wandler\",\"Analogwerte in Home Assistant auslesen\",\"ESP8266\",\"ESPHome MCP3424 konfigurieren\",\"I2C\",\"I2C ADC ESPHome\",\"I2C-Bus\",\"MCP YAML Beispiel\",\"MCP3424\",\"MCP3424 in Home Assistant einbinden\",\"Node-MCU\",\"raspberry pi\"],\"articleSection\":[\"Home Assistant\",\"I2C-Master\"],\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/\",\"url\":\"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/\",\"name\":\"MCP3424 in Home Assistant mit ESPHome einbinden - Horter &amp; Kalb Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.horter.de\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/01\/ESPH-Logo_250.png\",\"datePublished\":\"2026-04-12T13:18:13+00:00\",\"dateModified\":\"2026-04-12T13:54:48+00:00\",\"description\":\"\u201eAnleitung: So binden Sie das MCP3424 18-Bit Analog-Input-Modul von Horter & Kalb via ESPHome in Home Assistant ein. Inkl. YAML-Konfiguration & Schaltplan.\u201c\",\"breadcrumb\":{\"@id\":\"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/#primaryimage\",\"url\":\"https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/01\/ESPH-Logo_250.png\",\"contentUrl\":\"https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/01\/ESPH-Logo_250.png\",\"width\":250,\"height\":252,\"caption\":\"ESPHome Logo\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Start\",\"item\":\"https:\/\/www.horter.de\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MCP3424 in Home Assistant mit ESPHome einbinden\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.horter.de\/blog\/#website\",\"url\":\"https:\/\/www.horter.de\/blog\/\",\"name\":\"Horter & Kalb Blog\",\"description\":\"SPS, I2C und mehr\",\"publisher\":{\"@id\":\"https:\/\/www.horter.de\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.horter.de\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"de\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.horter.de\/blog\/#organization\",\"name\":\"Horter & Kalb Blog\",\"url\":\"https:\/\/www.horter.de\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/www.horter.de\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/01\/hoka_Icon_400x400.png\",\"contentUrl\":\"https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/01\/hoka_Icon_400x400.png\",\"width\":400,\"height\":400,\"caption\":\"Horter & Kalb Blog\"},\"image\":{\"@id\":\"https:\/\/www.horter.de\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.horter.de\/blog\/#\/schema\/person\/a8a4c3c5d3167dce7c7d31df6088b5d2\",\"name\":\"JH\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/www.horter.de\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2015\/07\/jhfb.jpg\",\"contentUrl\":\"https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2015\/07\/jhfb.jpg\",\"caption\":\"JH\"},\"url\":\"https:\/\/www.horter.de\/blog\/author\/j-horter\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MCP3424 in Home Assistant mit ESPHome einbinden - Horter &amp; Kalb Blog","description":"\u201eAnleitung: So binden Sie das MCP3424 18-Bit Analog-Input-Modul von Horter & Kalb via ESPHome in Home Assistant ein. Inkl. YAML-Konfiguration & Schaltplan.\u201c","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/","og_locale":"de_DE","og_type":"article","og_title":"MCP3424 in Home Assistant mit ESPHome einbinden - Horter &amp; Kalb Blog","og_description":"\u201eAnleitung: So binden Sie das MCP3424 18-Bit Analog-Input-Modul von Horter & Kalb via ESPHome in Home Assistant ein. Inkl. YAML-Konfiguration & Schaltplan.\u201c","og_url":"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/","og_site_name":"Horter &amp; Kalb Blog","article_published_time":"2026-04-12T13:18:13+00:00","article_modified_time":"2026-04-12T13:54:48+00:00","og_image":[{"width":250,"height":252,"url":"https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/01\/ESPH-Logo_250.png","type":"image\/png"}],"author":"JH","twitter_card":"summary_large_image","twitter_misc":{"Verfasst von":"JH","Gesch\u00e4tzte Lesezeit":"6\u00a0Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/#article","isPartOf":{"@id":"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/"},"author":{"name":"JH","@id":"https:\/\/www.horter.de\/blog\/#\/schema\/person\/a8a4c3c5d3167dce7c7d31df6088b5d2"},"headline":"MCP3424 in Home Assistant mit ESPHome einbinden","datePublished":"2026-04-12T13:18:13+00:00","dateModified":"2026-04-12T13:54:48+00:00","mainEntityOfPage":{"@id":"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/"},"wordCount":752,"commentCount":0,"publisher":{"@id":"https:\/\/www.horter.de\/blog\/#organization"},"image":{"@id":"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/#primaryimage"},"thumbnailUrl":"https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/01\/ESPH-Logo_250.png","keywords":["12-Bit","14-Bit","16-Bit","18-Bit","4\u201320 mA Sensor mit ESPHome","AD-Wandler","Analogwerte in Home Assistant auslesen","ESP8266","ESPHome MCP3424 konfigurieren","I2C","I2C ADC ESPHome","I2C-Bus","MCP YAML Beispiel","MCP3424","MCP3424 in Home Assistant einbinden","Node-MCU","raspberry pi"],"articleSection":["Home Assistant","I2C-Master"],"inLanguage":"de","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/","url":"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/","name":"MCP3424 in Home Assistant mit ESPHome einbinden - Horter &amp; Kalb Blog","isPartOf":{"@id":"https:\/\/www.horter.de\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/#primaryimage"},"image":{"@id":"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/#primaryimage"},"thumbnailUrl":"https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/01\/ESPH-Logo_250.png","datePublished":"2026-04-12T13:18:13+00:00","dateModified":"2026-04-12T13:54:48+00:00","description":"\u201eAnleitung: So binden Sie das MCP3424 18-Bit Analog-Input-Modul von Horter & Kalb via ESPHome in Home Assistant ein. Inkl. YAML-Konfiguration & Schaltplan.\u201c","breadcrumb":{"@id":"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/"]}]},{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/#primaryimage","url":"https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/01\/ESPH-Logo_250.png","contentUrl":"https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/01\/ESPH-Logo_250.png","width":250,"height":252,"caption":"ESPHome Logo"},{"@type":"BreadcrumbList","@id":"https:\/\/www.horter.de\/blog\/mcp3424-mit-esphome-in-home-assistant\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Start","item":"https:\/\/www.horter.de\/blog\/"},{"@type":"ListItem","position":2,"name":"MCP3424 in Home Assistant mit ESPHome einbinden"}]},{"@type":"WebSite","@id":"https:\/\/www.horter.de\/blog\/#website","url":"https:\/\/www.horter.de\/blog\/","name":"Horter & Kalb Blog","description":"SPS, I2C und mehr","publisher":{"@id":"https:\/\/www.horter.de\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.horter.de\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"de"},{"@type":"Organization","@id":"https:\/\/www.horter.de\/blog\/#organization","name":"Horter & Kalb Blog","url":"https:\/\/www.horter.de\/blog\/","logo":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/www.horter.de\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/01\/hoka_Icon_400x400.png","contentUrl":"https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2026\/01\/hoka_Icon_400x400.png","width":400,"height":400,"caption":"Horter & Kalb Blog"},"image":{"@id":"https:\/\/www.horter.de\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.horter.de\/blog\/#\/schema\/person\/a8a4c3c5d3167dce7c7d31df6088b5d2","name":"JH","image":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/www.horter.de\/blog\/#\/schema\/person\/image\/","url":"https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2015\/07\/jhfb.jpg","contentUrl":"https:\/\/www.horter.de\/blog\/wp-content\/uploads\/2015\/07\/jhfb.jpg","caption":"JH"},"url":"https:\/\/www.horter.de\/blog\/author\/j-horter\/"}]}},"_links":{"self":[{"href":"https:\/\/www.horter.de\/blog\/wp-json\/wp\/v2\/posts\/28726","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.horter.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.horter.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.horter.de\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.horter.de\/blog\/wp-json\/wp\/v2\/comments?post=28726"}],"version-history":[{"count":11,"href":"https:\/\/www.horter.de\/blog\/wp-json\/wp\/v2\/posts\/28726\/revisions"}],"predecessor-version":[{"id":28748,"href":"https:\/\/www.horter.de\/blog\/wp-json\/wp\/v2\/posts\/28726\/revisions\/28748"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.horter.de\/blog\/wp-json\/wp\/v2\/media\/28419"}],"wp:attachment":[{"href":"https:\/\/www.horter.de\/blog\/wp-json\/wp\/v2\/media?parent=28726"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.horter.de\/blog\/wp-json\/wp\/v2\/categories?post=28726"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.horter.de\/blog\/wp-json\/wp\/v2\/tags?post=28726"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}