diff --git a/tests/components/qmc5883l/common.yaml b/tests/components/qmc5883l/common.yaml
new file mode 100644
index 0000000000..5d8ac73b4f
--- /dev/null
+++ b/tests/components/qmc5883l/common.yaml
@@ -0,0 +1,21 @@
+i2c:
+  - id: i2c_qmc5883l
+    scl: ${scl_pin}
+    sda: ${sda_pin}
+
+sensor:
+  - platform: qmc5883l
+    address: 0x0D
+    field_strength_x:
+      name: QMC5883L Field Strength X
+    field_strength_y:
+      name: QMC5883L Field Strength Y
+    field_strength_z:
+      name: QMC5883L Field Strength Z
+    heading:
+      name: QMC5883L Heading
+    temperature:
+      name: QMC5883L Temperature
+    range: 800uT
+    oversampling: 256x
+    update_interval: 15s
diff --git a/tests/components/qmc5883l/test.esp32-ard.yaml b/tests/components/qmc5883l/test.esp32-ard.yaml
index 9acd391497..63c3bd6afd 100644
--- a/tests/components/qmc5883l/test.esp32-ard.yaml
+++ b/tests/components/qmc5883l/test.esp32-ard.yaml
@@ -1,21 +1,5 @@
-i2c:
-  - id: i2c_qmc5883l
-    scl: 16
-    sda: 17
+substitutions:
+  scl_pin: GPIO16
+  sda_pin: GPIO17
 
-sensor:
-  - platform: qmc5883l
-    address: 0x0D
-    field_strength_x:
-      name: QMC5883L Field Strength X
-    field_strength_y:
-      name: QMC5883L Field Strength Y
-    field_strength_z:
-      name: QMC5883L Field Strength Z
-    heading:
-      name: QMC5883L Heading
-    temperature:
-      name: QMC5883L Temperature
-    range: 800uT
-    oversampling: 256x
-    update_interval: 15s
+<<: !include common.yaml
diff --git a/tests/components/qmc5883l/test.esp32-c3-ard.yaml b/tests/components/qmc5883l/test.esp32-c3-ard.yaml
index 841bbd5d1e..ee2c29ca4e 100644
--- a/tests/components/qmc5883l/test.esp32-c3-ard.yaml
+++ b/tests/components/qmc5883l/test.esp32-c3-ard.yaml
@@ -1,21 +1,5 @@
-i2c:
-  - id: i2c_qmc5883l
-    scl: 5
-    sda: 4
+substitutions:
+  scl_pin: GPIO5
+  sda_pin: GPIO4
 
-sensor:
-  - platform: qmc5883l
-    address: 0x0D
-    field_strength_x:
-      name: QMC5883L Field Strength X
-    field_strength_y:
-      name: QMC5883L Field Strength Y
-    field_strength_z:
-      name: QMC5883L Field Strength Z
-    heading:
-      name: QMC5883L Heading
-    temperature:
-      name: QMC5883L Temperature
-    range: 800uT
-    oversampling: 256x
-    update_interval: 15s
+<<: !include common.yaml
diff --git a/tests/components/qmc5883l/test.esp32-c3-idf.yaml b/tests/components/qmc5883l/test.esp32-c3-idf.yaml
index 841bbd5d1e..ee2c29ca4e 100644
--- a/tests/components/qmc5883l/test.esp32-c3-idf.yaml
+++ b/tests/components/qmc5883l/test.esp32-c3-idf.yaml
@@ -1,21 +1,5 @@
-i2c:
-  - id: i2c_qmc5883l
-    scl: 5
-    sda: 4
+substitutions:
+  scl_pin: GPIO5
+  sda_pin: GPIO4
 
-sensor:
-  - platform: qmc5883l
-    address: 0x0D
-    field_strength_x:
-      name: QMC5883L Field Strength X
-    field_strength_y:
-      name: QMC5883L Field Strength Y
-    field_strength_z:
-      name: QMC5883L Field Strength Z
-    heading:
-      name: QMC5883L Heading
-    temperature:
-      name: QMC5883L Temperature
-    range: 800uT
-    oversampling: 256x
-    update_interval: 15s
+<<: !include common.yaml
diff --git a/tests/components/qmc5883l/test.esp32-idf.yaml b/tests/components/qmc5883l/test.esp32-idf.yaml
index 9acd391497..63c3bd6afd 100644
--- a/tests/components/qmc5883l/test.esp32-idf.yaml
+++ b/tests/components/qmc5883l/test.esp32-idf.yaml
@@ -1,21 +1,5 @@
-i2c:
-  - id: i2c_qmc5883l
-    scl: 16
-    sda: 17
+substitutions:
+  scl_pin: GPIO16
+  sda_pin: GPIO17
 
-sensor:
-  - platform: qmc5883l
-    address: 0x0D
-    field_strength_x:
-      name: QMC5883L Field Strength X
-    field_strength_y:
-      name: QMC5883L Field Strength Y
-    field_strength_z:
-      name: QMC5883L Field Strength Z
-    heading:
-      name: QMC5883L Heading
-    temperature:
-      name: QMC5883L Temperature
-    range: 800uT
-    oversampling: 256x
-    update_interval: 15s
+<<: !include common.yaml
diff --git a/tests/components/qmc5883l/test.esp8266-ard.yaml b/tests/components/qmc5883l/test.esp8266-ard.yaml
index 841bbd5d1e..ee2c29ca4e 100644
--- a/tests/components/qmc5883l/test.esp8266-ard.yaml
+++ b/tests/components/qmc5883l/test.esp8266-ard.yaml
@@ -1,21 +1,5 @@
-i2c:
-  - id: i2c_qmc5883l
-    scl: 5
-    sda: 4
+substitutions:
+  scl_pin: GPIO5
+  sda_pin: GPIO4
 
-sensor:
-  - platform: qmc5883l
-    address: 0x0D
-    field_strength_x:
-      name: QMC5883L Field Strength X
-    field_strength_y:
-      name: QMC5883L Field Strength Y
-    field_strength_z:
-      name: QMC5883L Field Strength Z
-    heading:
-      name: QMC5883L Heading
-    temperature:
-      name: QMC5883L Temperature
-    range: 800uT
-    oversampling: 256x
-    update_interval: 15s
+<<: !include common.yaml
diff --git a/tests/components/qmc5883l/test.rp2040-ard.yaml b/tests/components/qmc5883l/test.rp2040-ard.yaml
index 841bbd5d1e..ee2c29ca4e 100644
--- a/tests/components/qmc5883l/test.rp2040-ard.yaml
+++ b/tests/components/qmc5883l/test.rp2040-ard.yaml
@@ -1,21 +1,5 @@
-i2c:
-  - id: i2c_qmc5883l
-    scl: 5
-    sda: 4
+substitutions:
+  scl_pin: GPIO5
+  sda_pin: GPIO4
 
-sensor:
-  - platform: qmc5883l
-    address: 0x0D
-    field_strength_x:
-      name: QMC5883L Field Strength X
-    field_strength_y:
-      name: QMC5883L Field Strength Y
-    field_strength_z:
-      name: QMC5883L Field Strength Z
-    heading:
-      name: QMC5883L Heading
-    temperature:
-      name: QMC5883L Temperature
-    range: 800uT
-    oversampling: 256x
-    update_interval: 15s
+<<: !include common.yaml
diff --git a/tests/components/qmp6988/common.yaml b/tests/components/qmp6988/common.yaml
new file mode 100644
index 0000000000..cb4b221df0
--- /dev/null
+++ b/tests/components/qmp6988/common.yaml
@@ -0,0 +1,16 @@
+i2c:
+  - id: i2c_qmp6988
+    scl: ${scl_pin}
+    sda: ${sda_pin}
+
+sensor:
+  - platform: qmp6988
+    temperature:
+      name: QMP6988 Temperature
+      oversampling: 32x
+    pressure:
+      name: QMP6988 Pressure
+      oversampling: 2x
+    address: 0x70
+    update_interval: 30s
+    iir_filter: 16x
diff --git a/tests/components/qmp6988/test.esp32-ard.yaml b/tests/components/qmp6988/test.esp32-ard.yaml
index f3fbf75bbe..63c3bd6afd 100644
--- a/tests/components/qmp6988/test.esp32-ard.yaml
+++ b/tests/components/qmp6988/test.esp32-ard.yaml
@@ -1,16 +1,5 @@
-i2c:
-  - id: i2c_qmp6988
-    scl: 16
-    sda: 17
+substitutions:
+  scl_pin: GPIO16
+  sda_pin: GPIO17
 
-sensor:
-  - platform: qmp6988
-    temperature:
-      name: QMP6988 Temperature
-      oversampling: 32x
-    pressure:
-      name: QMP6988 Pressure
-      oversampling: 2x
-    address: 0x70
-    update_interval: 30s
-    iir_filter: 16x
+<<: !include common.yaml
diff --git a/tests/components/qmp6988/test.esp32-c3-ard.yaml b/tests/components/qmp6988/test.esp32-c3-ard.yaml
index bcd87ae6b8..ee2c29ca4e 100644
--- a/tests/components/qmp6988/test.esp32-c3-ard.yaml
+++ b/tests/components/qmp6988/test.esp32-c3-ard.yaml
@@ -1,16 +1,5 @@
-i2c:
-  - id: i2c_qmp6988
-    scl: 5
-    sda: 4
+substitutions:
+  scl_pin: GPIO5
+  sda_pin: GPIO4
 
-sensor:
-  - platform: qmp6988
-    temperature:
-      name: QMP6988 Temperature
-      oversampling: 32x
-    pressure:
-      name: QMP6988 Pressure
-      oversampling: 2x
-    address: 0x70
-    update_interval: 30s
-    iir_filter: 16x
+<<: !include common.yaml
diff --git a/tests/components/qmp6988/test.esp32-c3-idf.yaml b/tests/components/qmp6988/test.esp32-c3-idf.yaml
index bcd87ae6b8..ee2c29ca4e 100644
--- a/tests/components/qmp6988/test.esp32-c3-idf.yaml
+++ b/tests/components/qmp6988/test.esp32-c3-idf.yaml
@@ -1,16 +1,5 @@
-i2c:
-  - id: i2c_qmp6988
-    scl: 5
-    sda: 4
+substitutions:
+  scl_pin: GPIO5
+  sda_pin: GPIO4
 
-sensor:
-  - platform: qmp6988
-    temperature:
-      name: QMP6988 Temperature
-      oversampling: 32x
-    pressure:
-      name: QMP6988 Pressure
-      oversampling: 2x
-    address: 0x70
-    update_interval: 30s
-    iir_filter: 16x
+<<: !include common.yaml
diff --git a/tests/components/qmp6988/test.esp32-idf.yaml b/tests/components/qmp6988/test.esp32-idf.yaml
index f3fbf75bbe..63c3bd6afd 100644
--- a/tests/components/qmp6988/test.esp32-idf.yaml
+++ b/tests/components/qmp6988/test.esp32-idf.yaml
@@ -1,16 +1,5 @@
-i2c:
-  - id: i2c_qmp6988
-    scl: 16
-    sda: 17
+substitutions:
+  scl_pin: GPIO16
+  sda_pin: GPIO17
 
-sensor:
-  - platform: qmp6988
-    temperature:
-      name: QMP6988 Temperature
-      oversampling: 32x
-    pressure:
-      name: QMP6988 Pressure
-      oversampling: 2x
-    address: 0x70
-    update_interval: 30s
-    iir_filter: 16x
+<<: !include common.yaml
diff --git a/tests/components/qmp6988/test.esp8266-ard.yaml b/tests/components/qmp6988/test.esp8266-ard.yaml
index bcd87ae6b8..ee2c29ca4e 100644
--- a/tests/components/qmp6988/test.esp8266-ard.yaml
+++ b/tests/components/qmp6988/test.esp8266-ard.yaml
@@ -1,16 +1,5 @@
-i2c:
-  - id: i2c_qmp6988
-    scl: 5
-    sda: 4
+substitutions:
+  scl_pin: GPIO5
+  sda_pin: GPIO4
 
-sensor:
-  - platform: qmp6988
-    temperature:
-      name: QMP6988 Temperature
-      oversampling: 32x
-    pressure:
-      name: QMP6988 Pressure
-      oversampling: 2x
-    address: 0x70
-    update_interval: 30s
-    iir_filter: 16x
+<<: !include common.yaml
diff --git a/tests/components/qmp6988/test.rp2040-ard.yaml b/tests/components/qmp6988/test.rp2040-ard.yaml
index bcd87ae6b8..ee2c29ca4e 100644
--- a/tests/components/qmp6988/test.rp2040-ard.yaml
+++ b/tests/components/qmp6988/test.rp2040-ard.yaml
@@ -1,16 +1,5 @@
-i2c:
-  - id: i2c_qmp6988
-    scl: 5
-    sda: 4
+substitutions:
+  scl_pin: GPIO5
+  sda_pin: GPIO4
 
