Giter Club home page Giter Club logo

esphomelighteffects's Introduction

ESPHomeLightEffects

A collection of custom light effects I made for ESPHome. These are used in stair lighting, where a single addressable LED strip runs along the stairs.

Installation

Copy the relevant .h files to the ESPHome configuration folder next to your YAML file. A subfolder should also work, change the includes accordingly.

Smooth wipe

Transitions to the specified color, wiping from one end of the strip to the other with a smooth leading edge. Transition length, edge size and direction can be specified.

esphome:
  includes:
    - effect_smoothwipe.h

light:
  - platform: ... # light component of choice, eg neopixelbus or fastled_clockless
    ...other settings here

    # To turn the effect off automatically at the end of the wipe, specify an id
    # and use it in the calls to id() below. This allows you to use the effect
    # again with a new color without having to reset it.
    id: ledstrip
    effects:
      - addressable_lambda:
          name: "Wipe up"
          update_interval: 12ms
          lambda: |-
            if (initial_run)
              # Second parameter is the transition length.
              # Third parameter the size of the leading edge. The larger, the smoother the transition.
              # Fourth parameter determines if the effect is applied in reverse.
              smoothWipeInit(it, 1000, 128, false);
            
            if (smoothWipe(it, current_color))
              // Automatically turn effect off so it can be called again
              id(ledstrip).turn_on().set_effect(0).perform();

      - addressable_lambda:
          name: "Wipe down"
          update_interval: 12ms
          lambda: |-
            if (initial_run)
              smoothWipeInit(it, 1000, 128, true);
            
            if (smoothWipe(it, current_color))
              // Automatically turn effect off so it can be called again
              id(ledstrip).turn_on().set_effect(0).perform();

esphomelighteffects's People

Contributors

mvrens avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.