Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- esphome:
- name: esphome-web-0dec48
- friendly_name: M5 Matrix
- esp32:
- board: m5stack-atom
- framework:
- type: arduino
- # Enable logging
- logger:
- level: DEBUG
- # Enable Home Assistant API
- api:
- encryption:
- key: ""
- services:
- - service: m5_matrix_change_page
- variables:
- page: int
- then:
- - display.page.show: !lambda |-
- if (page == 1) {
- return id(page1);
- } else {
- if (page == 2) {
- return id(page2);
- } else {
- return id(page1);
- } }
- ota:
- wifi:
- ssid: !secret wifi_ssid
- password: !secret wifi_password
- # Enable fallback hotspot (captive portal) in case wifi connection fails
- ap:
- ssid: "Esphome-Web-0Dec48"
- password: ""
- captive_portal:
- sensor:
- - platform: wifi_signal
- id: wifi_value
- name: "WiFi Signal Sensor"
- #binary_sensor:
- # - platform: gpio # btn
- # name: "Timer Button"
- # id: button1
- # pin:
- # number: 39
- # inverted: true
- switch:
- - platform: gpio
- id: "myled"
- pin: 27
- light:
- - platform: fastled_clockless
- chipset: WS2812B
- pin: 27
- num_leds: 25
- rgb_order: GRB
- id: status_led
- color_correct: [50%, 50%, 50%]
- name: 'M5 Light'
- effects:
- - random:
- - flicker:
- - addressable_rainbow:
- - pulse
- - 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
- binary_sensor:
- - platform: gpio
- pin:
- number: 39
- inverted: true
- name: 'M5 Button'
- on_press:
- then:
- # - light.toggle: status_led
- - display.page.show_next: led_matrix_display
- display:
- - platform: addressable_light
- id: led_matrix_display
- addressable_light_id: status_led
- width: 5
- height: 5
- rotation: 180°
- update_interval: 16ms
- pages:
- - id: page1
- lambda: |-
- Color red = Color(0xFF0000);
- Color green = Color(0x00FF00);
- it.fill(green);
- - id: page2
- lambda: |-
- Color red = Color(0xFF0000);
- Color green = Color(0x00FF00);
- it.rectangle(0, 0, 0, 0, green);
- - id: page3
- lambda: |-
- Color green = Color(0x00FF00);
- it.rectangle(0, 0, 0, 0, green);
- - id: page4
- lambda: |-
- Color green = Color(0x00FF00);
- it.rectangle(5,5, 0, 0, green);
- select:
- - platform: template
- name: "Template select"
- optimistic: true
- options:
- - one
- - two
- - three
- initial_option: two
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement