From 409878ab4e3f1ed479b164aed417006f9b658885 Mon Sep 17 00:00:00 2001 From: void Date: Wed, 2 Apr 2025 04:17:06 +0000 Subject: [PATCH] Update watchwip added neopixel effects --- watchwip | 110 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 68 insertions(+), 42 deletions(-) diff --git a/watchwip b/watchwip index 258b4bc..12f1eb5 100644 --- a/watchwip +++ b/watchwip @@ -26,33 +26,79 @@ wifi: password: "wifipassword" font: - - file: "gfonts://Bytesized" + - file: "gfonts://Roboto" id: font1 - size: 16 + size: 12 + light: + # WS2812B LED strip configuration - platform: neopixelbus name: "WS2812B LED" id: ws2812b - pin: GPIO15 + pin: GPIO15 # Keeping WS2812B on GPIO15 num_leds: 1 # Adjust the number of LEDs as per your setup type: GRB # Set the color order if needed (e.g., GRB for WS2812B) variant: WS2812 # Specify the variant (WS2812 for WS2812B) - + effects: + - pulse: + - pulse: + name: "Fast Pulse" + transition_length: 0.5s + update_interval: 0.5s + min_brightness: 0% + max_brightness: 100% + - pulse: + name: "Slow Pulse" + transition_length: 500ms + update_interval: 2s + - pulse: + name: "Asymmetrical Pulse" + transition_length: + on_length: 1s + off_length: 500ms + update_interval: 1.5s + - random: + name: Random Effect With Custom Values + transition_length: 5s + update_interval: 7s + - strobe: + name: Strobe Effect With Custom Values + colors: + - state: true + brightness: 100% + red: 100% + green: 90% + blue: 0% + duration: 500ms + - state: false + duration: 250ms + - state: true + brightness: 100% + red: 0% + green: 100% + blue: 0% + duration: 500ms + - flicker: + name: Flicker Effect With Custom Values + alpha: 95% + intensity: 3.3% + i2c: sda: GPIO5 # D1 scl: GPIO4 # D2 scan: true -# Text sensors for weather and location information -text_sensor: - # Location name from Home Assistant +# Define a sensor to grab the temperature from Home Assistant weather entity +sensor: - platform: homeassistant - id: weather_location - entity_id: sensor.weather # The entity_id for your weather location - attribute: friendly_name # Use the friendly name attribute + id: temperature + entity_id: weather.home + attribute: temperature internal: true +# Text sensors for weather and location information +text_sensor: # Current weather condition from Home Assistant - platform: homeassistant id: weather_condition @@ -67,41 +113,15 @@ display: update_interval: 1s address: 0x3C # Default I2C address for SH1106 lambda: |- - // Display weather location - it.print(0, 0, id(font1), "Location: "); - it.print(0, 16, id(font1), id(weather_location).state.c_str()); - // Display current weather condition - it.print(0, 32, id(font1), "Condition: "); - it.print(0, 48, id(font1), id(weather_condition).state.c_str()); + it.print(0, 10, id(font1), id(weather_condition).state.c_str()); + + // Display current temperature under the weather condition + String temp_str = "Temp: " + String(id(temperature).state) + " °F"; // Create the temperature string + it.print(0, 20, id(font1), temp_str.c_str()); // Convert the String to a const char* and display it -# Define pull-up buttons for GPIOs (as before) +# Define pull-up buttons for GPIOs binary_sensor: - - platform: gpio - pin: - number: GPIO1 - mode: INPUT_PULLUP - name: "Button GPIO1" - - platform: gpio - pin: - number: GPIO2 - mode: INPUT_PULLUP - name: "Button GPIO2" - - platform: gpio - pin: - number: GPIO3 - mode: INPUT_PULLUP - name: "Button GPIO3" - - platform: gpio - pin: - number: GPIO9 - mode: INPUT_PULLUP - name: "Button GPIO9" - - platform: gpio - pin: - number: GPIO10 - mode: INPUT_PULLUP - name: "Button GPIO10" - platform: gpio pin: number: GPIO12 @@ -117,3 +137,9 @@ binary_sensor: number: GPIO14 mode: INPUT_PULLUP name: "Button GPIO14" + - platform: gpio + pin: + number: GPIO0 # Boot button on most ESP32 boards + mode: INPUT_PULLUP + inverted: true # Inverted because it's typically pulled low when pressed + name: "Boot Button" \ No newline at end of file