summaryrefslogtreecommitdiffstats
path: root/matrix.yaml
blob: 93db9a6cd2c3cef3007a9ead88ed5e14baf99a54 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# M5 Atom Matrix Configuration for m5atom01 which is an M5Stack Atom Matrix
#    ESP32 Pico, 8x8 RGB LED Matrix (WS2812C), Infra-red LED,
#    MPU6886 Inertial Sensor - 6-axis attitude sensor with 3-axis gravity accelerometer and 3-axis gyroscope
# NB: This configuration does not use Home Assistant (HA). It uses TotallyInformation's standard MQTT Schema for ESP devices.

# Pins/GPIO
  #
  # === M5Stack Atom Matrix Specific ===
  # @see https://github.com/m5stack/M5Stack/blob/31be29f3f743768778accb8d5f308583ba4d3d4c/src/utility/Config.h
  # @see https://docs.m5stack.com/#/en/core/atom_matrix
  # ------ Buttons ------
  # BUTTON_PIN      | 39 | Under LED's and on side - both are the same button
  # ------ RGB LEDs PIN ------
  # RGB_PIN         | 27 | 8x8 matrix, WS2812C
  # ------ Infra-Red LED PIN ------
  # INFRA_PIN       | 12 |
  # -------- I2C ---------
  # SDA             | 25 |
  # SCL             | 21 |
  #
  # MPU6886 Inertial Sensor - I2C Address 0x68
  #
  # ---- Exposed Ports ----
  # -- | 3V3 | 5-pin connector pin 1
  # 19 | Tx  | 5-pin connector pin 3
  # 22 | Rx  | 5-pin connector pin 2
  # 23 | Neo | 5-pin connector pin 4 (Connected to 34 via 100ohm resistor?)
  # 33 | Adc | 5-pin connector pin 5
  #
  # 21 | SCL | 4-pin connector pin 1
  # 25 | SDA | 4-pin connector pin 2
  # -- | 5V  | 4-pin connector pin 3
  # -- | Gnd | 4-pin connector pin 4
  #
  # -- | Gnd | Grove connector pin 1
  # -- | 5V  | Grove connector pin 2
  # 26 |     | Grove connector pin 3
  # 32 |     | Grove connector pin 4
  #
  # WARNING: When using FastLED lib, the recommended maximum brightness of RGB LED is 20
#

substitutions: # All have to be strings, the substitution process will convert them to the correct types
  name: m5matrix
  friendly_name: M5 Matrix
  static_ip: 10.18.44.206


packages: # These allow merging whereas global includes do not
  board: !include boards/m5stack-atom.yaml
  base: !include common/base.yaml


# Define I2C interface
i2c:
  sda: 25
  scl: 21
  scan: true
  #frequency: 200kHz

# output:
#   - platform: ledc # 5x5 RGB Matrix (WS2812C)
#     pin: 27
#     id: matrix

binary_sensor:
  - platform: gpio # btn
    id: button
    pin:
      number: 39
      inverted: true
    on_click:
      then:
        - if:
            condition:
              - light.is_on: matrix_light
            then:
              - light.turn_off: matrix_light
            else:
              - light.turn_on:
                  id: matrix_light
                  effect: rainbow
# --- End of binary_sensor: --- #

light:
  - platform: fastled_clockless # 5x5 RGB Matrix (WS2812C)
    name: "5x5 Matrix"
    id: matrix_light
    pin: 27
    chipset: WS2812
    num_leds: 25
    color_correct: [50%, 50%, 50%] # The LED's on the Atom Matrix should not be run at full power
    effects:
      - pulse:
      - strobe:
      - addressable_rainbow:
          name: rainbow
      - random:
          name: random
      - addressable_random_twinkle:
          name: twinkle
      - addressable_fireworks:
          name: fireworks
# --- End of light: --- #

# EOF