-sensor:
-  - platform: qmp6988
-    temperature:
-      name: QMP6988 Temperature
-      oversampling: 32x
-    pressure:
-      name: QMP6988 Pressure
-      oversampling: 2x
-    address: 0x70
-    update_interval: 30s
-    iir_filter: 16x
+<<: !include common.yaml
diff --git a/tests/components/qr_code/common.yaml b/tests/components/qr_code/common.yaml
new file mode 100644
index 0000000000..85c2ee076b
--- /dev/null
+++ b/tests/components/qr_code/common.yaml
@@ -0,0 +1,24 @@
+spi:
+  - id: spi_main_lcd
+    clk_pin: ${clk_pin}
+    mosi_pin: ${mosi_pin}
+
+display:
+  - platform: ili9xxx
+    id: main_lcd
+    model: ili9342
+    cs_pin: ${cs_pin}
+    dc_pin: ${dc_pin}
+    reset_pin: ${reset_pin}
+    invert_colors: false
+    lambda: |-
+      // Draw a QR code in the center of the screen
+      auto scale = 2;
+      auto size = id(homepage_qr).get_size() * scale;
+      auto x = (it.get_width() / 2) - (size / 2);
+      auto y = (it.get_height() / 2) - (size / 2);
+      it.qr_code(x, y, id(homepage_qr), Color(255,255,255), scale);
+
+qr_code:
+  - id: homepage_qr
+    value: https://esphome.io/index.html
diff --git a/tests/components/qr_code/test.esp32-ard.yaml b/tests/components/qr_code/test.esp32-ard.yaml
index 8689d4d73f..bad5241f79 100644
--- a/tests/components/qr_code/test.esp32-ard.yaml
+++ b/tests/components/qr_code/test.esp32-ard.yaml
@@ -1,25 +1,8 @@
-spi:
-  - id: spi_main_lcd
-    clk_pin: 16
-    mosi_pin: 17
-    miso_pin: 15
+substitutions:
+  clk_pin: GPIO16
+  mosi_pin: GPIO17
+  cs_pin: GPIO12
+  dc_pin: GPIO13
+  reset_pin: GPIO14
 
-display:
-  - platform: ili9xxx
-    id: main_lcd
-    model: ili9342
-    cs_pin: 12
-    dc_pin: 13
-    reset_pin: 21
-    invert_colors: false
-    lambda: |-
-      // Draw a QR code in the center of the screen
-      auto scale = 2;
-      auto size = id(homepage_qr).get_size() * scale;
-      auto x = (it.get_width() / 2) - (size / 2);
-      auto y = (it.get_height() / 2) - (size / 2);
-      it.qr_code(x, y, id(homepage_qr), Color(255,255,255), scale);
-
-qr_code:
-  - id: homepage_qr
-    value: https://esphome.io/index.html
+<<: !include common.yaml
diff --git a/tests/components/qr_code/test.esp32-c3-ard.yaml b/tests/components/qr_code/test.esp32-c3-ard.yaml
index 3690d2598c..c5c932c92c 100644
--- a/tests/components/qr_code/test.esp32-c3-ard.yaml
+++ b/tests/components/qr_code/test.esp32-c3-ard.yaml
@@ -1,25 +1,9 @@
-spi:
-  - id: spi_main_lcd
-    clk_pin: 6
-    mosi_pin: 7
-    miso_pin: 5
+substitutions:
+  clk_pin: GPIO6
+  mosi_pin: GPIO7
+  miso_pin: GPIO5
+  cs_pin: GPIO8
+  dc_pin: GPIO9
+  reset_pin: GPIO10
 
-display:
-  - platform: ili9xxx
-    id: main_lcd
-    model: ili9342
-    cs_pin: 8
-    dc_pin: 9
-    reset_pin: 10
-    invert_colors: false
-    lambda: |-
-      // Draw a QR code in the center of the screen
-      auto scale = 2;
-      auto size = id(homepage_qr).get_size() * scale;
-      auto x = (it.get_width() / 2) - (size / 2);
-      auto y = (it.get_height() / 2) - (size / 2);
-      it.qr_code(x, y, id(homepage_qr), Color(255,255,255), scale);
-
-qr_code:
-  - id: homepage_qr
-    value: https://esphome.io/index.html
+<<: !include common.yaml
diff --git a/tests/components/qr_code/test.esp32-c3-idf.yaml b/tests/components/qr_code/test.esp32-c3-idf.yaml
index 3690d2598c..c5c932c92c 100644
--- a/tests/components/qr_code/test.esp32-c3-idf.yaml
+++ b/tests/components/qr_code/test.esp32-c3-idf.yaml
@@ -1,25 +1,9 @@
-spi:
-  - id: spi_main_lcd
-    clk_pin: 6
-    mosi_pin: 7
-    miso_pin: 5
+substitutions:
+  clk_pin: GPIO6
+  mosi_pin: GPIO7
+  miso_pin: GPIO5
+  cs_pin: GPIO8
+  dc_pin: GPIO9
+  reset_pin: GPIO10
 
-display:
-  - platform: ili9xxx
-    id: main_lcd
-    model: ili9342
-    cs_pin: 8
-    dc_pin: 9
-    reset_pin: 10
-    invert_colors: false
-    lambda: |-
-      // Draw a QR code in the center of the screen
-      auto scale = 2;
-      auto size = id(homepage_qr).get_size() * scale;
-      auto x = (it.get_width() / 2) - (size / 2);
-      auto y = (it.get_height() / 2) - (size / 2);
-      it.qr_code(x, y, id(homepage_qr), Color(255,255,255), scale);
-
-qr_code:
-  - id: homepage_qr
-    value: https://esphome.io/index.html
+<<: !include common.yaml
diff --git a/tests/components/qr_code/test.esp32-idf.yaml b/tests/components/qr_code/test.esp32-idf.yaml
index 8689d4d73f..bad5241f79 100644
--- a/tests/components/qr_code/test.esp32-idf.yaml
+++ b/tests/components/qr_code/test.esp32-idf.yaml
@@ -1,25 +1,8 @@
-spi:
-  - id: spi_main_lcd
-    clk_pin: 16
-    mosi_pin: 17
-    miso_pin: 15
+substitutions:
+  clk_pin: GPIO16
+  mosi_pin: GPIO17
+  cs_pin: GPIO12
+  dc_pin: GPIO13
+  reset_pin: GPIO14
 
-display:
-  - platform: ili9xxx
-    id: main_lcd
-    model: ili9342
-    cs_pin: 12
-    dc_pin: 13
-    reset_pin: 21
-    invert_colors: false
-    lambda: |-
-      // Draw a QR code in the center of the screen
-      auto scale = 2;
-      auto size = id(homepage_qr).get_size() * scale;
-      auto x = (it.get_width() / 2) - (size / 2);
-      auto y = (it.get_height() / 2) - (size / 2);
-      it.qr_code(x, y, id(homepage_qr), Color(255,255,255), scale);
-
-qr_code:
-  - id: homepage_qr
-    value: https://esphome.io/index.html
+<<: !include common.yaml
diff --git a/tests/components/qr_code/test.esp8266-ard.yaml b/tests/components/qr_code/test.esp8266-ard.yaml
index 02dc183440..3f023a60eb 100644
--- a/tests/components/qr_code/test.esp8266-ard.yaml
+++ b/tests/components/qr_code/test.esp8266-ard.yaml
@@ -1,25 +1,9 @@
-spi:
-  - id: spi_main_lcd
-    clk_pin: 14
-    mosi_pin: 13
-    miso_pin: 12
+substitutions:
+  clk_pin: GPIO14
+  mosi_pin: GPIO13
+  miso_pin: GPIO12
+  cs_pin: GPIO5
+  dc_pin: GPIO15
+  reset_pin: GPIO16
 
-display:
-  - platform: ili9xxx
-    id: main_lcd
-    model: ili9342
-    cs_pin: 5
-    dc_pin: 15
-    reset_pin: 16
-    invert_colors: false
-    lambda: |-
-      // Draw a QR code in the center of the screen
-      auto scale = 2;
-      auto size = id(homepage_qr).get_size() * scale;
-      auto x = (it.get_width() / 2) - (size / 2);
-      auto y = (it.get_height() / 2) - (size / 2);
-      it.qr_code(x, y, id(homepage_qr), Color(255,255,255), scale);
-
-qr_code:
-  - id: homepage_qr
-    value: https://esphome.io/index.html
+<<: !include common.yaml
diff --git a/tests/components/qr_code/test.rp2040-ard.yaml b/tests/components/qr_code/test.rp2040-ard.yaml
index 0d86f8d213..d7fd6ee294 100644
--- a/tests/components/qr_code/test.rp2040-ard.yaml
+++ b/tests/components/qr_code/test.rp2040-ard.yaml
@@ -1,25 +1,9 @@
-spi:
-  - id: spi_main_lcd
-    clk_pin: 2
-    mosi_pin: 3
-    miso_pin: 4
+substitutions:
+  clk_pin: GPIO2
+  mosi_pin: GPIO3
+  miso_pin: GPIO4
+  cs_pin: GPIO5
+  dc_pin: GPIO15
+  reset_pin: GPIO16
 
-display:
-  - platform: ili9xxx
-    id: main_lcd
-    model: ili9342
-    cs_pin: 20
-    dc_pin: 21
-    reset_pin: 22
-    invert_colors: false
-    lambda: |-
-      // Draw a QR code in the center of the screen
-      auto scale = 2;
-      auto size = id(homepage_qr).get_size() * scale;
-      auto x = (it.get_width() / 2) - (size / 2);
-      auto y = (it.get_height() / 2) - (size / 2);
-      it.qr_code(x, y, id(homepage_qr), Color(255,255,255), scale);
-
-qr_code:
-  - id: homepage_qr
-    value: https://esphome.io/index.html
+<<: !include common.yaml
diff --git a/tests/components/qwiic_pir/common.yaml b/tests/components/qwiic_pir/common.yaml
new file mode 100644
index 0000000000..d4b733405d
--- /dev/null
+++ b/tests/components/qwiic_pir/common.yaml
@@ -0,0 +1,8 @@
+i2c:
+  - id: i2c_qwiic_pir
+    scl: ${scl_pin}
+    sda: ${sda_pin}
+
+binary_sensor:
+  - platform: qwiic_pir
+    name: Qwiic PIR Motion Sensor
diff --git a/tests/components/qwiic_pir/test.esp32-ard.yaml b/tests/components/qwiic_pir/test.esp32-ard.yaml
index da2e275cf3..63c3bd6afd 100644
--- a/tests/components/qwiic_pir/test.esp32-ard.yaml
+++ b/tests/components/qwiic_pir/test.esp32-ard.yaml
@@ -1,8 +1,5 @@
-i2c:
-  - id: i2c_qwiic_pir
-    scl: 16
-    sda: 17
+substitutions:
+  scl_pin: GPIO16
+  sda_pin: GPIO17
 
-binary_sensor:
-  - platform: qwiic_pir
-    name: Qwiic PIR Motion Sensor
+<<: !include common.yaml
diff --git a/tests/components/qwiic_pir/test.esp32-c3-ard.yaml b/tests/components/qwiic_pir/test.esp32-c3-ard.yaml
index ad52ac91c5..ee2c29ca4e 100644
--- a/tests/components/qwiic_pir/test.esp32-c3-ard.yaml
+++ b/tests/components/qwiic_pir/test.esp32-c3-ard.yaml
@@ -1,8 +1,5 @@
-i2c:
-  - id: i2c_qwiic_pir
-    scl: 5
-    sda: 4
+substitutions:
+  scl_pin: GPIO5
+  sda_pin: GPIO4
 
-binary_sensor:
-  - platform: qwiic_pir
-    name: Qwiic PIR Motion Sensor
+<<: !include common.yaml
diff --git a/tests/components/qwiic_pir/test.esp32-c3-idf.yaml b/tests/components/qwiic_pir/test.esp32-c3-idf.yaml
index ad52ac91c5..ee2c29ca4e 100644
--- a/tests/components/qwiic_pir/test.esp32-c3-idf.yaml
+++ b/tests/components/qwiic_pir/test.esp32-c3-idf.yaml
@@ -1,8 +1,5 @@
-i2c:
-  - id: i2c_qwiic_pir
-    scl: 5
-    sda: 4
+substitutions:
+  scl_pin: GPIO5
+  sda_pin: GPIO4
 
-binary_sensor:
-  - platform: qwiic_pir
-    name: Qwiic PIR Motion Sensor
+<<: !include common.yaml
diff --git a/tests/components/qwiic_pir/test.esp32-idf.yaml b/tests/components/qwiic_pir/test.esp32-idf.yaml
index da2e275cf3..63c3bd6afd 100644
--- a/tests/components/qwiic_pir/test.esp32-idf.yaml
+++ b/tests/components/qwiic_pir/test.esp32-idf.yaml
@@ -1,8 +1,5 @@
-i2c:
-  - id: i2c_qwiic_pir
-    scl: 16
-    sda: 17
+substitutions:
+  scl_pin: GPIO16
+  sda_pin: GPIO17
 
-binary_sensor:
-  - platform: qwiic_pir
-    name: Qwiic PIR Motion Sensor
+<<: !include common.yaml
diff --git a/tests/components/qwiic_pir/test.esp8266-ard.yaml b/tests/components/qwiic_pir/test.esp8266-ard.yaml
index ad52ac91c5..ee2c29ca4e 100644
--- a/tests/components/qwiic_pir/test.esp8266-ard.yaml
+++ b/tests/components/qwiic_pir/test.esp8266-ard.yaml
@@ -1,8 +1,5 @@
-i2c:
-  - id: i2c_qwiic_pir
-    scl: 5
-    sda: 4
+substitutions:
+  scl_pin: GPIO5
+  sda_pin: GPIO4
 
-binary_sensor:
-  - platform: qwiic_pir
-    name: Qwiic PIR Motion Sensor
+<<: !include common.yaml
diff --git a/tests/components/qwiic_pir/test.rp2040-ard.yaml b/tests/components/qwiic_pir/test.rp2040-ard.yaml
index ad52ac91c5..ee2c29ca4e 100644
--- a/tests/components/qwiic_pir/test.rp2040-ard.yaml
+++ b/tests/components/qwiic_pir/test.rp2040-ard.yaml
@@ -1,8 +1,5 @@
-i2c:
-  - id: i2c_qwiic_pir
-    scl: 5
-    sda: 4
+substitutions:
+  scl_pin: GPIO5
+  sda_pin: GPIO4
 
