From 4b49539b3cd7e2f712e8acde02d068bea04930ea Mon Sep 17 00:00:00 2001 From: Daniele Verducci Date: Sat, 7 Feb 2026 13:16:23 +0100 Subject: [PATCH] WIP disable wi-fi to avoid interferences --- esphome/fabula.yaml | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/esphome/fabula.yaml b/esphome/fabula.yaml index bed6a29..5f23ce0 100644 --- a/esphome/fabula.yaml +++ b/esphome/fabula.yaml @@ -1,5 +1,14 @@ # NOTE: This program does NOT log via UART, but only via network socket (esphome logs...) +# Variables +globals: + # The ESP8266 Wi-fi interferes with the NFC reader, for this reason is usually + # disabled. When the devices is turned on with the "volume up" key pressed, it + # enables the wifi. Used for firmware update, home assistant control and as a night light. + - id: wifi_mode + type: bool + restore_value: no + initial_value: False # ---------------------- Global config ---------------------- @@ -8,13 +17,20 @@ esphome: on_boot: - priority: 300 then: + - if: + condition: + binary_sensor.is_on: vol_up + then: !lambda id(wifi_mode) = true; + #else: + # then: + # wifi.disable: - dfplayer.set_volume: 10 - light.turn_on: - id: status_led - brightness: 60% - red: 80% - green: 0% - blue: 100% + id: status_led + brightness: !lambda if (id(wifi_mode)) return 1.0; else return 0.6; + red: 0.8 + green: !lambda if (id(wifi_mode)) return 1.0; else return 0.0; + blue: 1.0 esp8266: board: d1_mini_lite @@ -30,6 +46,7 @@ ota: wifi: ssid: "Pew" password: "SediaChinita@Terrazzo2017" + reboot_timeout: 0s # ---------------------- Global variables ---------------------- @@ -247,6 +264,7 @@ api: # "folder": 2, # "file": 1 # } + reboot_timeout: 0s actions: - action: dfplayer_next