New spacestate switch for Bitlair

This commit is contained in:
polyfloyd 2024-08-11 16:20:21 +02:00
parent 69e7291aff
commit 4e30855007
2 changed files with 47 additions and 25 deletions

44
spacestate-bitlair.yaml Normal file
View file

@ -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

View file

@ -1,5 +1,5 @@
esphome: esphome:
name: spacestate-switch name: spacestate-djo
esp32: esp32:
board: esp32thing board: esp32thing
@ -24,31 +24,16 @@ text_sensor:
- platform: version - platform: version
name: "ESPHome Version" name: "ESPHome Version"
hide_timestamp: true hide_timestamp: true
state_topic: bitlair/esphome/spacestate-switch/version state_topic: bitlair/esphome/spacestate-djo/version
sensor: sensor:
- platform: wifi_signal - platform: wifi_signal
name: "WiFi Signal dB" name: "WiFi Signal dB"
update_interval: 10s update_interval: 10s
state_topic: bitlair/esphome/spacestate-switch/wifi_signal state_topic: bitlair/esphome/spacestate-djo/wifi_signal
retain: false retain: false
binary_sensor: 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 - platform: gpio
name: "DJO State" name: "DJO State"
id: switch_djo id: switch_djo
@ -65,18 +50,11 @@ binary_sensor:
- light.turn_off: led_djo - light.turn_off: led_djo
output: output:
- platform: gpio
pin: 19
id: o_led_bitlair
- platform: gpio - platform: gpio
pin: 18 pin: 18
id: o_led_djo id: o_led_djo
light: light:
- platform: binary
id: led_bitlair
name: "Bitlair Led"
output: o_led_bitlair
- platform: binary - platform: binary
id: led_djo id: led_djo
name: "DJO Led" name: "DJO Led"