-binary_sensor:
-  - platform: qwiic_pir
-    name: Qwiic PIR Motion Sensor
+<<: !include common.yaml
diff --git a/tests/components/rc522_i2c/common.yaml b/tests/components/rc522_i2c/common.yaml
new file mode 100644
index 0000000000..b8b7a41bc7
--- /dev/null
+++ b/tests/components/rc522_i2c/common.yaml
@@ -0,0 +1,17 @@
+i2c:
+  - id: i2c_rc522
+    scl: ${scl_pin}
+    sda: ${sda_pin}
+
+rc522_i2c:
+  - id: rc522_nfcc
+    update_interval: 1s
+    on_tag:
+      - lambda: |-
+          ESP_LOGD("main", "Found tag %s", x.c_str());
+
+binary_sensor:
+  - platform: rc522
+    rc522_id: rc522_nfcc
+    name: RC522 NFC Tag
+    uid: 74-10-37-94
diff --git a/tests/components/rc522_i2c/test.esp32-ard.yaml b/tests/components/rc522_i2c/test.esp32-ard.yaml
index 69b7d892a4..63c3bd6afd 100644
--- a/tests/components/rc522_i2c/test.esp32-ard.yaml
+++ b/tests/components/rc522_i2c/test.esp32-ard.yaml
@@ -1,17 +1,5 @@
-i2c:
-  - id: i2c_rc522
-    scl: 16
-    sda: 17
+substitutions:
+  scl_pin: GPIO16
+  sda_pin: GPIO17
 
-rc522_i2c:
-  - id: rc522_nfcc
-    update_interval: 1s
-    on_tag:
-      - lambda: |-
-          ESP_LOGD("main", "Found tag %s", x.c_str());
-
-binary_sensor:
-  - platform: rc522
-    rc522_id: rc522_nfcc
-    name: RC522 NFC Tag
-    uid: 74-10-37-94
+<<: !include common.yaml
diff --git a/tests/components/rc522_i2c/test.esp32-c3-ard.yaml b/tests/components/rc522_i2c/test.esp32-c3-ard.yaml
index 8c8819e257..ee2c29ca4e 100644
--- a/tests/components/rc522_i2c/test.esp32-c3-ard.yaml
+++ b/tests/components/rc522_i2c/test.esp32-c3-ard.yaml
@@ -1,17 +1,5 @@
-i2c:
-  - id: i2c_rc522
-    scl: 5
-    sda: 4
+substitutions:
+  scl_pin: GPIO5
+  sda_pin: GPIO4
 
-rc522_i2c:
-  - id: rc522_nfcc
-    update_interval: 1s
-    on_tag:
-      - lambda: |-
-          ESP_LOGD("main", "Found tag %s", x.c_str());
-
-binary_sensor:
-  - platform: rc522
-    rc522_id: rc522_nfcc
-    name: RC522 NFC Tag
-    uid: 74-10-37-94
+<<: !include common.yaml
diff --git a/tests/components/rc522_i2c/test.esp32-c3-idf.yaml b/tests/components/rc522_i2c/test.esp32-c3-idf.yaml
index 8c8819e257..ee2c29ca4e 100644
--- a/tests/components/rc522_i2c/test.esp32-c3-idf.yaml
+++ b/tests/components/rc522_i2c/test.esp32-c3-idf.yaml
@@ -1,17 +1,5 @@
-i2c:
-  - id: i2c_rc522
-    scl: 5
-    sda: 4
+substitutions:
+  scl_pin: GPIO5
+  sda_pin: GPIO4
 
-rc522_i2c:
-  - id: rc522_nfcc
-    update_interval: 1s
-    on_tag:
-      - lambda: |-
-          ESP_LOGD("main", "Found tag %s", x.c_str());
-
-binary_sensor:
-  - platform: rc522
-    rc522_id: rc522_nfcc
-    name: RC522 NFC Tag
-    uid: 74-10-37-94
+<<: !include common.yaml
diff --git a/tests/components/rc522_i2c/test.esp32-idf.yaml b/tests/components/rc522_i2c/test.esp32-idf.yaml
index 69b7d892a4..63c3bd6afd 100644
--- a/tests/components/rc522_i2c/test.esp32-idf.yaml
+++ b/tests/components/rc522_i2c/test.esp32-idf.yaml
@@ -1,17 +1,5 @@
-i2c:
-  - id: i2c_rc522
-    scl: 16
-    sda: 17
+substitutions:
+  scl_pin: GPIO16
+  sda_pin: GPIO17
 
-rc522_i2c:
-  - id: rc522_nfcc
-    update_interval: 1s
-    on_tag:
-      - lambda: |-
-          ESP_LOGD("main", "Found tag %s", x.c_str());
-
-binary_sensor:
-  - platform: rc522
-    rc522_id: rc522_nfcc
-    name: RC522 NFC Tag
-    uid: 74-10-37-94
+<<: !include common.yaml
diff --git a/tests/components/rc522_i2c/test.esp8266-ard.yaml b/tests/components/rc522_i2c/test.esp8266-ard.yaml
index 8c8819e257..ee2c29ca4e 100644
--- a/tests/components/rc522_i2c/test.esp8266-ard.yaml
+++ b/tests/components/rc522_i2c/test.esp8266-ard.yaml
@@ -1,17 +1,5 @@
-i2c:
-  - id: i2c_rc522
-    scl: 5
-    sda: 4
+substitutions:
+  scl_pin: GPIO5
+  sda_pin: GPIO4
 
-rc522_i2c:
-  - id: rc522_nfcc
-    update_interval: 1s
-    on_tag:
-      - lambda: |-
-          ESP_LOGD("main", "Found tag %s", x.c_str());
-
-binary_sensor:
-  - platform: rc522
-    rc522_id: rc522_nfcc
-    name: RC522 NFC Tag
-    uid: 74-10-37-94
+<<: !include common.yaml
diff --git a/tests/components/rc522_i2c/test.rp2040-ard.yaml b/tests/components/rc522_i2c/test.rp2040-ard.yaml
index 8c8819e257..ee2c29ca4e 100644
--- a/tests/components/rc522_i2c/test.rp2040-ard.yaml
+++ b/tests/components/rc522_i2c/test.rp2040-ard.yaml
@@ -1,17 +1,5 @@
-i2c:
-  - id: i2c_rc522
-    scl: 5
-    sda: 4
+substitutions:
+  scl_pin: GPIO5
+  sda_pin: GPIO4
 
-rc522_i2c:
-  - id: rc522_nfcc
-    update_interval: 1s
-    on_tag:
-      - lambda: |-
-          ESP_LOGD("main", "Found tag %s", x.c_str());
-
-binary_sensor:
-  - platform: rc522
-    rc522_id: rc522_nfcc
-    name: RC522 NFC Tag
-    uid: 74-10-37-94
+<<: !include common.yaml
diff --git a/tests/components/rc522_spi/common.yaml b/tests/components/rc522_spi/common.yaml
new file mode 100644
index 0000000000..5c42858993
--- /dev/null
+++ b/tests/components/rc522_spi/common.yaml
@@ -0,0 +1,15 @@
+spi:
+  - id: spi_rc522
+    clk_pin: ${clk_pin}
+    mosi_pin: ${mosi_pin}
+    miso_pin: ${miso_pin}
+
+rc522_spi:
+  id: rc522_nfcc
+  cs_pin: ${cs_pin}
+
+binary_sensor:
+  - platform: rc522
+    rc522_id: rc522_nfcc
+    name: PN532 NFC Tag
+    uid: 74-10-37-94
diff --git a/tests/components/rc522_spi/test.esp32-ard.yaml b/tests/components/rc522_spi/test.esp32-ard.yaml
index 5c0b698a08..54e027a614 100644
--- a/tests/components/rc522_spi/test.esp32-ard.yaml
+++ b/tests/components/rc522_spi/test.esp32-ard.yaml
@@ -1,15 +1,7 @@
-spi:
-  - id: spi_rc522
-    clk_pin: 16
-    mosi_pin: 17
-    miso_pin: 15
+substitutions:
+  clk_pin: GPIO16
+  mosi_pin: GPIO17
+  miso_pin: GPIO15
+  cs_pin: GPIO5
 
-rc522_spi:
-  id: rc522_nfcc
-  cs_pin: 12
-
-binary_sensor:
-  - platform: rc522
-    rc522_id: rc522_nfcc
-    name: PN532 NFC Tag
-    uid: 74-10-37-94
+<<: !include common.yaml
diff --git a/tests/components/rc522_spi/test.esp32-c3-ard.yaml b/tests/components/rc522_spi/test.esp32-c3-ard.yaml
index 8bcab84700..2415ba5dc6 100644
--- a/tests/components/rc522_spi/test.esp32-c3-ard.yaml
+++ b/tests/components/rc522_spi/test.esp32-c3-ard.yaml
@@ -1,15 +1,7 @@
-spi:
-  - id: spi_rc522
-    clk_pin: 6
-    mosi_pin: 7
-    miso_pin: 5
+substitutions:
+  clk_pin: GPIO6
+  mosi_pin: GPIO7
+  miso_pin: GPIO5
+  cs_pin: GPIO8
 
-rc522_spi:
-  id: rc522_nfcc
-  cs_pin: 4
-
-binary_sensor:
-  - platform: rc522
-    rc522_id: rc522_nfcc
-    name: PN532 NFC Tag
-    uid: 74-10-37-94
+<<: !include common.yaml
diff --git a/tests/components/rc522_spi/test.esp32-c3-idf.yaml b/tests/components/rc522_spi/test.esp32-c3-idf.yaml
index 8bcab84700..2415ba5dc6 100644
--- a/tests/components/rc522_spi/test.esp32-c3-idf.yaml
+++ b/tests/components/rc522_spi/test.esp32-c3-idf.yaml
@@ -1,15 +1,7 @@
-spi:
-  - id: spi_rc522
-    clk_pin: 6
-    mosi_pin: 7
-    miso_pin: 5
+substitutions:
+  clk_pin: GPIO6
+  mosi_pin: GPIO7
+  miso_pin: GPIO5
+  cs_pin: GPIO8
 
-rc522_spi:
-  id: rc522_nfcc
-  cs_pin: 4
-
-binary_sensor:
-  - platform: rc522
-    rc522_id: rc522_nfcc
-    name: PN532 NFC Tag
-    uid: 74-10-37-94
+<<: !include common.yaml
diff --git a/tests/components/rc522_spi/test.esp32-idf.yaml b/tests/components/rc522_spi/test.esp32-idf.yaml
index 5c0b698a08..54e027a614 100644
--- a/tests/components/rc522_spi/test.esp32-idf.yaml
+++ b/tests/components/rc522_spi/test.esp32-idf.yaml
@@ -1,15 +1,7 @@
-spi:
-  - id: spi_rc522
-    clk_pin: 16
-    mosi_pin: 17
-    miso_pin: 15
+substitutions:
+  clk_pin: GPIO16
+  mosi_pin: GPIO17
+  miso_pin: GPIO15
+  cs_pin: GPIO5
 
-rc522_spi:
-  id: rc522_nfcc
-  cs_pin: 12
-
-binary_sensor:
-  - platform: rc522
-    rc522_id: rc522_nfcc
-    name: PN532 NFC Tag
-    uid: 74-10-37-94
+<<: !include common.yaml
diff --git a/tests/components/rc522_spi/test.esp8266-ard.yaml b/tests/components/rc522_spi/test.esp8266-ard.yaml
index 3c33311266..dbd158d030 100644
--- a/tests/components/rc522_spi/test.esp8266-ard.yaml
+++ b/tests/components/rc522_spi/test.esp8266-ard.yaml
@@ -1,15 +1,7 @@
-spi:
-  - id: spi_rc522
-    clk_pin: 14
-    mosi_pin: 13
-    miso_pin: 12
+substitutions:
+  clk_pin: GPIO14
+  mosi_pin: GPIO13
+  miso_pin: GPIO12
+  cs_pin: GPIO15
 
-rc522_spi:
-  id: rc522_nfcc
-  cs_pin: 15
-
-binary_sensor:
-  - platform: rc522
-    rc522_id: rc522_nfcc
-    name: PN532 NFC Tag
-    uid: 74-10-37-94
+<<: !include common.yaml
diff --git a/tests/components/rc522_spi/test.rp2040-ard.yaml b/tests/components/rc522_spi/test.rp2040-ard.yaml
index ed2827dbb9..f6c3f1eeca 100644
--- a/tests/components/rc522_spi/test.rp2040-ard.yaml
+++ b/tests/components/rc522_spi/test.rp2040-ard.yaml
@@ -1,15 +1,7 @@
-spi:
-  - id: spi_rc522
-    clk_pin: 2
-    mosi_pin: 3
-    miso_pin: 4
+substitutions:
+  clk_pin: GPIO2
+  mosi_pin: GPIO3
+  miso_pin: GPIO4
+  cs_pin: GPIO5
 
