License

LGPL

Tags
Recommend Projects

SMD Home automation wall switch based on ESP8266 (WEMOS D1) with status LEDs (WS2812) for EFAPEL Logus90

5 months ago 80
  • Description
  • Documents
  • BOM
  • Attachments
  • Members
  • Comments

Description

This is electronics for EFAPEL Logus 90 style switch. Design is based on esp8266 D1 mini with RGB LEDs.

ESP home configuration (for Home Assistant):

esphome:
  name: vypinac
  platform: ESP8266
  board: d1_mini

wifi:
  ssid: "xx"
  password: "xxxxxxxx"

web_server:
  port: 80

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

time:
  - platform: homeassistant
    id: homeassistant_time

globals:
  - id: LED1_R
    type: float
    restore_value: no
  - id: LED1_G
    type: float
    restore_value: no
  - id: LED1_B
    type: float
    restore_value: no
  - id: LED1_BR
    type: float
    restore_value: no
  - id: LED1_S
    type: boolean
    restore_value: no
  - id: LED2_R
    type: float
    restore_value: no
  - id: LED2_G
    type: float
    restore_value: no
  - id: LED2_B
    type: float
    restore_value: no
  - id: LED2_BR
    type: float
    restore_value: no
  - id: LED2_S
    type: boolean
    restore_value: no
  - id: LED3_R
    type: float
    restore_value: no
  - id: LED3_G
    type: float
    restore_value: no
  - id: LED3_B
    type: float
    restore_value: no
  - id: LED3_BR
    type: float
    restore_value: no
  - id: LED3_S
    type: boolean
    restore_value: no
  - id: LED4_R
    type: float
    restore_value: no
  - id: LED4_G
    type: float
    restore_value: no
  - id: LED4_B
    type: float
    restore_value: no
  - id: LED4_BR
    type: float
    restore_value: no
  - id: LED4_S
    type: boolean
    restore_value: no

light:
#WS2812 chain
  - platform: fastled_clockless
    id: ws_light
    pin: D4
    num_leds: 4
    rgb_order: GRB
    chipset: ws2812
#Partition chain into single addresable leds
  - platform: partition
    name: "LED1"
    id: LED1
    segments:
      - id: ws_light
        from: 0
        to: 0
  - platform: partition
    name: "LED2"
    id: LED2
    segments:
      - id: ws_light
        from: 1
        to: 1
  - platform: partition
    name: "LED3"
    id: LED3
    segments:
      - id: ws_light
        from: 2
        to: 2
  - platform: partition
    name: "LED4"
    id: LED4
    segments:
      - id: ws_light
        from: 3
        to: 3

