From 206a1912f25a35eee44853949dc5efcc767bee6f Mon Sep 17 00:00:00 2001 From: pszafer Date: Mon, 27 May 2024 20:32:25 +0200 Subject: [PATCH] add serial_prefix to config --- boneio-24x16_switches_v0_5-v0_6.yaml | 4 +++- boneio-24x16_switches_v0_7.yaml | 4 +++- boneio-32x10_lights_v0_5-v0_6.yaml | 4 +++- boneio-32x10_lights_v0_7.yaml | 4 +++- boneio-32x10_switches_v0_5-v0_6.yaml | 4 +++- boneio-32x10_switches_v0_7.yaml | 4 +++- boneio-cover_mix_lights_v0_5-v0_6.yaml | 4 +++- boneio-cover_mix_lights_v0_7.yaml | 4 +++- boneio-cover_mix_switches_v0_5-v0_6.yaml | 4 +++- boneio-cover_mix_switches_v0_7.yaml | 4 +++- boneio-cover_v0_5-v0_6.yaml | 4 +++- boneio-cover_v0_7.yaml | 4 +++- boneio-dimmer_2rgbw-v0_3.yaml | 5 +++-- boneio-dimmer_4cct-v0_3.yaml | 5 +++-- boneio-dimmer_8ch-v0_3.yaml | 5 +++-- devices/{dimmer_serial_no.yaml => serial_no.yaml} | 4 ++-- 16 files changed, 47 insertions(+), 20 deletions(-) rename devices/{dimmer_serial_no.yaml => serial_no.yaml} (64%) diff --git a/boneio-24x16_switches_v0_5-v0_6.yaml b/boneio-24x16_switches_v0_5-v0_6.yaml index c54c0fc..2bab737 100644 --- a/boneio-24x16_switches_v0_5-v0_6.yaml +++ b/boneio-24x16_switches_v0_5-v0_6.yaml @@ -1,6 +1,7 @@ substitutions: name: boneio-24-sw-06 friendly_name: 'BoneIO ESP 24x16 Switches' + serial_prefix: 'esp24' #Don't change it. esphome: name: '${name}' @@ -29,9 +30,10 @@ dashboard_import: packages: internals_packages: url: https://github.com/boneIO-eu/esphome - ref: v1.0.15 + ref: v1.0.16 files: [ 'devices/buzzer.yaml', + 'devices/serial_no.yaml', 'devices_v0_5-v0_6/display.yaml', 'devices_v0_5-v0_6/time.yaml', 'devices_v0_5-v0_6/i2c.yaml', diff --git a/boneio-24x16_switches_v0_7.yaml b/boneio-24x16_switches_v0_7.yaml index 2d7f2b3..8f6ae0a 100644 --- a/boneio-24x16_switches_v0_7.yaml +++ b/boneio-24x16_switches_v0_7.yaml @@ -1,6 +1,7 @@ substitutions: name: boneio-24-sw-07 friendly_name: 'BoneIO ESP 24x16 Switches' + serial_prefix: 'esp24' #Don't change it. esphome: name: '${name}' @@ -29,9 +30,10 @@ dashboard_import: packages: internals_packages: url: https://github.com/boneIO-eu/esphome - ref: v1.0.15 + ref: v1.0.16 files: [ 'devices/buzzer.yaml', + 'devices/serial_no.yaml', 'devices_v0_7/display.yaml', 'devices_v0_7/i2c.yaml', 'devices_v0_7/ina219.yaml', diff --git a/boneio-32x10_lights_v0_5-v0_6.yaml b/boneio-32x10_lights_v0_5-v0_6.yaml index cbc462a..82e80d1 100644 --- a/boneio-32x10_lights_v0_5-v0_6.yaml +++ b/boneio-32x10_lights_v0_5-v0_6.yaml @@ -1,6 +1,7 @@ substitutions: name: boneio-32-l-06 friendly_name: 'BoneIO ESP 32x10 Lights' + serial_prefix: 'esp32' #Don't change it. esphome: name: '${name}' @@ -29,9 +30,10 @@ dashboard_import: packages: internals_packages: url: https://github.com/boneIO-eu/esphome - ref: v1.0.15 + ref: v1.0.16 files: [ 'devices/buzzer.yaml', + 'devices/serial_no.yaml', 'devices_v0_5-v0_6/display.yaml', 'devices_v0_5-v0_6/time.yaml', 'devices_v0_5-v0_6/i2c.yaml', diff --git a/boneio-32x10_lights_v0_7.yaml b/boneio-32x10_lights_v0_7.yaml index c2d4b54..d024264 100644 --- a/boneio-32x10_lights_v0_7.yaml +++ b/boneio-32x10_lights_v0_7.yaml @@ -1,6 +1,7 @@ substitutions: name: boneio-32-l-07 friendly_name: 'BoneIO ESP 32x10 Lights' + serial_prefix: 'esp32' #Don't change it. esphome: name: '${name}' @@ -29,9 +30,10 @@ dashboard_import: packages: internals_packages: url: https://github.com/boneIO-eu/esphome - ref: v1.0.15 + ref: v1.0.16 files: [ 'devices/buzzer.yaml', + 'devices/serial_no.yaml', 'devices_v0_7/display.yaml', 'devices_v0_7/i2c.yaml', 'devices_v0_7/ina219.yaml', diff --git a/boneio-32x10_switches_v0_5-v0_6.yaml b/boneio-32x10_switches_v0_5-v0_6.yaml index f78cc7d..a452e93 100644 --- a/boneio-32x10_switches_v0_5-v0_6.yaml +++ b/boneio-32x10_switches_v0_5-v0_6.yaml @@ -1,6 +1,7 @@ substitutions: name: boneio-32-sw-06 friendly_name: 'BoneIO ESP 32x10 Switches' + serial_prefix: 'esp32' #Don't change it. esphome: name: '${name}' @@ -29,9 +30,10 @@ dashboard_import: packages: internals_packages: url: https://github.com/boneIO-eu/esphome - ref: v1.0.15 + ref: v1.0.16 files: [ 'devices/buzzer.yaml', + 'devices/serial_no.yaml', 'devices_v0_5-v0_6/display.yaml', 'devices_v0_5-v0_6/time.yaml', 'devices_v0_5-v0_6/i2c.yaml', diff --git a/boneio-32x10_switches_v0_7.yaml b/boneio-32x10_switches_v0_7.yaml index 147c831..6101684 100644 --- a/boneio-32x10_switches_v0_7.yaml +++ b/boneio-32x10_switches_v0_7.yaml @@ -1,6 +1,7 @@ substitutions: name: boneio-32-sw-07 friendly_name: 'BoneIO ESP 32x10 Switches' + serial_prefix: 'esp32' #Don't change it. esphome: name: '${name}' @@ -29,9 +30,10 @@ dashboard_import: packages: internals_packages: url: https://github.com/boneIO-eu/esphome - ref: v1.0.15 + ref: v1.0.16 files: [ 'devices/buzzer.yaml', + 'devices/serial_no.yaml', 'devices_v0_7/display.yaml', 'devices_v0_7/i2c.yaml', 'devices_v0_7/ina219.yaml', diff --git a/boneio-cover_mix_lights_v0_5-v0_6.yaml b/boneio-cover_mix_lights_v0_5-v0_6.yaml index d5e0fb9..691a318 100644 --- a/boneio-cover_mix_lights_v0_5-v0_6.yaml +++ b/boneio-cover_mix_lights_v0_5-v0_6.yaml @@ -1,6 +1,7 @@ substitutions: name: boneio-cm-l-06 friendly_name: 'BoneIO ESP Cover Mix Lights' + serial_prefix: 'espcm' #Don't change it. esphome: name: '${name}' @@ -29,9 +30,10 @@ dashboard_import: packages: internals_packages: url: https://github.com/boneIO-eu/esphome - ref: v1.0.15 + ref: v1.0.16 files: [ 'devices/buzzer.yaml', + 'devices/serial_no.yaml', 'devices_v0_5-v0_6/display.yaml', 'devices_v0_5-v0_6/time.yaml', 'devices_v0_5-v0_6/i2c.yaml', diff --git a/boneio-cover_mix_lights_v0_7.yaml b/boneio-cover_mix_lights_v0_7.yaml index 6f65b34..21f2bee 100644 --- a/boneio-cover_mix_lights_v0_7.yaml +++ b/boneio-cover_mix_lights_v0_7.yaml @@ -1,6 +1,7 @@ substitutions: name: boneio-cm-l-07 friendly_name: 'BoneIO ESP Cover Mix Lights' + serial_prefix: 'espcm' #Don't change it. esphome: name: '${name}' @@ -29,9 +30,10 @@ dashboard_import: packages: internals_packages: url: https://github.com/boneIO-eu/esphome - ref: v1.0.15 + ref: v1.0.16 files: [ 'devices/buzzer.yaml', + 'devices/serial_no.yaml', 'devices_v0_7/display.yaml', 'devices_v0_7/i2c.yaml', 'devices_v0_7/ina219.yaml', diff --git a/boneio-cover_mix_switches_v0_5-v0_6.yaml b/boneio-cover_mix_switches_v0_5-v0_6.yaml index 6c2f67d..8cb5ba8 100644 --- a/boneio-cover_mix_switches_v0_5-v0_6.yaml +++ b/boneio-cover_mix_switches_v0_5-v0_6.yaml @@ -1,6 +1,7 @@ substitutions: name: boneio-cm-sw-06 friendly_name: 'BoneIO ESP Cover Mix Switches' + serial_prefix: 'espcm' #Don't change it. esphome: name: '${name}' @@ -29,9 +30,10 @@ dashboard_import: packages: internals_packages: url: https://github.com/boneIO-eu/esphome - ref: v1.0.15 + ref: v1.0.16 files: [ 'devices/buzzer.yaml', + 'devices/serial_no.yaml', 'devices_v0_5-v0_6/display.yaml', 'devices_v0_5-v0_6/time.yaml', 'devices_v0_5-v0_6/i2c.yaml', diff --git a/boneio-cover_mix_switches_v0_7.yaml b/boneio-cover_mix_switches_v0_7.yaml index 4580931..7d85b59 100644 --- a/boneio-cover_mix_switches_v0_7.yaml +++ b/boneio-cover_mix_switches_v0_7.yaml @@ -1,6 +1,7 @@ substitutions: name: boneio-cm-sw-07 friendly_name: 'BoneIO ESP Cover Mix Switches' + serial_prefix: 'espcm' #Don't change it. esphome: name: '${name}' @@ -29,9 +30,10 @@ dashboard_import: packages: internals_packages: url: https://github.com/boneIO-eu/esphome - ref: v1.0.15 + ref: v1.0.16 files: [ 'devices/buzzer.yaml', + 'devices/serial_no.yaml', 'devices_v0_7/display.yaml', 'devices_v0_7/i2c.yaml', 'devices_v0_7/ina219.yaml', diff --git a/boneio-cover_v0_5-v0_6.yaml b/boneio-cover_v0_5-v0_6.yaml index 0275eab..8e6b72b 100644 --- a/boneio-cover_v0_5-v0_6.yaml +++ b/boneio-cover_v0_5-v0_6.yaml @@ -1,6 +1,7 @@ substitutions: name: boneio-c-06 friendly_name: 'BoneIO ESP Cover' + serial_prefix: 'espc' #Don't change it. esphome: name: '${name}' @@ -29,9 +30,10 @@ dashboard_import: packages: internals_packages: url: https://github.com/boneIO-eu/esphome - ref: v1.0.15 + ref: v1.0.16 files: [ 'devices/buzzer.yaml', + 'devices/serial_no.yaml', 'devices_v0_5-v0_6/display.yaml', 'devices_v0_5-v0_6/time.yaml', 'devices_v0_5-v0_6/i2c.yaml', diff --git a/boneio-cover_v0_7.yaml b/boneio-cover_v0_7.yaml index 042fa18..f78b974 100644 --- a/boneio-cover_v0_7.yaml +++ b/boneio-cover_v0_7.yaml @@ -1,6 +1,7 @@ substitutions: name: boneio-c-07 friendly_name: 'BoneIO ESP Cover' + serial_prefix: 'espc' #Don't change it. esphome: name: '${name}' @@ -29,9 +30,10 @@ dashboard_import: packages: internals_packages: url: https://github.com/boneIO-eu/esphome - ref: v1.0.15 + ref: v1.0.16 files: [ 'devices/buzzer.yaml', + 'devices/serial_no.yaml', 'devices_v0_7/display.yaml', 'devices_v0_7/i2c.yaml', 'devices_v0_7/ina219.yaml', diff --git a/boneio-dimmer_2rgbw-v0_3.yaml b/boneio-dimmer_2rgbw-v0_3.yaml index 2bd850e..3d9faa1 100644 --- a/boneio-dimmer_2rgbw-v0_3.yaml +++ b/boneio-dimmer_2rgbw-v0_3.yaml @@ -1,6 +1,7 @@ substitutions: name: boneio-dr-rgbw-03 friendly_name: 'BoneIO Dimmer LED' + serial_prefix: 'dim' #Don't change it. esphome: name: '${name}' @@ -20,10 +21,10 @@ external_components: packages: internals_packages: url: https://github.com/boneIO-eu/esphome - ref: v1.0.15 + ref: v1.0.16 files: [ - 'devices/dimmer_serial_no.yaml', + 'devices/serial_no.yaml', 'devices/dimmer_i2c.yaml', 'devices/dimmer_ina219.yaml', ] diff --git a/boneio-dimmer_4cct-v0_3.yaml b/boneio-dimmer_4cct-v0_3.yaml index 8c04d56..74e6154 100644 --- a/boneio-dimmer_4cct-v0_3.yaml +++ b/boneio-dimmer_4cct-v0_3.yaml @@ -1,6 +1,7 @@ substitutions: name: boneio-dr-4cct-03 friendly_name: 'BoneIO Dimmer LED' + serial_prefix: 'dim' #Don't change it. esphome: name: '${name}' @@ -20,10 +21,10 @@ external_components: packages: internals_packages: url: https://github.com/boneIO-eu/esphome - ref: v1.0.15 + ref: v1.0.16 files: [ - 'devices/dimmer_serial_no.yaml', + 'devices/serial_no.yaml', 'devices/dimmer_i2c.yaml', 'devices/dimmer_ina219.yaml', ] diff --git a/boneio-dimmer_8ch-v0_3.yaml b/boneio-dimmer_8ch-v0_3.yaml index 621b2b6..a8ba4ec 100644 --- a/boneio-dimmer_8ch-v0_3.yaml +++ b/boneio-dimmer_8ch-v0_3.yaml @@ -1,6 +1,7 @@ substitutions: name: boneio-dr-8ch-03 friendly_name: 'BoneIO Dimmer LED' + serial_prefix: 'dim' #Don't change it. esphome: name: '${name}' @@ -20,10 +21,10 @@ external_components: packages: internals_packages: url: https://github.com/boneIO-eu/esphome - ref: v1.0.15 + ref: v1.0.16 files: [ - 'devices/dimmer_serial_no.yaml', + 'devices/serial_no.yaml', 'devices/dimmer_i2c.yaml', 'devices/dimmer_ina219.yaml', ] diff --git a/devices/dimmer_serial_no.yaml b/devices/serial_no.yaml similarity index 64% rename from devices/dimmer_serial_no.yaml rename to devices/serial_no.yaml index 1c771ba..eab5887 100644 --- a/devices/dimmer_serial_no.yaml +++ b/devices/serial_no.yaml @@ -3,7 +3,7 @@ text_sensor: name: 'Serial No.' lambda: |- std::string mac = get_mac_address(); - return "dim" + mac.erase(0, mac.length()/2); + return to_string("${serial_prefix}") + mac.erase(0, mac.length()/2); icon: mdi:expansion-card-variant entity_category: diagnostic - update_interval: 10min + update_interval: 60min