-rc522_spi:
-  id: rc522_nfcc
-  cs_pin: 6
-
-binary_sensor:
-  - platform: rc522
-    rc522_id: rc522_nfcc
-    name: PN532 NFC Tag
-    uid: 74-10-37-94
+<<: !include common.yaml
diff --git a/tests/components/rdm6300/common.yaml b/tests/components/rdm6300/common.yaml
new file mode 100644
index 0000000000..118a295471
--- /dev/null
+++ b/tests/components/rdm6300/common.yaml
@@ -0,0 +1,12 @@
+uart:
+  - id: uart_rdm6300
+    tx_pin: ${tx_pin}
+    rx_pin: ${rx_pin}
+    baud_rate: 115200
+
+rdm6300:
+
+binary_sensor:
+  - platform: rdm6300
+    uid: 7616525
+    name: RDM6300 NFC Tag
diff --git a/tests/components/rdm6300/test.esp32-ard.yaml b/tests/components/rdm6300/test.esp32-ard.yaml
index 4159248124..f486544afa 100644
--- a/tests/components/rdm6300/test.esp32-ard.yaml
+++ b/tests/components/rdm6300/test.esp32-ard.yaml
@@ -1,12 +1,5 @@
-uart:
-  - id: uart_rdm6300
-    tx_pin: 17
-    rx_pin: 16
-    baud_rate: 115200
+substitutions:
+  tx_pin: GPIO17
+  rx_pin: GPIO16
 
-rdm6300:
-
-binary_sensor:
-  - platform: rdm6300
-    uid: 7616525
-    name: RDM6300 NFC Tag
+<<: !include common.yaml
diff --git a/tests/components/rdm6300/test.esp32-c3-ard.yaml b/tests/components/rdm6300/test.esp32-c3-ard.yaml
index b92fce06e2..b516342f3b 100644
--- a/tests/components/rdm6300/test.esp32-c3-ard.yaml
+++ b/tests/components/rdm6300/test.esp32-c3-ard.yaml
@@ -1,12 +1,5 @@
-uart:
-  - id: uart_rdm6300
-    tx_pin: 4
-    rx_pin: 5
-    baud_rate: 115200
+substitutions:
+  tx_pin: GPIO4
+  rx_pin: GPIO5
 
-rdm6300:
-
-binary_sensor:
-  - platform: rdm6300
-    uid: 7616525
-    name: RDM6300 NFC Tag
+<<: !include common.yaml
diff --git a/tests/components/rdm6300/test.esp32-c3-idf.yaml b/tests/components/rdm6300/test.esp32-c3-idf.yaml
index b92fce06e2..b516342f3b 100644
--- a/tests/components/rdm6300/test.esp32-c3-idf.yaml
+++ b/tests/components/rdm6300/test.esp32-c3-idf.yaml
@@ -1,12 +1,5 @@
-uart:
-  - id: uart_rdm6300
-    tx_pin: 4
-    rx_pin: 5
-    baud_rate: 115200
+substitutions:
+  tx_pin: GPIO4
+  rx_pin: GPIO5
 
-rdm6300:
-
-binary_sensor:
-  - platform: rdm6300
-    uid: 7616525
-    name: RDM6300 NFC Tag
+<<: !include common.yaml
diff --git a/tests/components/rdm6300/test.esp32-idf.yaml b/tests/components/rdm6300/test.esp32-idf.yaml
index 4159248124..f486544afa 100644
--- a/tests/components/rdm6300/test.esp32-idf.yaml
+++ b/tests/components/rdm6300/test.esp32-idf.yaml
@@ -1,12 +1,5 @@
-uart:
-  - id: uart_rdm6300
-    tx_pin: 17
-    rx_pin: 16
-    baud_rate: 115200
+substitutions:
+  tx_pin: GPIO17
+  rx_pin: GPIO16
 
-rdm6300:
-
-binary_sensor:
-  - platform: rdm6300
-    uid: 7616525
-    name: RDM6300 NFC Tag
+<<: !include common.yaml
diff --git a/tests/components/rdm6300/test.esp8266-ard.yaml b/tests/components/rdm6300/test.esp8266-ard.yaml
index b92fce06e2..b516342f3b 100644
--- a/tests/components/rdm6300/test.esp8266-ard.yaml
+++ b/tests/components/rdm6300/test.esp8266-ard.yaml
@@ -1,12 +1,5 @@
-uart:
-  - id: uart_rdm6300
-    tx_pin: 4
-    rx_pin: 5
-    baud_rate: 115200
+substitutions:
+  tx_pin: GPIO4
+  rx_pin: GPIO5
 
-rdm6300:
-
-binary_sensor:
-  - platform: rdm6300
-    uid: 7616525
-    name: RDM6300 NFC Tag
+<<: !include common.yaml
diff --git a/tests/components/rdm6300/test.rp2040-ard.yaml b/tests/components/rdm6300/test.rp2040-ard.yaml
index b92fce06e2..b516342f3b 100644
--- a/tests/components/rdm6300/test.rp2040-ard.yaml
+++ b/tests/components/rdm6300/test.rp2040-ard.yaml
@@ -1,12 +1,5 @@
-uart:
-  - id: uart_rdm6300
-    tx_pin: 4
-    rx_pin: 5
-    baud_rate: 115200
+substitutions:
+  tx_pin: GPIO4
+  rx_pin: GPIO5
 
-rdm6300:
-
-binary_sensor:
-  - platform: rdm6300
-    uid: 7616525
-    name: RDM6300 NFC Tag
+<<: !include common.yaml
diff --git a/tests/components/resistance/common.yaml b/tests/components/resistance/common.yaml
new file mode 100644
index 0000000000..b3eec49548
--- /dev/null
+++ b/tests/components/resistance/common.yaml
@@ -0,0 +1,11 @@
+sensor:
+  - platform: adc
+    id: my_sensor
+    pin: ${pin}
+  - platform: resistance
+    sensor: my_sensor
+    configuration: DOWNSTREAM
+    resistor: 10kΩ
+    reference_voltage: 3.3V
+    name: Resistance
+    id: resist
diff --git a/tests/components/resistance/test.esp32-ard.yaml b/tests/components/resistance/test.esp32-ard.yaml
index b1ffc64972..06864605a6 100644
--- a/tests/components/resistance/test.esp32-ard.yaml
+++ b/tests/components/resistance/test.esp32-ard.yaml
@@ -1,12 +1,4 @@
-sensor:
-  - platform: adc
-    id: my_sensor
-    pin: 32
-    attenuation: 11db
-  - platform: resistance
-    sensor: my_sensor
-    configuration: DOWNSTREAM
-    resistor: 10kΩ
-    reference_voltage: 3.3V
-    name: Resistance
-    id: resist
+substitutions:
+  pin: GPIO32
+
+<<: !include common.yaml
diff --git a/tests/components/resistance/test.esp32-c3-ard.yaml b/tests/components/resistance/test.esp32-c3-ard.yaml
index 84e23d5115..37fb325f4a 100644
--- a/tests/components/resistance/test.esp32-c3-ard.yaml
+++ b/tests/components/resistance/test.esp32-c3-ard.yaml
@@ -1,12 +1,4 @@
-sensor:
-  - platform: adc
-    id: my_sensor
-    pin: 4
-    attenuation: 11db
-  - platform: resistance
-    sensor: my_sensor
-    configuration: DOWNSTREAM
-    resistor: 10kΩ
-    reference_voltage: 3.3V
-    name: Resistance
-    id: resist
+substitutions:
+  pin: GPIO4
+
+<<: !include common.yaml
diff --git a/tests/components/resistance/test.esp32-c3-idf.yaml b/tests/components/resistance/test.esp32-c3-idf.yaml
new file mode 100644
index 0000000000..37fb325f4a
--- /dev/null
+++ b/tests/components/resistance/test.esp32-c3-idf.yaml
@@ -0,0 +1,4 @@
+substitutions:
+  pin: GPIO4
+
+<<: !include common.yaml
diff --git a/tests/components/resistance/test.esp32-idf.yaml b/tests/components/resistance/test.esp32-idf.yaml
index b1ffc64972..06864605a6 100644
--- a/tests/components/resistance/test.esp32-idf.yaml
+++ b/tests/components/resistance/test.esp32-idf.yaml
@@ -1,12 +1,4 @@
-sensor:
-  - platform: adc
-    id: my_sensor
-    pin: 32
-    attenuation: 11db
-  - platform: resistance
-    sensor: my_sensor
-    configuration: DOWNSTREAM
-    resistor: 10kΩ
-    reference_voltage: 3.3V
-    name: Resistance
-    id: resist
+substitutions:
+  pin: GPIO32
+
+<<: !include common.yaml
diff --git a/tests/components/resistance/test.esp32-s2-ard.yaml b/tests/components/resistance/test.esp32-s2-ard.yaml
index 4ebd6b5c49..1910f325ae 100644
--- a/tests/components/resistance/test.esp32-s2-ard.yaml
+++ b/tests/components/resistance/test.esp32-s2-ard.yaml
@@ -1,12 +1,4 @@
-sensor:
-  - platform: adc
-    id: my_sensor
-    pin: 1
-    attenuation: 11db
-  - platform: resistance
-    sensor: my_sensor
-    configuration: DOWNSTREAM
-    resistor: 10kΩ
-    reference_voltage: 3.3V
-    name: Resistance
-    id: resist
+substitutions:
+  pin: GPIO1
+
+<<: !include common.yaml
diff --git a/tests/components/resistance/test.esp32-s2-idf.yaml b/tests/components/resistance/test.esp32-s2-idf.yaml
new file mode 100644
index 0000000000..1910f325ae
--- /dev/null
+++ b/tests/components/resistance/test.esp32-s2-idf.yaml
@@ -0,0 +1,4 @@
+substitutions:
+  pin: GPIO1
+
+<<: !include common.yaml
diff --git a/tests/components/resistance/test.esp32-s3-ard.yaml b/tests/components/resistance/test.esp32-s3-ard.yaml
index 4ebd6b5c49..1910f325ae 100644
--- a/tests/components/resistance/test.esp32-s3-ard.yaml
+++ b/tests/components/resistance/test.esp32-s3-ard.yaml
@@ -1,12 +1,4 @@
-sensor:
-  - platform: adc
-    id: my_sensor
-    pin: 1
-    attenuation: 11db
-  - platform: resistance
-    sensor: my_sensor
-    configuration: DOWNSTREAM
-    resistor: 10kΩ
-    reference_voltage: 3.3V
-    name: Resistance
-    id: resist
+substitutions:
+  pin: GPIO1
+
+<<: !include common.yaml
diff --git a/tests/components/resistance/test.esp32-s3-idf.yaml b/tests/components/resistance/test.esp32-s3-idf.yaml
new file mode 100644
index 0000000000..1910f325ae
--- /dev/null
+++ b/tests/components/resistance/test.esp32-s3-idf.yaml
@@ -0,0 +1,4 @@
+substitutions:
+  pin: GPIO1
+
+<<: !include common.yaml
diff --git a/tests/components/resistance/test.esp8266-ard.yaml b/tests/components/resistance/test.esp8266-ard.yaml
index f723f7c7c7..9e34247530 100644
--- a/tests/components/resistance/test.esp8266-ard.yaml
+++ b/tests/components/resistance/test.esp8266-ard.yaml
@@ -1,11 +1,4 @@
-sensor:
-  - platform: adc
-    id: my_sensor
-    pin: VCC
-  - platform: resistance
-    sensor: my_sensor
-    configuration: DOWNSTREAM
-    resistor: 10kΩ
-    reference_voltage: 3.3V
-    name: Resistance
-    id: resist
+substitutions:
+  pin: VCC
+
+<<: !include common.yaml
diff --git a/tests/components/resistance/test.rp2040-ard.yaml b/tests/components/resistance/test.rp2040-ard.yaml
index 5cc643926a..9e34247530 100644
--- a/tests/components/resistance/test.rp2040-ard.yaml
+++ b/tests/components/resistance/test.rp2040-ard.yaml
@@ -1,12 +1,4 @@
-sensor:
-  - platform: adc
-    id: my_sensor
-    name: VSYS
-    pin: VCC
-  - platform: resistance
-    sensor: my_sensor
-    configuration: DOWNSTREAM
-    resistor: 10kΩ
-    reference_voltage: 3.3V
-    name: Resistance
-    id: resist
+substitutions:
+  pin: VCC
+
+<<: !include common.yaml
diff --git a/tests/components/rf_bridge/common.yaml b/tests/components/rf_bridge/common.yaml
new file mode 100644
index 0000000000..eaadc4bb9c
--- /dev/null
+++ b/tests/components/rf_bridge/common.yaml
@@ -0,0 +1,35 @@
+uart:
+  - id: uart_rf_bridge
+    tx_pin: ${tx_pin}
+    rx_pin: ${rx_pin}
+    baud_rate: 115200
+
+rf_bridge:
+  on_code_received:
+    - lambda: |-
+        uint32_t test;
+        test = data.sync;
+        test = data.low;
+        test = data.high;
+        test = data.code;
+    - rf_bridge.send_code:
+        sync: 0x1234
+        low: 0x1234
+        high: 0x1234
+        code: 0x123456
+    - rf_bridge.learn
+  on_advanced_code_received:
+    - lambda: |-
+        uint32_t test;
+        std::string test_code;
+        test = data.length;
+        test = data.protocol;
+        test_code = data.code;
+    - rf_bridge.start_advanced_sniffing:
+    - rf_bridge.stop_advanced_sniffing:
+    - rf_bridge.send_advanced_code:
+        length: 0x04
+        protocol: 0x01
+        code: "ABC123"
+    - rf_bridge.send_raw:
+        raw: "AAA5070008001000ABC12355"
diff --git a/tests/components/rf_bridge/test.esp32-ard.yaml b/tests/components/rf_bridge/test.esp32-ard.yaml
index 9ade7f0ac0..f486544afa 100644
--- a/tests/components/rf_bridge/test.esp32-ard.yaml
+++ b/tests/components/rf_bridge/test.esp32-ard.yaml
@@ -1,35 +1,5 @@
-uart:
-  - id: uart_rf_bridge
-    tx_pin: 17
-    rx_pin: 16
-    baud_rate: 115200
+substitutions:
+  tx_pin: GPIO17
+  rx_pin: GPIO16
 
