From 4e3085500713ba18828731ec271f981ccb15f02f Mon Sep 17 00:00:00 2001 From: polyfloyd Date: Sun, 11 Aug 2024 16:20:21 +0200 Subject: [PATCH] New spacestate switch for Bitlair --- spacestate-bitlair.yaml | 44 +++++++++++++++++++ spacestate-switch.yaml => spacestate-djo.yaml | 28 ++---------- 2 files changed, 47 insertions(+), 25 deletions(-) create mode 100644 spacestate-bitlair.yaml rename spacestate-switch.yaml => spacestate-djo.yaml (59%) diff --git a/spacestate-bitlair.yaml b/spacestate-bitlair.yaml new file mode 100644 index 0000000..3f445b5 --- /dev/null +++ b/spacestate-bitlair.yaml @@ -0,0 +1,44 @@ +esphome: + name: spacestate-bitlair + +esp32: + board: esp32thing + framework: + type: arduino + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + +ota: + platform: esphome + password: !secret ota_password + +logger: + +mqtt: + broker: !secret mqtt_server + discovery: false + +text_sensor: + - platform: version + name: "ESPHome Version" + hide_timestamp: true + state_topic: bitlair/esphome/spacestate-bitlair/version + +sensor: + - platform: wifi_signal + name: "WiFi Signal dB" + update_interval: 10s + state_topic: bitlair/esphome/spacestate-bitlair/wifi_signal + retain: false + +binary_sensor: + - platform: gpio + name: "Bitlair State" + id: switch_bitlair + state_topic: bitlair/switch/state/bitlair + pin: + number: 5 + mode: INPUT_PULLUP + inverted: true diff --git a/spacestate-switch.yaml b/spacestate-djo.yaml similarity index 59% rename from spacestate-switch.yaml rename to spacestate-djo.yaml index 81d075b..bd91547 100644 --- a/spacestate-switch.yaml +++ b/spacestate-djo.yaml @@ -1,5 +1,5 @@ esphome: - name: spacestate-switch + name: spacestate-djo esp32: board: esp32thing @@ -24,31 +24,16 @@ text_sensor: - platform: version name: "ESPHome Version" hide_timestamp: true - state_topic: bitlair/esphome/spacestate-switch/version + state_topic: bitlair/esphome/spacestate-djo/version sensor: - platform: wifi_signal name: "WiFi Signal dB" update_interval: 10s - state_topic: bitlair/esphome/spacestate-switch/wifi_signal + state_topic: bitlair/esphome/spacestate-djo/wifi_signal retain: false binary_sensor: - - platform: gpio - name: "Bitlair State" - id: switch_bitlair - state_topic: bitlair/switch/state/bitlair - pin: - number: 5 - mode: INPUT_PULLUP - inverted: true - on_press: - then: - - light.turn_on: led_bitlair - on_release: - then: - - light.turn_off: led_bitlair - - platform: gpio name: "DJO State" id: switch_djo @@ -65,18 +50,11 @@ binary_sensor: - light.turn_off: led_djo output: - - platform: gpio - pin: 19 - id: o_led_bitlair - platform: gpio pin: 18 id: o_led_djo light: - - platform: binary - id: led_bitlair - name: "Bitlair Led" - output: o_led_bitlair - platform: binary id: led_djo name: "DJO Led"