Patryk M. Gutowski 2 жил өмнө
parent
commit
be8b0a6a10

+ 9 - 5
bath_basic.yaml

@@ -1,7 +1,15 @@
 ---
+substitutions:
+  devicename: ff-bath-fan 
+  low_devicename: ff_bath_fan
+  friendly_devicename: FF Bath Fan Controller
+
+packages:
+  diag: !include common/diag.yaml
+
 # Basic Config
 esphome:
-  name: ff-bath-fan
+  name: $devicename
   platform: ESP8266
   board: esp8285
 
@@ -13,10 +21,6 @@ wifi:
   password: !secret wifi_password
   domain: .int.mmax.cloud
 
-button:
-  - platform: restart
-    name: "FF-Bath-Fan Restart"
-
 logger:
 api:
   encryption:

+ 20 - 0
common/diag.yaml

@@ -0,0 +1,20 @@
+---
+button:
+  - platform: restart
+    name: "${friendly_devicename} Restart"
+  - platform: safe_mode
+    name: "${friendly_devicename} Safe Mode Boot"
+    entity_category: diagnostic
+
+sensor:
+  - platform: wifi_signal
+    name: "${friendly_devicename} WiFi Signal"
+    id: ${low_devicename}_wifi_signal
+
+binary_sensor:
+  - platform: status
+    name: "${friendly_devicename} status"
+
+text_sensor:
+  - platform: version
+    name: ${friendly_devicename} Version

+ 3 - 21
ff-bath-bt-proxy-02.yaml

@@ -3,6 +3,9 @@ substitutions:
   low_devicename: ff_bath_bt_proxy_02
   friendly_devicename: FF Bath Bluetooth Proxy
 
+packages:
+  diag: !include common/diag.yaml
+
 esphome:
   name: $devicename
   friendly_name: $friendly_devicename
@@ -31,9 +34,6 @@ wifi:
   password: !secret iot_password
   domain: .int.mmax.cloud
   
-improv_serial:
-  
-
 esp32_ble_tracker:
   scan_parameters:
     # We currently use the defaults to ensure Bluetooth
@@ -43,21 +43,3 @@ esp32_ble_tracker:
 
 bluetooth_proxy:
   active: true
-
-button:
-- platform: safe_mode
-  name: "${friendly_devicename} Safe Mode Boot"
-  entity_category: diagnostic
-
-sensor:
-- platform: wifi_signal
-  name: "${friendly_devicename} WiFi Signal"
-  id: ${low_devicename}_wifi_signal
-
-binary_sensor:
-  - platform: status
-    name: "${friendly_devicename} status"
-
-text_sensor:
-  - platform: version
-    name: ${friendly_devicename} Version

+ 58 - 48
gf-bt-proxy-01.yaml

@@ -7,6 +7,9 @@ esphome:
   name: $devicename
   friendly_name: $friendly_devicename
 
+packages:
+  diag: !include common/diag.yaml
+
 esp32:
   board: esp32dev
   framework:
@@ -15,6 +18,9 @@ esp32:
 # Enable logging
 logger:
 
+web_server:
+  port: 80
+  
 # Enable Home Assistant API
 api:
   encryption:
@@ -31,63 +37,67 @@ wifi:
   # Enable fallback hotspot (captive portal) in case wifi connection fails
   ap:
     ssid: "Gf-Bt-Proxy-01 Fallback Hotspot"
-    password: "Ry3eaIb2vmf1"
-
-improv_serial:
-  
+    password: "Ry3eaIb2vmf1"  
 
 esp32_ble_tracker:
   scan_parameters:
+    active: True
     # We currently use the defaults to ensure Bluetooth
     # can co-exist with WiFi In the future we may be able to
     # enable the built-in coexistence logic in ESP-IDF
-    active: true
+    # active: true
 
-# bluetooth_proxy:
-#  active: true
+bluetooth_proxy:
+  active: true
 
 external_components:
   - source: github://myhomeiot/esphome-components
 
-ble_gateway:
-  id: blegateway
-  on_ble_advertise:
-    then:
-      homeassistant.event:
-        event: esphome.on_ble_advertise
-        data:
-          packet: !lambda return packet;
-#          gateway_id: ${device_id}
-binary_sensor:
-  - platform: homeassistant
-    id: ble_gateway_discovery
-    entity_id: binary_sensor.ble_gateway
-    attribute: discovery
-    on_state:
-      then:
-        lambda: id(blegateway).set_discovery(x);
-
-text_sensor:
-  - platform: homeassistant
-    id: ble_gateway_devices
-    entity_id: binary_sensor.ble_gateway
-    attribute: devices
-    on_value:
-      then:
-        lambda: id(blegateway).set_devices(x);
-
-switch:
-  - platform: template
-    id: switch_ble_gateway_discovery
-    name: BLE Gateway Discovery
-    icon: mdi:bluetooth-connect
-    lambda: return id(blegateway).get_discovery();
-    turn_on_action: [lambda: id(blegateway).set_discovery(true);]
-    turn_off_action: [lambda: id(blegateway).set_discovery(false);]
-    disabled_by_default: true
-    entity_category: config
+#ble_monitor:
+#  discovery: true
+#  restore_state: true
+#  decimals: 1
+#  period: 300
 
-button:
-- platform: safe_mode
-  name: Safe Mode Boot
-  entity_category: diagnostic
+    # ble_gateway:
+    #   id: blegateway
+    #   on_ble_advertise:
+    #     then:
+    #       homeassistant.event:
+    #         event: esphome.on_ble_advertise
+    #         data:
+    #           packet: !lambda return packet;
+    # 
+    # binary_sensor:
+    #   - platform: homeassistant
+    #     id: ble_gateway_discovery
+    #     entity_id: binary_sensor.ble_gateway
+    #     attribute: discovery
+    #     on_state:
+    #       then:
+    #         lambda: id(blegateway).set_discovery(x);
+    # 
+    # text_sensor:
+    #   - platform: homeassistant
+    #     id: ble_gateway_devices
+    #     entity_id: binary_sensor.ble_gateway
+    #     attribute: devices
+    #     on_value:
+    #       then:
+    #         lambda: id(blegateway).set_devices(x);
+    # 
+    # switch:
+    #   - platform: template
+    #     id: switch_ble_gateway_discovery
+    #     name: BLE Gateway Discovery
+    #     icon: mdi:bluetooth-connect
+    #     lambda: return id(blegateway).get_discovery();
+    #     turn_on_action: [lambda: id(blegateway).set_discovery(true);]
+    #     turn_off_action: [lambda: id(blegateway).set_discovery(false);]
+    #     disabled_by_default: true
+    #     entity_category: config
+    # 
+    # button:
+    # - platform: safe_mode
+    #   name: Safe Mode Boot
+    #   entity_category: diagnostic