-rf_bridge:
-  on_code_received:
-    - lambda: |-
-        uint32_t test;
-        test = data.sync;
-        test = data.low;
-        test = data.high;
-        test = data.code;
-    - rf_bridge.send_code:
-        sync: 0x1234
-        low: 0x1234
-        high: 0x1234
-        code: 0x123456
-    - rf_bridge.learn
-  on_advanced_code_received:
-    - lambda: |-
-        uint32_t test;
-        std::string test_code;
-        test = data.length;
-        test = data.protocol;
-        test_code = data.code;
-    - rf_bridge.start_advanced_sniffing:
-    - rf_bridge.stop_advanced_sniffing:
-    - rf_bridge.send_advanced_code:
-        length: 0x04
-        protocol: 0x01
-        code: "ABC123"
-    - rf_bridge.send_raw:
-        raw: "AAA5070008001000ABC12355"
+<<: !include common.yaml
diff --git a/tests/components/rf_bridge/test.esp32-c3-ard.yaml b/tests/components/rf_bridge/test.esp32-c3-ard.yaml
index 95a7aa861a..b516342f3b 100644
--- a/tests/components/rf_bridge/test.esp32-c3-ard.yaml
+++ b/tests/components/rf_bridge/test.esp32-c3-ard.yaml
@@ -1,35 +1,5 @@
-uart:
-  - id: uart_rf_bridge
-    tx_pin: 4
-    rx_pin: 5
-    baud_rate: 115200
+substitutions:
+  tx_pin: GPIO4
+  rx_pin: GPIO5
 
-rf_bridge:
-  on_code_received:
-    - lambda: |-
-        uint32_t test;
-        test = data.sync;
-        test = data.low;
-        test = data.high;
-        test = data.code;
-    - rf_bridge.send_code:
-        sync: 0x1234
-        low: 0x1234
-        high: 0x1234
-        code: 0x123456
-    - rf_bridge.learn
-  on_advanced_code_received:
-    - lambda: |-
-        uint32_t test;
-        std::string test_code;
-        test = data.length;
-        test = data.protocol;
-        test_code = data.code;
-    - rf_bridge.start_advanced_sniffing:
-    - rf_bridge.stop_advanced_sniffing:
-    - rf_bridge.send_advanced_code:
-        length: 0x04
-        protocol: 0x01
-        code: "ABC123"
-    - rf_bridge.send_raw:
-        raw: "AAA5070008001000ABC12355"
+<<: !include common.yaml
diff --git a/tests/components/rf_bridge/test.esp32-c3-idf.yaml b/tests/components/rf_bridge/test.esp32-c3-idf.yaml
index 95a7aa861a..b516342f3b 100644
--- a/tests/components/rf_bridge/test.esp32-c3-idf.yaml
+++ b/tests/components/rf_bridge/test.esp32-c3-idf.yaml
@@ -1,35 +1,5 @@
-uart:
-  - id: uart_rf_bridge
-    tx_pin: 4
-    rx_pin: 5
-    baud_rate: 115200
+substitutions:
+  tx_pin: GPIO4
+  rx_pin: GPIO5
 
-rf_bridge:
-  on_code_received:
-    - lambda: |-
-        uint32_t test;
-        test = data.sync;
-        test = data.low;
-        test = data.high;
-        test = data.code;
-    - rf_bridge.send_code:
-        sync: 0x1234
-        low: 0x1234
-        high: 0x1234
-        code: 0x123456
-    - rf_bridge.learn
-  on_advanced_code_received:
-    - lambda: |-
-        uint32_t test;
-        std::string test_code;
-        test = data.length;
-        test = data.protocol;
-        test_code = data.code;
-    - rf_bridge.start_advanced_sniffing:
-    - rf_bridge.stop_advanced_sniffing:
-    - rf_bridge.send_advanced_code:
-        length: 0x04
-        protocol: 0x01
-        code: "ABC123"
-    - rf_bridge.send_raw:
-        raw: "AAA5070008001000ABC12355"
+<<: !include common.yaml
diff --git a/tests/components/rf_bridge/test.esp32-idf.yaml b/tests/components/rf_bridge/test.esp32-idf.yaml
index 9ade7f0ac0..f486544afa 100644
--- a/tests/components/rf_bridge/test.esp32-idf.yaml
+++ b/tests/components/rf_bridge/test.esp32-idf.yaml
@@ -1,35 +1,5 @@
-uart:
-  - id: uart_rf_bridge
-    tx_pin: 17
-    rx_pin: 16
-    baud_rate: 115200
+substitutions:
+  tx_pin: GPIO17
+  rx_pin: GPIO16
 
-rf_bridge:
-  on_code_received:
-    - lambda: |-
-        uint32_t test;
-        test = data.sync;
-        test = data.low;
-        test = data.high;
-        test = data.code;
-    - rf_bridge.send_code:
-        sync: 0x1234
-        low: 0x1234
-        high: 0x1234
-        code: 0x123456
-    - rf_bridge.learn
-  on_advanced_code_received:
-    - lambda: |-
-        uint32_t test;
-        std::string test_code;
-        test = data.length;
-        test = data.protocol;
-        test_code = data.code;
-    - rf_bridge.start_advanced_sniffing:
-    - rf_bridge.stop_advanced_sniffing:
-    - rf_bridge.send_advanced_code:
-        length: 0x04
-        protocol: 0x01
-        code: "ABC123"
-    - rf_bridge.send_raw:
-        raw: "AAA5070008001000ABC12355"
+<<: !include common.yaml
diff --git a/tests/components/rf_bridge/test.esp8266-ard.yaml b/tests/components/rf_bridge/test.esp8266-ard.yaml
index 95a7aa861a..b516342f3b 100644
--- a/tests/components/rf_bridge/test.esp8266-ard.yaml
+++ b/tests/components/rf_bridge/test.esp8266-ard.yaml
@@ -1,35 +1,5 @@
-uart:
-  - id: uart_rf_bridge
-    tx_pin: 4
-    rx_pin: 5
-    baud_rate: 115200
+substitutions:
+  tx_pin: GPIO4
+  rx_pin: GPIO5
 
-rf_bridge:
-  on_code_received:
-    - lambda: |-
-        uint32_t test;
-        test = data.sync;
-        test = data.low;
-        test = data.high;
-        test = data.code;
-    - rf_bridge.send_code:
-        sync: 0x1234
-        low: 0x1234
-        high: 0x1234
-        code: 0x123456
-    - rf_bridge.learn
-  on_advanced_code_received:
-    - lambda: |-
-        uint32_t test;
-        std::string test_code;
-        test = data.length;
-        test = data.protocol;
-        test_code = data.code;
-    - rf_bridge.start_advanced_sniffing:
-    - rf_bridge.stop_advanced_sniffing:
-    - rf_bridge.send_advanced_code:
-        length: 0x04
-        protocol: 0x01
-        code: "ABC123"
-    - rf_bridge.send_raw:
-        raw: "AAA5070008001000ABC12355"
+<<: !include common.yaml
diff --git a/tests/components/rf_bridge/test.rp2040-ard.yaml b/tests/components/rf_bridge/test.rp2040-ard.yaml
index 95a7aa861a..b516342f3b 100644
--- a/tests/components/rf_bridge/test.rp2040-ard.yaml
+++ b/tests/components/rf_bridge/test.rp2040-ard.yaml
@@ -1,35 +1,5 @@
-uart:
-  - id: uart_rf_bridge
-    tx_pin: 4
-    rx_pin: 5
-    baud_rate: 115200
+substitutions:
+  tx_pin: GPIO4
+  rx_pin: GPIO5
 
-rf_bridge:
-  on_code_received:
-    - lambda: |-
-        uint32_t test;
-        test = data.sync;
-        test = data.low;
-        test = data.high;
-        test = data.code;
-    - rf_bridge.send_code:
-        sync: 0x1234
-        low: 0x1234
-        high: 0x1234
-        code: 0x123456
-    - rf_bridge.learn
-  on_advanced_code_received:
-    - lambda: |-
-        uint32_t test;
-        std::string test_code;
-        test = data.length;
-        test = data.protocol;
-        test_code = data.code;
-    - rf_bridge.start_advanced_sniffing:
-    - rf_bridge.stop_advanced_sniffing:
-    - rf_bridge.send_advanced_code:
-        length: 0x04
-        protocol: 0x01
-        code: "ABC123"
-    - rf_bridge.send_raw:
-        raw: "AAA5070008001000ABC12355"
+<<: !include common.yaml
diff --git a/tests/components/rgb/common.yaml b/tests/components/rgb/common.yaml
new file mode 100644
index 0000000000..9f25efa431
--- /dev/null
+++ b/tests/components/rgb/common.yaml
@@ -0,0 +1,18 @@
+output:
+  - platform: ${light_platform}
+    id: light_output_1
+    pin: ${pin1}
+  - platform: ${light_platform}
+    id: light_output_2
+    pin: ${pin2}
+  - platform: ${light_platform}
+    id: light_output_3
+    pin: ${pin3}
+
+light:
+  - platform: rgb
+    name: RGB Light
+    id: rgb_light
+    red: light_output_1
+    green: light_output_2
+    blue: light_output_3
diff --git a/tests/components/rgb/test.esp32-ard.yaml b/tests/components/rgb/test.esp32-ard.yaml
index 2173e718be..d78ccec952 100644
--- a/tests/components/rgb/test.esp32-ard.yaml
+++ b/tests/components/rgb/test.esp32-ard.yaml
@@ -1,18 +1,7 @@
-output:
-  - platform: ledc
-    id: light_output_1
-    pin: 12
-  - platform: ledc
-    id: light_output_2
-    pin: 13
-  - platform: ledc
-    id: light_output_3
-    pin: 14
+substitutions:
+  light_platform: ledc
+  pin1: GPIO12
+  pin2: GPIO13
+  pin3: GPIO14
 
-light:
-  - platform: rgb
-    name: RGB Light
-    id: rgb_light
-    red: light_output_1
-    green: light_output_2
-    blue: light_output_3
+<<: !include common.yaml
diff --git a/tests/components/rgb/test.esp32-c3-ard.yaml b/tests/components/rgb/test.esp32-c3-ard.yaml
index 30ff1527b4..1fe4a4bb90 100644
--- a/tests/components/rgb/test.esp32-c3-ard.yaml
+++ b/tests/components/rgb/test.esp32-c3-ard.yaml
@@ -1,18 +1,7 @@
-output:
-  - platform: ledc
-    id: light_output_1
-    pin: 1
-  - platform: ledc
-    id: light_output_2
-    pin: 2
-  - platform: ledc
-    id: light_output_3
-    pin: 3
+substitutions:
+  light_platform: ledc
+  pin1: GPIO2
+  pin2: GPIO3
+  pin3: GPIO4
 
-light:
-  - platform: rgb
-    name: RGB Light
-    id: rgb_light
-    red: light_output_1
-    green: light_output_2
-    blue: light_output_3
+<<: !include common.yaml
diff --git a/tests/components/rgb/test.esp32-c3-idf.yaml b/tests/components/rgb/test.esp32-c3-idf.yaml
index 30ff1527b4..1fe4a4bb90 100644
--- a/tests/components/rgb/test.esp32-c3-idf.yaml
+++ b/tests/components/rgb/test.esp32-c3-idf.yaml
@@ -1,18 +1,7 @@
-output:
-  - platform: ledc
-    id: light_output_1
-    pin: 1
-  - platform: ledc
-    id: light_output_2
-    pin: 2
-  - platform: ledc
-    id: light_output_3
-    pin: 3
+substitutions:
+  light_platform: ledc
+  pin1: GPIO2
+  pin2: GPIO3
+  pin3: GPIO4
 
-light:
-  - platform: rgb
-    name: RGB Light
-    id: rgb_light
-    red: light_output_1
-    green: light_output_2
-    blue: light_output_3
+<<: !include common.yaml
diff --git a/tests/components/rgb/test.esp32-idf.yaml b/tests/components/rgb/test.esp32-idf.yaml
index 2173e718be..d78ccec952 100644
--- a/tests/components/rgb/test.esp32-idf.yaml
+++ b/tests/components/rgb/test.esp32-idf.yaml
@@ -1,18 +1,7 @@
-output:
-  - platform: ledc
-    id: light_output_1
-    pin: 12
-  - platform: ledc
-    id: light_output_2
-    pin: 13
-  - platform: ledc
-    id: light_output_3
-    pin: 14
+substitutions:
+  light_platform: ledc
+  pin1: GPIO12
+  pin2: GPIO13
+  pin3: GPIO14
 
-light:
-  - platform: rgb
-    name: RGB Light
-    id: rgb_light
-    red: light_output_1
-    green: light_output_2
-    blue: light_output_3
+<<: !include common.yaml
diff --git a/tests/components/rgb/test.esp8266-ard.yaml b/tests/components/rgb/test.esp8266-ard.yaml
index 60c5a7e04f..3c9fa80f9e 100644
--- a/tests/components/rgb/test.esp8266-ard.yaml
+++ b/tests/components/rgb/test.esp8266-ard.yaml
@@ -1,18 +1,7 @@
-output:
-  - platform: esp8266_pwm
-    id: light_output_1
-    pin: 12
-  - platform: esp8266_pwm
-    id: light_output_2
-    pin: 13
-  - platform: esp8266_pwm
-    id: light_output_3
-    pin: 14
+substitutions:
+  light_platform: esp8266_pwm
+  pin1: GPIO12
+  pin2: GPIO13
+  pin3: GPIO14
 
