updated atom

This commit is contained in:
2022-12-31 09:31:55 +01:00
parent 1efb4dbd2d
commit 5128fa7358
257 changed files with 18800 additions and 12769 deletions

View File

@@ -25,7 +25,7 @@ external_components:
# Enable Home Assistant API
api:
encryption:
key: !secrets eink_display_api
key: !secret eink_display_api
ota:
password: !secret ota_password

View File

@@ -0,0 +1,72 @@
substitutions:
esp_name: "esp32-atom-lite"
esphome:
name: ${esp_name}
comment: ${esp_name}
esp32:
board: m5stack-atom
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: !secret esp32-atomo-lite_api
ota:
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: ${esp_name} fallback
password: !secret fallback_password
captive_portal:
binary_sensor:
- platform: gpio
pin:
number: GPIO39
inverted: true
name: ${esp_name}_Button
id: button
on_click:
then:
- if:
condition:
- light.is_on: RGB_Light
then:
- light.turn_off: RGB_Light
else:
- light.turn_on: RGB_Light
light:
- platform: fastled_clockless
chipset: ws2812b
pin: GPIO25
num_leds: 1
rgb_order: GRB
id: RGB_Light
name: "${esp_name}_RGB_Light"
effects:
- random:
name: "Random"
transition_length: 20s
update_interval: 5s
- addressable_rainbow:
name: Rainbow Effect
speed: 100
width: 50

View File

@@ -0,0 +1,120 @@
substitutions:
esp_name: "esp32-atom-matrix"
esphome:
name: ${esp_name}
comment: ${esp_name}
esp32:
board: m5stack-atom
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: !secret esp32-atom-matrix_api
ota:
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: ${esp_name} fallback
password: !secret fallback_password
captive_portal:
globals:
- id: display_index
type: int
restore_value: no
initial_value: '7'
- id: display_index_def
type: int
restore_value: no
initial_value: '17'
# Define I2C interface
i2c:
sda: 25
scl: 21
scan: true
#frequency: 200kHz
font:
- file: "fonts/5x5.ttf"
id: matrix_font
size: 10
binary_sensor:
- platform: gpio # btn
id: button
pin:
number: 39
inverted: true
# --- End if binary_sensor: --- #
light:
- platform: fastled_clockless
chipset: WS2812B
pin: GPIO27
num_leds: 25
rgb_order: GRB
name: "led_matrix"
id: led_matrix_light
default_transition_length: 0s
color_correct: [50%, 50%, 50%]
restore_mode: ALWAYS_ON
display:
- platform: addressable_light
id: led_matrix_display
addressable_light_id: led_matrix_light
width: 5
height: 5
rotation: 90°
update_interval: 200ms
lambda: |-
// Draw a bulls-eye pattern
Color red = Color(0xFF0000);
Color green = Color(0x00FF00);
Color blue = Color(0x0000FF);
it.printf(id(display_index), -4, id(matrix_font), blue, TextAlign::TOP_LEFT, "Tim");
if(id(display_index) <= id(display_index_def)*-1)
{
id(display_index) = 7;
}
else
{
id(display_index) -= 1;
}
# --- End of light: --- #
# sensor:
# - platform: mpu6886
# address: 0x68
# update_interval: 1s # Defaults to 60s, but seems to work fine up to at least 300ms
# accel_x:
# name: "MPU6886 Accel X"
# accel_y:
# name: "MPU6886 Accel Y"
# accel_z:
# name: "MPU6886 Accel z"
# gyro_x:
# name: "MPU6886 Gyro X"
# gyro_y:
# name: "MPU6886 Gyro Y"
# gyro_z:
# name: "MPU6886 Gyro z"
# temperature:
# name: "MPU6886 Temperature"

View File

@@ -1,21 +1,23 @@
substitutions:
esp_name: "esp8266-p1-meter"
esphome:
name: esp8266-p1-meter
name: ${esp_name}
comment: ${esp_name}
esp8266:
board: esp01_1m
# Enable logging
logger:
baud_rate: 0
level: DEBUG
# Enable Home Assistant API
api:
encryption:
key: "rl7h1lxgaeutnmINJ2mJ3WOWtzUX1AfebHnidDJJdXA="
key: !secret esp_P1_api
ota:
password: "122afb0ac402638f10972a8d97256f6f"
password: !secret esp_P1_ota
wifi:
ssid: !secret wifi_ssid
@@ -23,47 +25,116 @@ wifi:
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esp8266-P1-Meter"
password: "pKpA1k7rR6K9"
ssid: ${esp_name} fallback
password: !secret fallback_password
captive_portal:
font:
# gfonts://family[@weight]
- file: "gfonts://Roboto"
id: roboto
size: 20
- file: 'fonts/GothamRnd-Book.ttf'
id: font5
size: 18
- file: 'fonts/GothamRnd-Bold.ttf'
id: font_time
size: 30
glyphs: [' ', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':']
uart:
rx_pin: GPIO13
baud_rate: 115200
rx_buffer_size: 1700
# uart:
# rx_pin: GPIO13
# baud_rate: 115200
# rx_buffer_size: 1700
status_led:
pin: GPIO2
pin:
number: GPIO2
inverted: true
dsmr:
# dsmr:
sensor:
- platform: dsmr
energy_delivered_tariff1:
name: Energy Consumed Tariff 1
# sensor:
# - platform: dsmr
# energy_delivered_tariff1:
# name: Energy Consumed Tariff 1
text_sensor:
- platform: dsmr
identification:
name: "DSMR Identification"
p1_version:
name: "DSMR Version"
# Example configuration entry
i2c:
sda: 4
scl: 5
# text_sensor:
# - platform: dsmr
# identification:
# name: "DSMR Identification"
# p1_version:
# name: "DSMR Version"
output:
- platform: gpio
pin: GPIO4
id: lcdbacklight
switch:
- platform: output
name: "LCD LED"
output: lcdbacklight
id: switch_lcdbacklight
spi:
clk_pin: GPIO14
mosi_pin: GPIO13
time:
- platform: homeassistant
id: esptime
display:
- platform: ssd1306_i2c
model: "SSD1306 128x64"
address: 0x3C
- platform: st7735
model: INITR_MINI160X80
reset_pin: GPIO16
cs_pin: GPIO5
dc_pin: GPIO15
rotation: 270
device_width: 82
device_height: 161
col_start: 0
row_start: 0
eight_bit_color: true
update_interval: 5s
lambda: |-
it.print(0, 0, id(roboto), "Hello World!");
//it.rectangle(0, 2, 160, 80, id(my_red));
it.strftime(2, 2, id(font_time), TextAlign::BASELINE_RIGHT, "%H:%M", id(esptime).now());
// this line = the text is centered 80 pixels in from left and 59 pixels down
color:
- id: my_red
red: 100%
green: 100%
blue: 0%
- id: my_yellow
red: 100%
green: 0%
blue: 0%
- id: my_green
red: 100%
green: 0%
blue: 100%
- id: my_blue
red: 0%
green: 100%
blue: 100%
- id: my_cyan
red: 0%
green: 0%
blue: 100%
- id: my_magenta
red: 0%
green: 100%
blue: 0%
- id: my_white
red: 0%
green: 0%
blue: 0%
- id: my_gray
red: 50%
green: 50%
blue: 50%
- id: my_black
red: 100%
green: 100%
blue: 100%

BIN
esphome/fonts/5x5.ttf Executable file

Binary file not shown.