funktioin fertig
This commit is contained in:
28
3d/box.scad
Normal file
28
3d/box.scad
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
// Maße
|
||||||
|
width = 100;
|
||||||
|
height = 70;
|
||||||
|
depth = 30;
|
||||||
|
wall = 2;
|
||||||
|
|
||||||
|
// Hauptgehäuse
|
||||||
|
difference() {
|
||||||
|
// Außengehäuse
|
||||||
|
cube([width, height, depth]);
|
||||||
|
|
||||||
|
// Innenaushöhlung
|
||||||
|
translate([wall, wall, wall])
|
||||||
|
cube([width - 2*wall, height - 2*wall, depth - wall]);
|
||||||
|
|
||||||
|
// Display-Ausschnitt vorne
|
||||||
|
translate([15, 20, depth - 1])
|
||||||
|
cube([70, 30, 2]);
|
||||||
|
|
||||||
|
// USB-Ausschnitt unten hinten
|
||||||
|
translate([width/2 - 5, -1, 5])
|
||||||
|
cube([10, wall + 1, 5]);
|
||||||
|
|
||||||
|
// Kippschalter oben (rundes Loch)
|
||||||
|
translate([width/2, height - wall, depth - 10])
|
||||||
|
rotate([90, 0, 0])
|
||||||
|
cylinder(h = wall + 2, r = 10, $fn=64);
|
||||||
|
}
|
@ -11,10 +11,8 @@ esp32:
|
|||||||
framework:
|
framework:
|
||||||
type: esp-idf
|
type: esp-idf
|
||||||
|
|
||||||
# Enable logging
|
|
||||||
logger:
|
logger:
|
||||||
|
|
||||||
# Enable Home Assistant API
|
|
||||||
api:
|
api:
|
||||||
encryption:
|
encryption:
|
||||||
key: "gLfRXKqMU9IvvwZnIdrWYIclAnc4q5sHVwTkRzUxKyw="
|
key: "gLfRXKqMU9IvvwZnIdrWYIclAnc4q5sHVwTkRzUxKyw="
|
||||||
@ -23,45 +21,89 @@ ota:
|
|||||||
- platform: esphome
|
- platform: esphome
|
||||||
password: "1618b7dc423684c5d3661481ce284359"
|
password: "1618b7dc423684c5d3661481ce284359"
|
||||||
|
|
||||||
font:
|
font:
|
||||||
|
|
||||||
- file: "gfonts://Roboto"
|
- file: "gfonts://Roboto"
|
||||||
id: my_font
|
id: my_font
|
||||||
size: 20
|
size: 18
|
||||||
|
|
||||||
image:
|
image:
|
||||||
- file: "cat.svg"
|
- file: "cat.svg"
|
||||||
id: cat_img
|
id: cat_img
|
||||||
resize: 64x64
|
resize: 64x64
|
||||||
type: BINARY # oder MONO für 1-Bit
|
type: BINARY
|
||||||
|
|
||||||
wifi:
|
wifi:
|
||||||
ssid: !secret wifi_ssid
|
ssid: !secret wifi_ssid
|
||||||
password: !secret wifi_password
|
password: !secret wifi_password
|
||||||
|
|
||||||
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
|
||||||
ap:
|
ap:
|
||||||
ssid: "Doorwhat Fallback Hotspot"
|
ssid: "Doorwhat Fallback Hotspot"
|
||||||
password: "KBiNyP7EkHCJ"
|
password: "KBiNyP7EkHCJ"
|
||||||
|
|
||||||
captive_portal:
|
captive_portal:
|
||||||
|
|
||||||
|
time:
|
||||||
|
- platform: homeassistant
|
||||||
|
id: ha_time
|
||||||
|
|
||||||
sensor:
|
sensor:
|
||||||
- platform: homeassistant
|
- platform: homeassistant
|
||||||
entity_id: sensor.shellyhtg3_8cbfeaa53d88_humidity
|
entity_id: sensor.shellyhtg3_8cbfeaa53d88_humidity
|
||||||
id: bad_feuchtigkeit
|
id: bad_feuchtigkeit
|
||||||
|
|
||||||
spi:
|
spi:
|
||||||
clk_pin: 2
|
clk_pin: 2
|
||||||
mosi_pin: 15
|
mosi_pin: 15
|
||||||
|
|
||||||
|
|
||||||
color:
|
color:
|
||||||
- id: red
|
- id: red
|
||||||
hex: "FF0000"
|
hex: "FF0000"
|
||||||
- id: black
|
- id: black
|
||||||
hex: "FFFFFF"
|
hex: "FFFFFF"
|
||||||
|
|
||||||
|
globals:
|
||||||
|
- id: last_on_time
|
||||||
|
type: std::string
|
||||||
|
restore_value: no
|
||||||
|
initial_value: '"Noch nie"'
|
||||||
|
- id: previous_on_time
|
||||||
|
type: std::string
|
||||||
|
restore_value: no
|
||||||
|
initial_value: '"Noch nie"'
|
||||||
|
|
||||||
|
text_sensor:
|
||||||
|
- platform: template
|
||||||
|
name: "Letzter Gong"
|
||||||
|
id: letzter_gong_sensor
|
||||||
|
- platform: template
|
||||||
|
name: "Vorheriger Gong"
|
||||||
|
id: vorheriger_gong_sensor
|
||||||
|
|
||||||
|
binary_sensor:
|
||||||
|
- platform: gpio
|
||||||
|
pin:
|
||||||
|
number: 18
|
||||||
|
mode: INPUT
|
||||||
|
id: opto_in
|
||||||
|
name: "Optokoppler Eingang"
|
||||||
|
on_press:
|
||||||
|
then:
|
||||||
|
- lambda: |-
|
||||||
|
auto time = id(ha_time).now();
|
||||||
|
std::string new_time;
|
||||||
|
if (time.is_valid()) {
|
||||||
|
new_time = time.strftime("%Y-%m-%d %H:%M:%S");
|
||||||
|
} else {
|
||||||
|
new_time = "Zeit unbekannt";
|
||||||
|
}
|
||||||
|
|
||||||
|
id(previous_on_time) = id(last_on_time);
|
||||||
|
id(last_on_time) = new_time;
|
||||||
|
|
||||||
|
id(letzter_gong_sensor).publish_state(id(last_on_time));
|
||||||
|
id(vorheriger_gong_sensor).publish_state(id(previous_on_time));
|
||||||
|
- component.update: my_display
|
||||||
|
|
||||||
display:
|
display:
|
||||||
- platform: waveshare_epaper
|
- platform: waveshare_epaper
|
||||||
model: 2.90in3c
|
model: 2.90in3c
|
||||||
@ -71,10 +113,14 @@ display:
|
|||||||
busy_pin: 5
|
busy_pin: 5
|
||||||
rotation: 270
|
rotation: 270
|
||||||
reset_duration: 2ms
|
reset_duration: 2ms
|
||||||
update_interval: 30s
|
id: my_display
|
||||||
lambda: !lambda |-
|
update_interval: 600s # alle 10 Minuten automatisch
|
||||||
it.print(0, 4, id(my_font), id(black), "DoorWhat v0.1");
|
|
||||||
it.print(80, 40, id(my_font), id(red), "Meow!");
|
|
||||||
//it.printf(0, 80, id(my_font), id(red), "Feuchtigkeit Bad %.1f", id(bad_feuchtigkeit).state);
|
|
||||||
it.image(150, 40, id(cat_img));
|
|
||||||
|
|
||||||
|
lambda: |-
|
||||||
|
it.print(0, 4, id(my_font), id(black), "DoorWhat v1.0");
|
||||||
|
it.print(170, 65, id(my_font), id(red), "Meow!");
|
||||||
|
it.image(186, 1, id(cat_img));
|
||||||
|
it.print(0, 30, id(my_font), id(black), "Letzter Gong:");
|
||||||
|
it.print(0, 50, id(my_font), id(red), id(last_on_time).c_str());
|
||||||
|
it.print(0, 70, id(my_font), id(black), "Vorheriger Gong:");
|
||||||
|
it.print(0, 90, id(my_font), id(red), id(previous_on_time).c_str());
|
||||||
|
Reference in New Issue
Block a user