-light:
-  - platform: rgb
-    name: RGB Light
-    id: rgb_light
-    red: light_output_1
-    green: light_output_2
-    blue: light_output_3
+<<: !include common.yaml
diff --git a/tests/components/rgb/test.rp2040-ard.yaml b/tests/components/rgb/test.rp2040-ard.yaml
index fd6519707b..7d8e595f72 100644
--- a/tests/components/rgb/test.rp2040-ard.yaml
+++ b/tests/components/rgb/test.rp2040-ard.yaml
@@ -1,18 +1,7 @@
-output:
-  - platform: rp2040_pwm
-    id: light_output_1
-    pin: 12
-  - platform: rp2040_pwm
-    id: light_output_2
-    pin: 13
-  - platform: rp2040_pwm
-    id: light_output_3
-    pin: 14
+substitutions:
+  light_platform: rp2040_pwm
+  pin1: GPIO2
+  pin2: GPIO3
+  pin3: GPIO4
 
-light:
-  - platform: rgb
-    name: RGB Light
-    id: rgb_light
-    red: light_output_1
-    green: light_output_2
-    blue: light_output_3
+<<: !include common.yaml
diff --git a/tests/components/rgbct/common.yaml b/tests/components/rgbct/common.yaml
new file mode 100644
index 0000000000..65bb248e95
--- /dev/null
+++ b/tests/components/rgbct/common.yaml
@@ -0,0 +1,28 @@
+output:
+  - platform: ${light_platform}
+    id: light_output_1
+    pin: ${pin1}
+  - platform: ${light_platform}
+    id: light_output_2
+    pin: ${pin2}
+  - platform: ${light_platform}
+    id: light_output_3
+    pin: ${pin3}
+  - platform: ${light_platform}
+    id: light_output_4
+    pin: ${pin4}
+  - platform: ${light_platform}
+    id: light_output_5
+    pin: ${pin5}
+
+light:
+  - platform: rgbct
+    name: RGBCT Light
+    red: light_output_1
+    green: light_output_2
+    blue: light_output_3
+    color_temperature: light_output_4
+    white_brightness: light_output_5
+    cold_white_color_temperature: 153 mireds
+    warm_white_color_temperature: 500 mireds
+    color_interlock: true
diff --git a/tests/components/rgbct/test.esp32-ard.yaml b/tests/components/rgbct/test.esp32-ard.yaml
index d9758c9ec7..1ecc626e9c 100644
--- a/tests/components/rgbct/test.esp32-ard.yaml
+++ b/tests/components/rgbct/test.esp32-ard.yaml
@@ -1,28 +1,9 @@
-output:
-  - platform: ledc
-    id: light_output_1
-    pin: 12
-  - platform: ledc
-    id: light_output_2
-    pin: 13
-  - platform: ledc
-    id: light_output_3
-    pin: 14
-  - platform: ledc
-    id: light_output_4
-    pin: 15
-  - platform: ledc
-    id: light_output_5
-    pin: 16
+substitutions:
+  light_platform: ledc
+  pin1: GPIO12
+  pin2: GPIO13
+  pin3: GPIO14
+  pin4: GPIO15
+  pin5: GPIO16
 
-light:
-  - platform: rgbct
-    name: RGBCT Light
-    red: light_output_1
-    green: light_output_2
-    blue: light_output_3
-    color_temperature: light_output_4
-    white_brightness: light_output_5
-    cold_white_color_temperature: 153 mireds
-    warm_white_color_temperature: 500 mireds
-    color_interlock: true
+<<: !include common.yaml
diff --git a/tests/components/rgbct/test.esp32-c3-ard.yaml b/tests/components/rgbct/test.esp32-c3-ard.yaml
index 426c4b8937..27a1fbca4d 100644
--- a/tests/components/rgbct/test.esp32-c3-ard.yaml
+++ b/tests/components/rgbct/test.esp32-c3-ard.yaml
@@ -1,28 +1,9 @@
-output:
-  - platform: ledc
-    id: light_output_1
-    pin: 1
-  - platform: ledc
-    id: light_output_2
-    pin: 2
-  - platform: ledc
-    id: light_output_3
-    pin: 3
-  - platform: ledc
-    id: light_output_4
-    pin: 4
-  - platform: ledc
-    id: light_output_5
-    pin: 5
+substitutions:
+  light_platform: ledc
+  pin1: GPIO2
+  pin2: GPIO3
+  pin3: GPIO4
+  pin4: GPIO5
+  pin5: GPIO6
 
-light:
-  - platform: rgbct
-    name: RGBCT Light
-    red: light_output_1
-    green: light_output_2
-    blue: light_output_3
-    color_temperature: light_output_4
-    white_brightness: light_output_5
-    cold_white_color_temperature: 153 mireds
-    warm_white_color_temperature: 500 mireds
-    color_interlock: true
+<<: !include common.yaml
diff --git a/tests/components/rgbct/test.esp32-c3-idf.yaml b/tests/components/rgbct/test.esp32-c3-idf.yaml
index 426c4b8937..27a1fbca4d 100644
--- a/tests/components/rgbct/test.esp32-c3-idf.yaml
+++ b/tests/components/rgbct/test.esp32-c3-idf.yaml
@@ -1,28 +1,9 @@
-output:
-  - platform: ledc
-    id: light_output_1
-    pin: 1
-  - platform: ledc
-    id: light_output_2
-    pin: 2
-  - platform: ledc
-    id: light_output_3
-    pin: 3
-  - platform: ledc
-    id: light_output_4
-    pin: 4
-  - platform: ledc
-    id: light_output_5
-    pin: 5
+substitutions:
+  light_platform: ledc
+  pin1: GPIO2
+  pin2: GPIO3
+  pin3: GPIO4
+  pin4: GPIO5
+  pin5: GPIO6
 
-light:
-  - platform: rgbct
-    name: RGBCT Light
-    red: light_output_1
-    green: light_output_2
-    blue: light_output_3
-    color_temperature: light_output_4
-    white_brightness: light_output_5
-    cold_white_color_temperature: 153 mireds
-    warm_white_color_temperature: 500 mireds
-    color_interlock: true
+<<: !include common.yaml
diff --git a/tests/components/rgbct/test.esp32-idf.yaml b/tests/components/rgbct/test.esp32-idf.yaml
index d9758c9ec7..1ecc626e9c 100644
--- a/tests/components/rgbct/test.esp32-idf.yaml
+++ b/tests/components/rgbct/test.esp32-idf.yaml
@@ -1,28 +1,9 @@
-output:
-  - platform: ledc
-    id: light_output_1
-    pin: 12
-  - platform: ledc
-    id: light_output_2
-    pin: 13
-  - platform: ledc
-    id: light_output_3
-    pin: 14
-  - platform: ledc
-    id: light_output_4
-    pin: 15
-  - platform: ledc
-    id: light_output_5
-    pin: 16
+substitutions:
+  light_platform: ledc
+  pin1: GPIO12
+  pin2: GPIO13
+  pin3: GPIO14
+  pin4: GPIO15
+  pin5: GPIO16
 
-light:
-  - platform: rgbct
-    name: RGBCT Light
-    red: light_output_1
-    green: light_output_2
-    blue: light_output_3
-    color_temperature: light_output_4
-    white_brightness: light_output_5
-    cold_white_color_temperature: 153 mireds
-    warm_white_color_temperature: 500 mireds
-    color_interlock: true
+<<: !include common.yaml
diff --git a/tests/components/rgbct/test.esp8266-ard.yaml b/tests/components/rgbct/test.esp8266-ard.yaml
index b7008c9ae3..4b66a5927f 100644
--- a/tests/components/rgbct/test.esp8266-ard.yaml
+++ b/tests/components/rgbct/test.esp8266-ard.yaml
@@ -1,28 +1,9 @@
-output:
-  - platform: esp8266_pwm
-    id: light_output_1
-    pin: 12
-  - platform: esp8266_pwm
-    id: light_output_2
-    pin: 13
-  - platform: esp8266_pwm
-    id: light_output_3
-    pin: 14
-  - platform: esp8266_pwm
-    id: light_output_4
-    pin: 15
-  - platform: esp8266_pwm
-    id: light_output_5
-    pin: 16
+substitutions:
+  light_platform: esp8266_pwm
+  pin1: GPIO12
+  pin2: GPIO13
+  pin3: GPIO14
+  pin4: GPIO15
+  pin5: GPIO16
 
-light:
-  - platform: rgbct
-    name: RGBCT Light
-    red: light_output_1
-    green: light_output_2
-    blue: light_output_3
-    color_temperature: light_output_4
-    white_brightness: light_output_5
-    cold_white_color_temperature: 153 mireds
-    warm_white_color_temperature: 500 mireds
-    color_interlock: true
+<<: !include common.yaml
diff --git a/tests/components/rgbct/test.rp2040-ard.yaml b/tests/components/rgbct/test.rp2040-ard.yaml
index e7e959b2a4..36be8b7711 100644
--- a/tests/components/rgbct/test.rp2040-ard.yaml
+++ b/tests/components/rgbct/test.rp2040-ard.yaml
@@ -1,28 +1,9 @@
-output:
-  - platform: rp2040_pwm
-    id: light_output_1
-    pin: 12
-  - platform: rp2040_pwm
-    id: light_output_2
-    pin: 13
-  - platform: rp2040_pwm
-    id: light_output_3
-    pin: 14
-  - platform: rp2040_pwm
-    id: light_output_4
-    pin: 15
-  - platform: rp2040_pwm
-    id: light_output_5
-    pin: 16
+substitutions:
+  light_platform: rp2040_pwm
+  pin1: GPIO2
+  pin2: GPIO3
+  pin3: GPIO4
+  pin4: GPIO5
+  pin5: GPIO6
 
-light:
-  - platform: rgbct
-    name: RGBCT Light
-    red: light_output_1
-    green: light_output_2
-    blue: light_output_3
-    color_temperature: light_output_4
-    white_brightness: light_output_5
-    cold_white_color_temperature: 153 mireds
-    warm_white_color_temperature: 500 mireds
-    color_interlock: true
+<<: !include common.yaml
diff --git a/tests/components/rgbw/common.yaml b/tests/components/rgbw/common.yaml
new file mode 100644
index 0000000000..b0f44869d3
--- /dev/null
+++ b/tests/components/rgbw/common.yaml
@@ -0,0 +1,22 @@
+output:
+  - platform: ${light_platform}
+    id: light_output_1
+    pin: ${pin1}
+  - platform: ${light_platform}
+    id: light_output_2
+    pin: ${pin2}
+  - platform: ${light_platform}
+    id: light_output_3
+    pin: ${pin3}
+  - platform: ${light_platform}
+    id: light_output_4
+    pin: ${pin4}
+
+light:
+  - platform: rgbw
+    name: RGBW Light
+    red: light_output_1
+    green: light_output_2
+    blue: light_output_3
+    white: light_output_4
+    color_interlock: true
diff --git a/tests/components/rgbw/test.esp32-ard.yaml b/tests/components/rgbw/test.esp32-ard.yaml
index 6e9e92a03c..ea8efd1a34 100644
--- a/tests/components/rgbw/test.esp32-ard.yaml
+++ b/tests/components/rgbw/test.esp32-ard.yaml
@@ -1,22 +1,8 @@
-output:
-  - platform: ledc
-    id: light_output_1
-    pin: 12
-  - platform: ledc
-    id: light_output_2
-    pin: 13
-  - platform: ledc
-    id: light_output_3
-    pin: 14
-  - platform: ledc
-    id: light_output_4
-    pin: 15
+substitutions:
+  light_platform: ledc
+  pin1: GPIO12
+  pin2: GPIO13
+  pin3: GPIO14
+  pin4: GPIO15
 
-light:
-  - platform: rgbw
-    name: RGBW Light
-    red: light_output_1
-    green: light_output_2
-    blue: light_output_3
-    white: light_output_4
-    color_interlock: true
+<<: !include common.yaml
diff --git a/tests/components/rgbw/test.esp32-c3-ard.yaml b/tests/components/rgbw/test.esp32-c3-ard.yaml
index c5d4fceb9d..b44734344e 100644
--- a/tests/components/rgbw/test.esp32-c3-ard.yaml
+++ b/tests/components/rgbw/test.esp32-c3-ard.yaml
@@ -1,22 +1,8 @@
-output:
-  - platform: ledc
-    id: light_output_1
-    pin: 1
-  - platform: ledc
-    id: light_output_2
-    pin: 2
-  - platform: ledc
-    id: light_output_3
-    pin: 3
-  - platform: ledc
-    id: light_output_4
-    pin: 4
+substitutions:
+  light_platform: ledc
+  pin1: GPIO2
+  pin2: GPIO3
+  pin3: GPIO4
+  pin4: GPIO5
 
-light:
-  - platform: rgbw
-    name: RGBW Light
-    red: light_output_1
-    green: light_output_2
-    blue: light_output_3
-    white: light_output_4
-    color_interlock: true
+<<: !include common.yaml
diff --git a/tests/components/rgbw/test.esp32-c3-idf.yaml b/tests/components/rgbw/test.esp32-c3-idf.yaml
index c5d4fceb9d..b44734344e 100644
--- a/tests/components/rgbw/test.esp32-c3-idf.yaml
+++ b/tests/components/rgbw/test.esp32-c3-idf.yaml
@@ -1,22 +1,8 @@
-output:
-  - platform: ledc
-    id: light_output_1
-    pin: 1
-  - platform: ledc
-    id: light_output_2
-    pin: 2
-  - platform: ledc
-    id: light_output_3
-    pin: 3
-  - platform: ledc
-    id: light_output_4
-    pin: 4
+substitutions:
+  light_platform: ledc
+  pin1: GPIO2
+  pin2: GPIO3
+  pin3: GPIO4
+  pin4: GPIO5
 