binary_sensor:
  - platform: gpio
    name: "Tlačítko 1"
    pin: 
     number: D3
     mode: INPUT_PULLUP
     inverted: True
    on_press:
       then:
         # Save LED state
         - lambda: |-
            id(LED1_S) = id(LED1).get_remote_values().is_on();
            id(LED1_R) = id(LED1).get_remote_values().get_red();
            id(LED1_G) = id(LED1).get_remote_values().get_green();
            id(LED1_B) = id(LED1).get_remote_values().get_blue();
            id(LED1_BR) = id(LED1).get_remote_values().get_brightness();

         # Do the blink
         - light.turn_on:
            id: LED1
            transition_length: 0s
            brightness: 100%
            red: 100%
            green: 0
            blue: 0

    on_release:
       then:
         - light.turn_off:
            id: LED1
            transition_length: 250ms
         - delay: 250ms
         # Restore LED state
         - lambda: |-
            auto call = id(LED1).make_call();
            call.set_transition_length(0); // in ms
            call.set_brightness(id(LED1_BR)); // 1.0 is full brightness
            call.set_rgb(id(LED1_R), id(LED1_G), id(LED1_B)); // color, 1.0 is fully lit
            call.set_transition_length(250); // in ms
            call.set_state(id(LED1_S));
            call.perform();

  - platform: gpio
    name: "Tlačítko 2"
    pin: 
      number: D2
      mode: INPUT_PULLUP
      inverted: True
    on_press:
       then:
         # Save LED state
         - lambda: |-
            id(LED2_S) = id(LED2).get_remote_values().is_on();
            id(LED2_R) = id(LED2).get_remote_values().get_red();
            id(LED2_G) = id(LED2).get_remote_values().get_green();
            id(LED2_B) = id(LED2).get_remote_values().get_blue();
            id(LED2_BR) = id(LED2).get_remote_values().get_brightness();

         # Do the blink
         - light.turn_on:
            id: LED2
            transition_length: 0s
            brightness: 100%
            red: 100%
            green: 0
            blue: 0

    on_release:
       then:
         - light.turn_off:
            id: LED2
            transition_length: 250ms
         - delay: 250ms
         # Restore LED state
         - lambda: |-
            auto call = id(LED2).make_call();
            call.set_transition_length(250); // in ms
            call.set_brightness(id(LED2_BR)); // 1.0 is full brightness
            call.set_rgb(id(LED2_R), id(LED2_G), id(LED2_B)); // color, 1.0 is fully lit
            call.set_state(id(LED2_S));
            call.perform();

  - platform: gpio
    name: "Tlačítko 3"
    pin: 
      number: D7
      mode: INPUT_PULLUP
      inverted: True
    on_press:
       then:
         # Save LED state
         - lambda: |-
            id(LED3_S) = id(LED3).get_remote_values().is_on();
            id(LED3_R) = id(LED3).get_remote_values().get_red();
            id(LED3_G) = id(LED3).get_remote_values().get_green();
            id(LED3_B) = id(LED3).get_remote_values().get_blue();
            id(LED3_BR) = id(LED3).get_remote_values().get_brightness();

         # Do the blink
         - light.turn_on:
            id: LED3
            transition_length: 0s
            brightness: 100%
            red: 100%
            green: 0
            blue: 0

    on_release:
       then:
         - light.turn_off:
            id: LED3
            transition_length: 250ms
         - delay: 250ms
         # Restore LED state
         - lambda: |-
            auto call = id(LED3).make_call();
            call.set_transition_length(250); // in ms
            call.set_brightness(id(LED3_BR)); // 1.0 is full brightness
            call.set_rgb(id(LED3_R), id(LED3_G), id(LED3_B)); // color, 1.0 is fully lit
            call.set_state(id(LED3_S));
            call.perform();

  - platform: gpio
    name: "Tlačítko 4"
    pin: 
      number: D6
      mode: INPUT_PULLUP
      inverted: True
    on_press:
       then:
         # Save LED state
         - lambda: |-
            id(LED4_S) = id(LED4).get_remote_values().is_on();
            id(LED4_R) = id(LED4).get_remote_values().get_red();
            id(LED4_G) = id(LED4).get_remote_values().get_green();
            id(LED4_B) = id(LED4).get_remote_values().get_blue();
            id(LED4_BR) = id(LED4).get_remote_values().get_brightness();

         # Do the blink
         - light.turn_on:
            id: LED4
            transition_length: 0s
            brightness: 100%
            red: 100%
            green: 0
            blue: 0

    on_release:
       then:
         - light.turn_off:
            id: LED4
            transition_length: 250ms
         - delay: 250ms
         # Restore LED state
         - lambda: |-
            auto call = id(LED4).make_call();
            call.set_transition_length(250); // in ms
            call.set_brightness(id(LED4_BR)); // 1.0 is full brightness
            call.set_rgb(id(LED4_R), id(LED4_G), id(LED4_B)); // color, 1.0 is fully lit
            call.set_state(id(LED4_S));
            call.perform();

dallas:
  - pin: D5

sensor:
  - platform: dallas
    name: "Teplota u vypínače"
    address: 0x2C000009A6A1CC28
#   index: 0

Documents

Logus90 D1 2812 copy

Logus90 D1 2812 copy

BOM

ID Name Designator Footprint Quantity
1 4.7K R1 0603 1
2 DB2ER-5.08-2P CN1 CONN-TH_2PIN-H-PITCH5.08-L_DB2ER-5.08-2P 1
3 1.8K R3 0603 1
4 WS2812B-3535 LED1,LED2,LED3,LED4 LED-SMD_4P-L3.5-W3.5-TL_WS2812B 4
5 A2541WV-3P H5,H3 SIP-2.54MM-3P-CJT-H8.54 2
6 DS18B20+ U1 TO-92(TO-92-3) 1
7 210S-1*6P L=11.6MMGold-plated black H2 210S-1X6P 1
8 WEMOS_D1_MINI_V2.3.0 U2 WEMOS_D1_MINI_V2.3.0 1
9 SOLDERJUMPERNC2 SJ1 SJ_2S-NOTRACE 1
10 3.3K R2 0603 1
11 10uF C1 CAP-D6.3XF2.5 1
12 2N3906S-RTK/PS Q1 SOT-23-3_L2.9-W1.6-P1.90-LS2.8-TR-CW 1
13 TS-1187A-C-E-B SW1,SW2,SW3,SW4 SW-SMD_4P-L5.1-W5.1-P3.70-LS6.4 4

Attachments

None

Members

Success
The owner does not allow comments in this project now

Comments (0)

goToTop
你现在访问的是EasyEDA海外版,使用建立访问速度更快的国内版 https://lceda.cn(需要重新注册)
如果需要转移工程请在个人中心 - 工程 - 工程高级设置 - 下载工程,下载后在https://lceda.cn/editor 打开保存即可。
有问题联系QQ 3001956291 不再提醒
svg-battery svg-battery-wifi svg-books svg-more svg-paste svg-pencil svg-plant svg-ruler svg-share svg-user svg-logo-cn svg-double-arrow
We use cookies to offer you a better experience. Detailed information on the use of cookies on this website is provided in our Privacy Policy. By using this site, you consent to the use of our cookies.