-light:
-  - platform: rgbw
-    name: RGBW Light
-    red: light_output_1
-    green: light_output_2
-    blue: light_output_3
-    white: light_output_4
-    color_interlock: true
+<<: !include common.yaml
diff --git a/tests/components/rgbw/test.esp32-idf.yaml b/tests/components/rgbw/test.esp32-idf.yaml
index 6e9e92a03c..ea8efd1a34 100644
--- a/tests/components/rgbw/test.esp32-idf.yaml
+++ b/tests/components/rgbw/test.esp32-idf.yaml
@@ -1,22 +1,8 @@
-output:
-  - platform: ledc
-    id: light_output_1
-    pin: 12
-  - platform: ledc
-    id: light_output_2
-    pin: 13
-  - platform: ledc
-    id: light_output_3
-    pin: 14
-  - platform: ledc
-    id: light_output_4
-    pin: 15
+substitutions:
+  light_platform: ledc
+  pin1: GPIO12
+  pin2: GPIO13
+  pin3: GPIO14
+  pin4: GPIO15
 
-light:
-  - platform: rgbw
-    name: RGBW Light
-    red: light_output_1
-    green: light_output_2
-    blue: light_output_3
-    white: light_output_4
-    color_interlock: true
+<<: !include common.yaml
diff --git a/tests/components/rgbw/test.esp8266-ard.yaml b/tests/components/rgbw/test.esp8266-ard.yaml
index 54098613e4..31d6805b4e 100644
--- a/tests/components/rgbw/test.esp8266-ard.yaml
+++ b/tests/components/rgbw/test.esp8266-ard.yaml
@@ -1,22 +1,8 @@
-output:
-  - platform: esp8266_pwm
-    id: light_output_1
-    pin: 12
-  - platform: esp8266_pwm
-    id: light_output_2
-    pin: 13
-  - platform: esp8266_pwm
-    id: light_output_3
-    pin: 14
-  - platform: esp8266_pwm
-    id: light_output_4
-    pin: 15
+substitutions:
+  light_platform: esp8266_pwm
+  pin1: GPIO12
+  pin2: GPIO13
+  pin3: GPIO14
+  pin4: GPIO15
 
-light:
-  - platform: rgbw
-    name: RGBW Light
-    red: light_output_1
-    green: light_output_2
-    blue: light_output_3
-    white: light_output_4
-    color_interlock: true
+<<: !include common.yaml
diff --git a/tests/components/rgbw/test.rp2040-ard.yaml b/tests/components/rgbw/test.rp2040-ard.yaml
index 6a4437b898..bd22aa46f3 100644
--- a/tests/components/rgbw/test.rp2040-ard.yaml
+++ b/tests/components/rgbw/test.rp2040-ard.yaml
@@ -1,22 +1,8 @@
-output:
-  - platform: rp2040_pwm
-    id: light_output_1
-    pin: 12
-  - platform: rp2040_pwm
-    id: light_output_2
-    pin: 13
-  - platform: rp2040_pwm
-    id: light_output_3
-    pin: 14
-  - platform: rp2040_pwm
-    id: light_output_4
-    pin: 15
+substitutions:
+  light_platform: rp2040_pwm
+  pin1: GPIO2
+  pin2: GPIO3
+  pin3: GPIO4
+  pin4: GPIO5
 
-light:
-  - platform: rgbw
-    name: RGBW Light
-    red: light_output_1
-    green: light_output_2
-    blue: light_output_3
-    white: light_output_4
-    color_interlock: true
+<<: !include common.yaml
diff --git a/tests/components/rgbww/common.yaml b/tests/components/rgbww/common.yaml
new file mode 100644
index 0000000000..0013960c10
--- /dev/null
+++ b/tests/components/rgbww/common.yaml
@@ -0,0 +1,28 @@
+output:
+  - platform: ${light_platform}
+    id: light_output_1
+    pin: ${pin1}
+  - platform: ${light_platform}
+    id: light_output_2
+    pin: ${pin2}
+  - platform: ${light_platform}
+    id: light_output_3
+    pin: ${pin3}
+  - platform: ${light_platform}
+    id: light_output_4
+    pin: ${pin4}
+  - platform: ${light_platform}
+    id: light_output_5
+    pin: ${pin5}
+
+light:
+  - platform: rgbww
+    name: RGBWW Light
+    red: light_output_1
+    green: light_output_2
+    blue: light_output_3
+    cold_white: light_output_4
+    warm_white: light_output_5
+    cold_white_color_temperature: 153 mireds
+    warm_white_color_temperature: 500 mireds
+    color_interlock: true
diff --git a/tests/components/rgbww/test.esp32-ard.yaml b/tests/components/rgbww/test.esp32-ard.yaml
index c24b6b7746..1ecc626e9c 100644
--- a/tests/components/rgbww/test.esp32-ard.yaml
+++ b/tests/components/rgbww/test.esp32-ard.yaml
@@ -1,28 +1,9 @@
-output:
-  - platform: ledc
-    id: light_output_1
-    pin: 12
-  - platform: ledc
-    id: light_output_2
-    pin: 13
-  - platform: ledc
-    id: light_output_3
-    pin: 14
-  - platform: ledc
-    id: light_output_4
-    pin: 15
-  - platform: ledc
-    id: light_output_5
-    pin: 16
+substitutions:
+  light_platform: ledc
+  pin1: GPIO12
+  pin2: GPIO13
+  pin3: GPIO14
+  pin4: GPIO15
+  pin5: GPIO16
 
-light:
-  - platform: rgbww
-    name: RGBWW Light
-    red: light_output_1
-    green: light_output_2
-    blue: light_output_3
-    cold_white: light_output_4
-    warm_white: light_output_5
-    cold_white_color_temperature: 153 mireds
-    warm_white_color_temperature: 500 mireds
-    color_interlock: true
+<<: !include common.yaml
diff --git a/tests/components/rgbww/test.esp32-c3-ard.yaml b/tests/components/rgbww/test.esp32-c3-ard.yaml
index 49e9c7f331..27a1fbca4d 100644
--- a/tests/components/rgbww/test.esp32-c3-ard.yaml
+++ b/tests/components/rgbww/test.esp32-c3-ard.yaml
@@ -1,28 +1,9 @@
-output:
-  - platform: ledc
-    id: light_output_1
-    pin: 1
-  - platform: ledc
-    id: light_output_2
-    pin: 2
-  - platform: ledc
-    id: light_output_3
-    pin: 3
-  - platform: ledc
-    id: light_output_4
-    pin: 4
-  - platform: ledc
-    id: light_output_5
-    pin: 5
+substitutions:
+  light_platform: ledc
+  pin1: GPIO2
+  pin2: GPIO3
+  pin3: GPIO4
+  pin4: GPIO5
+  pin5: GPIO6
 
-light:
-  - platform: rgbww
-    name: RGBWW Light
-    red: light_output_1
-    green: light_output_2
-    blue: light_output_3
-    cold_white: light_output_4
-    warm_white: light_output_5
-    cold_white_color_temperature: 153 mireds
-    warm_white_color_temperature: 500 mireds
-    color_interlock: true
+<<: !include common.yaml
diff --git a/tests/components/rgbww/test.esp32-c3-idf.yaml b/tests/components/rgbww/test.esp32-c3-idf.yaml
index 49e9c7f331..27a1fbca4d 100644
--- a/tests/components/rgbww/test.esp32-c3-idf.yaml
+++ b/tests/components/rgbww/test.esp32-c3-idf.yaml
@@ -1,28 +1,9 @@
-output:
-  - platform: ledc
-    id: light_output_1
-    pin: 1
-  - platform: ledc
-    id: light_output_2
-    pin: 2
-  - platform: ledc
-    id: light_output_3
-    pin: 3
-  - platform: ledc
-    id: light_output_4
-    pin: 4
-  - platform: ledc
-    id: light_output_5
-    pin: 5
+substitutions:
+  light_platform: ledc
+  pin1: GPIO2
+  pin2: GPIO3
+  pin3: GPIO4
+  pin4: GPIO5
+  pin5: GPIO6
 
-light:
-  - platform: rgbww
-    name: RGBWW Light
-    red: light_output_1
-    green: light_output_2
-    blue: light_output_3
-    cold_white: light_output_4
-    warm_white: light_output_5
-    cold_white_color_temperature: 153 mireds
-    warm_white_color_temperature: 500 mireds
-    color_interlock: true
+<<: !include common.yaml
diff --git a/tests/components/rgbww/test.esp32-idf.yaml b/tests/components/rgbww/test.esp32-idf.yaml
index c24b6b7746..1ecc626e9c 100644
--- a/tests/components/rgbww/test.esp32-idf.yaml
+++ b/tests/components/rgbww/test.esp32-idf.yaml
@@ -1,28 +1,9 @@
-output:
-  - platform: ledc
-    id: light_output_1
-    pin: 12
-  - platform: ledc
-    id: light_output_2
-    pin: 13
-  - platform: ledc
-    id: light_output_3
-    pin: 14
-  - platform: ledc
-    id: light_output_4
-    pin: 15
-  - platform: ledc
-    id: light_output_5
-    pin: 16
+substitutions:
+  light_platform: ledc
+  pin1: GPIO12
+  pin2: GPIO13
+  pin3: GPIO14
+  pin4: GPIO15
+  pin5: GPIO16
 
-light:
-  - platform: rgbww
-    name: RGBWW Light
-    red: light_output_1
-    green: light_output_2
-    blue: light_output_3
-    cold_white: light_output_4
-    warm_white: light_output_5
-    cold_white_color_temperature: 153 mireds
-    warm_white_color_temperature: 500 mireds
-    color_interlock: true
+<<: !include common.yaml
diff --git a/tests/components/rgbww/test.esp8266-ard.yaml b/tests/components/rgbww/test.esp8266-ard.yaml
index 4ea26e6526..4b66a5927f 100644
--- a/tests/components/rgbww/test.esp8266-ard.yaml
+++ b/tests/components/rgbww/test.esp8266-ard.yaml
@@ -1,28 +1,9 @@
-output:
-  - platform: esp8266_pwm
-    id: light_output_1
-    pin: 12
-  - platform: esp8266_pwm
-    id: light_output_2
-    pin: 13
-  - platform: esp8266_pwm
-    id: light_output_3
-    pin: 14
-  - platform: esp8266_pwm
-    id: light_output_4
-    pin: 15
-  - platform: esp8266_pwm
-    id: light_output_5
-    pin: 16
+substitutions:
+  light_platform: esp8266_pwm
+  pin1: GPIO12
+  pin2: GPIO13
+  pin3: GPIO14
+  pin4: GPIO15
+  pin5: GPIO16
 
-light:
-  - platform: rgbww
-    name: RGBWW Light
-    red: light_output_1
-    green: light_output_2
-    blue: light_output_3
-    cold_white: light_output_4
-    warm_white: light_output_5
-    cold_white_color_temperature: 153 mireds
-    warm_white_color_temperature: 500 mireds
-    color_interlock: true
+<<: !include common.yaml
diff --git a/tests/components/rgbww/test.rp2040-ard.yaml b/tests/components/rgbww/test.rp2040-ard.yaml
index 0986f06e78..36be8b7711 100644
--- a/tests/components/rgbww/test.rp2040-ard.yaml
+++ b/tests/components/rgbww/test.rp2040-ard.yaml
@@ -1,28 +1,9 @@
-output:
-  - platform: rp2040_pwm
-    id: light_output_1
-    pin: 12
-  - platform: rp2040_pwm
-    id: light_output_2
-    pin: 13
-  - platform: rp2040_pwm
-    id: light_output_3
-    pin: 14
-  - platform: rp2040_pwm
-    id: light_output_4
-    pin: 15
-  - platform: rp2040_pwm
-    id: light_output_5
-    pin: 16
+substitutions:
+  light_platform: rp2040_pwm
+  pin1: GPIO2
+  pin2: GPIO3
+  pin3: GPIO4
+  pin4: GPIO5
+  pin5: GPIO6
 
-light:
-  - platform: rgbww
-    name: RGBWW Light
-    red: light_output_1
-    green: light_output_2
-    blue: light_output_3
-    cold_white: light_output_4
-    warm_white: light_output_5
-    cold_white_color_temperature: 153 mireds
-    warm_white_color_temperature: 500 mireds
-    color_interlock: true
+<<: !include common.yaml
diff --git a/tests/components/rotary_encoder/common.yaml b/tests/components/rotary_encoder/common.yaml
new file mode 100644
index 0000000000..57ffdab817
--- /dev/null
+++ b/tests/components/rotary_encoder/common.yaml
@@ -0,0 +1,25 @@
+sensor:
+  - platform: rotary_encoder
+    name: Rotary Encoder
+    id: rotary_encoder1
+    pin_a: ${pin_a}
+    pin_b: ${pin_b}
+    pin_reset: ${pin_reset}
+    filters:
+      - or:
+          - debounce: 0.1s
+          - delta: 10
+    resolution: 4
+    min_value: -10
+    max_value: 30
+    on_value:
+      - sensor.rotary_encoder.set_value:
+          id: rotary_encoder1
+          value: 10
+      - sensor.rotary_encoder.set_value:
+          id: rotary_encoder1
+          value: !lambda "return -1;"
+    on_clockwise:
+      - logger.log: Clockwise
+    on_anticlockwise:
+      - logger.log: Anticlockwise
diff --git a/tests/components/rotary_encoder/test.esp32-ard.yaml b/tests/components/rotary_encoder/test.esp32-ard.yaml
index da3843f82d..48a624aa37 100644
--- a/tests/components/rotary_encoder/test.esp32-ard.yaml
+++ b/tests/components/rotary_encoder/test.esp32-ard.yaml
@@ -1,25 +1,6 @@
-sensor:
-  - platform: rotary_encoder
-    name: Rotary Encoder
-    id: rotary_encoder1
-    pin_a: 13
-    pin_b: 14
-    pin_reset: 15
-    filters:
-      - or:
-          - debounce: 0.1s
-          - delta: 10
-    resolution: 4
-    min_value: -10
-    max_value: 30
-    on_value:
-      - sensor.rotary_encoder.set_value:
-          id: rotary_encoder1
-          value: 10
-      - sensor.rotary_encoder.set_value:
-          id: rotary_encoder1
-          value: !lambda "return -1;"
-    on_clockwise:
-      - logger.log: Clockwise
-    on_anticlockwise:
-      - logger.log: Anticlockwise
+substitutions:
+  pin_a: GPIO12
+  pin_b: GPIO13
+  pin_reset: GPIO14
+
+<<: !include common.yaml
diff --git a/tests/components/rotary_encoder/test.esp32-c3-ard.yaml b/tests/components/rotary_encoder/test.esp32-c3-ard.yaml
index 59f8b56abf..b71a454bdd 100644
--- a/tests/components/rotary_encoder/test.esp32-c3-ard.yaml
+++ b/tests/components/rotary_encoder/test.esp32-c3-ard.yaml
@@ -1,25 +1,6 @@
-sensor:
-  - platform: rotary_encoder
-    name: Rotary Encoder
-    id: rotary_encoder1
-    pin_a: 3
-    pin_b: 4
-    pin_reset: 5
-    filters:
-      - or:
-          - debounce: 0.1s
-          - delta: 10
-    resolution: 4
-    min_value: -10
-    max_value: 30
-    on_value:
-      - sensor.rotary_encoder.set_value:
-          id: rotary_encoder1
-          value: 10
-      - sensor.rotary_encoder.set_value:
-          id: rotary_encoder1
-          value: !lambda "return -1;"
-    on_clockwise:
-      - logger.log: Clockwise
-    on_anticlockwise:
-      - logger.log: Anticlockwise
+substitutions:
+  pin_a: GPIO2
+  pin_b: GPIO3
+  pin_reset: GPIO4
+
+<<: !include common.yaml
diff --git a/tests/components/rotary_encoder/test.esp32-c3-idf.yaml b/tests/components/rotary_encoder/test.esp32-c3-idf.yaml
index 59f8b56abf..b71a454bdd 100644
--- a/tests/components/rotary_encoder/test.esp32-c3-idf.yaml
+++ b/tests/components/rotary_encoder/test.esp32-c3-idf.yaml
@@ -1,25 +1,6 @@
-sensor:
-  - platform: rotary_encoder
-    name: Rotary Encoder
-    id: rotary_encoder1
-    pin_a: 3
-    pin_b: 4
-    pin_reset: 5
-    filters:
-      - or:
-          - debounce: 0.1s
-          - delta: 10
-    resolution: 4
-    min_value: -10
-    max_value: 30
-    on_value:
-      - sensor.rotary_encoder.set_value:
-          id: rotary_encoder1
-          value: 10
-      - sensor.rotary_encoder.set_value:
-          id: rotary_encoder1
-          value: !lambda "return -1;"
-    on_clockwise:
-      - logger.log: Clockwise
-    on_anticlockwise:
-      - logger.log: Anticlockwise
+substitutions:
+  pin_a: GPIO2
+  pin_b: GPIO3
+  pin_reset: GPIO4
+
+<<: !include common.yaml
diff --git a/tests/components/rotary_encoder/test.esp32-idf.yaml b/tests/components/rotary_encoder/test.esp32-idf.yaml
index da3843f82d..48a624aa37 100644
--- a/tests/components/rotary_encoder/test.esp32-idf.yaml
+++ b/tests/components/rotary_encoder/test.esp32-idf.yaml
@@ -1,25 +1,6 @@
-sensor:
-  - platform: rotary_encoder
-    name: Rotary Encoder
-    id: rotary_encoder1
-    pin_a: 13
-    pin_b: 14
-    pin_reset: 15
-    filters:
-      - or:
-          - debounce: 0.1s
-          - delta: 10
-    resolution: 4
-    min_value: -10
-    max_value: 30
-    on_value:
-      - sensor.rotary_encoder.set_value:
-          id: rotary_encoder1
-          value: 10
-      - sensor.rotary_encoder.set_value:
-          id: rotary_encoder1
-          value: !lambda "return -1;"
-    on_clockwise:
-      - logger.log: Clockwise
-    on_anticlockwise:
-      - logger.log: Anticlockwise
+substitutions:
+  pin_a: GPIO12
+  pin_b: GPIO13
+  pin_reset: GPIO14
+
+<<: !include common.yaml
diff --git a/tests/components/rotary_encoder/test.esp8266-ard.yaml b/tests/components/rotary_encoder/test.esp8266-ard.yaml
index da3843f82d..48a624aa37 100644
--- a/tests/components/rotary_encoder/test.esp8266-ard.yaml
+++ b/tests/components/rotary_encoder/test.esp8266-ard.yaml
@@ -1,25 +1,6 @@
-sensor:
-  - platform: rotary_encoder
-    name: Rotary Encoder
-    id: rotary_encoder1
-    pin_a: 13
-    pin_b: 14
-    pin_reset: 15
-    filters:
-      - or:
-          - debounce: 0.1s
-          - delta: 10
-    resolution: 4
-    min_value: -10
-    max_value: 30
-    on_value:
-      - sensor.rotary_encoder.set_value:
-          id: rotary_encoder1
-          value: 10
-      - sensor.rotary_encoder.set_value:
-          id: rotary_encoder1
-          value: !lambda "return -1;"
-    on_clockwise:
-      - logger.log: Clockwise
-    on_anticlockwise:
-      - logger.log: Anticlockwise
+substitutions:
+  pin_a: GPIO12
+  pin_b: GPIO13
+  pin_reset: GPIO14
+
+<<: !include common.yaml
diff --git a/tests/components/rotary_encoder/test.rp2040-ard.yaml b/tests/components/rotary_encoder/test.rp2040-ard.yaml
index da3843f82d..b71a454bdd 100644
--- a/tests/components/rotary_encoder/test.rp2040-ard.yaml
+++ b/tests/components/rotary_encoder/test.rp2040-ard.yaml
@@ -1,25 +1,6 @@
-sensor:
-  - platform: rotary_encoder
-    name: Rotary Encoder
-    id: rotary_encoder1
-    pin_a: 13
-    pin_b: 14
-    pin_reset: 15
-    filters:
-      - or:
-          - debounce: 0.1s
-          - delta: 10
-    resolution: 4
-    min_value: -10
-    max_value: 30
-    on_value:
-      - sensor.rotary_encoder.set_value:
-          id: rotary_encoder1
-          value: 10
-      - sensor.rotary_encoder.set_value:
-          id: rotary_encoder1
-          value: !lambda "return -1;"
-    on_clockwise:
-      - logger.log: Clockwise
-    on_anticlockwise:
-      - logger.log: Anticlockwise
+substitutions:
+  pin_a: GPIO2
+  pin_b: GPIO3
+  pin_reset: GPIO4
+
+<<: !include common.yaml
diff --git a/tests/components/rtttl/common.yaml b/tests/components/rtttl/common.yaml
new file mode 100644
index 0000000000..86b52ca3de
--- /dev/null
+++ b/tests/components/rtttl/common.yaml
@@ -0,0 +1,15 @@
+esphome:
+  on_boot:
+    then:
+      - rtttl.play: 'siren:d=8,o=5,b=100:d,e,d,e,d,e,d,e'
+      - rtttl.stop
+
+output:
+  - platform: ${output_platform}
+    id: rtttl_output
+    pin: ${pin}
+    frequency: 1500Hz
+    max_power: 0.5
+
+rtttl:
+  output: rtttl_output
diff --git a/tests/components/rtttl/test.esp32-ard.yaml b/tests/components/rtttl/test.esp32-ard.yaml
index 367a670741..26da1ce1d6 100644
--- a/tests/components/rtttl/test.esp32-ard.yaml
+++ b/tests/components/rtttl/test.esp32-ard.yaml
@@ -1,16 +1,5 @@
-esphome:
-  on_boot:
-    then:
-      - rtttl.play: 'siren:d=8,o=5,b=100:d,e,d,e,d,e,d,e'
-      - rtttl.stop
+substitutions:
+  output_platform: ledc
+  pin: GPIO14
 
-output:
-  - platform: ledc
-    id: rtttl_output
-    pin: 13
-    frequency: 1500Hz
-    channel: 14
-    max_power: 0.5
-
-rtttl:
-  output: rtttl_output
+<<: !include common.yaml
diff --git a/tests/components/rtttl/test.esp32-c3-ard.yaml b/tests/components/rtttl/test.esp32-c3-ard.yaml
index c525f417de..7476963591 100644
--- a/tests/components/rtttl/test.esp32-c3-ard.yaml
+++ b/tests/components/rtttl/test.esp32-c3-ard.yaml
@@ -1,16 +1,5 @@
-esphome:
-  on_boot:
-    then:
-      - rtttl.play: 'siren:d=8,o=5,b=100:d,e,d,e,d,e,d,e'
-      - rtttl.stop
+substitutions:
+  output_platform: ledc
+  pin: GPIO4
 
-output:
-  - platform: ledc
-    id: rtttl_output
-    pin: 1
-    frequency: 1500Hz
-    channel: 14
-    max_power: 0.5
-
-rtttl:
-  output: rtttl_output
+<<: !include common.yaml
diff --git a/tests/components/rtttl/test.esp32-c3-idf.yaml b/tests/components/rtttl/test.esp32-c3-idf.yaml
index c525f417de..7476963591 100644
--- a/tests/components/rtttl/test.esp32-c3-idf.yaml
+++ b/tests/components/rtttl/test.esp32-c3-idf.yaml
@@ -1,16 +1,5 @@
-esphome:
-  on_boot:
-    then:
-      - rtttl.play: 'siren:d=8,o=5,b=100:d,e,d,e,d,e,d,e'
-      - rtttl.stop
+substitutions:
+  output_platform: ledc
+  pin: GPIO4
 
-output:
-  - platform: ledc
-    id: rtttl_output
-    pin: 1
-    frequency: 1500Hz
-    channel: 14
-    max_power: 0.5
-
-rtttl:
-  output: rtttl_output
+<<: !include common.yaml
diff --git a/tests/components/rtttl/test.esp32-idf.yaml b/tests/components/rtttl/test.esp32-idf.yaml
index 367a670741..26da1ce1d6 100644
--- a/tests/components/rtttl/test.esp32-idf.yaml
+++ b/tests/components/rtttl/test.esp32-idf.yaml
@@ -1,16 +1,5 @@
-esphome:
-  on_boot:
-    then:
-      - rtttl.play: 'siren:d=8,o=5,b=100:d,e,d,e,d,e,d,e'
-      - rtttl.stop
+substitutions:
+  output_platform: ledc
+  pin: GPIO14
 
-output:
-  - platform: ledc
-    id: rtttl_output
-    pin: 13
-    frequency: 1500Hz
-    channel: 14
-    max_power: 0.5
-
-rtttl:
-  output: rtttl_output
+<<: !include common.yaml
diff --git a/tests/components/rtttl/test.esp8266-ard.yaml b/tests/components/rtttl/test.esp8266-ard.yaml
index c3b87c0f72..23a7f43b42 100644
--- a/tests/components/rtttl/test.esp8266-ard.yaml
+++ b/tests/components/rtttl/test.esp8266-ard.yaml
@@ -1,15 +1,5 @@
-esphome:
-  on_boot:
-    then:
-      - rtttl.play: 'siren:d=8,o=5,b=100:d,e,d,e,d,e,d,e'
-      - rtttl.stop
+substitutions:
+  output_platform: esp8266_pwm
+  pin: GPIO14
 
-output:
-  - platform: esp8266_pwm
-    id: rtttl_output
-    pin: 13
-    frequency: 1500Hz
-    max_power: 0.5
-
-rtttl:
-  output: rtttl_output
+<<: !include common.yaml
diff --git a/tests/components/rtttl/test.rp2040-ard.yaml b/tests/components/rtttl/test.rp2040-ard.yaml
index ea240aa34d..d70f7c74ec 100644
--- a/tests/components/rtttl/test.rp2040-ard.yaml
+++ b/tests/components/rtttl/test.rp2040-ard.yaml
@@ -1,15 +1,5 @@
-esphome:
-  on_boot:
-    then:
-      - rtttl.play: 'siren:d=8,o=5,b=100:d,e,d,e,d,e,d,e'
-      - rtttl.stop
+substitutions:
+  output_platform: rp2040_pwm
+  pin: GPIO4
 
-output:
-  - platform: rp2040_pwm
-    id: rtttl_output
-    pin: 3
-    frequency: 1500Hz
-    max_power: 0.5
-
-rtttl:
-  output: rtttl_output
+<<: !include common.yaml