-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathesphome-web-204d55.yaml
85 lines (67 loc) · 2.72 KB
/
esphome-web-204d55.yaml
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
esphome:
name: esphome-web-204d55
friendly_name: ESPHome Web 204d55
platform: ESP8266
board: d1_mini
# Enable logging
logger:
# Enable Home Assistant API
api:
password: !secret api_password
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: "Esphome-Web-204D55"
password: "muBRYKrUf3qv"
captive_portal:
i2c:
sda: D2
scl: D1
scan: true
time:
- platform: homeassistant
id: homeassistant_time
external_eeprom:
id: ext_eeprom_component_1
address: 0x57
ee_memory_type: 24XX32
i2c_buffer_size: 128
switch:
- platform: template
name: "Test EEPROM Switch"
id: "test_ee_switch"
turn_on_action:
- lambda: |-
uint8_t myValue1 = 42;
ext_eeprom_component_1->write8(35, myValue1);
uint8_t myRdValue1;
myRdValue1 = ext_eeprom_component_1->read8(35);
ESP_LOGD("Eeprom", "I read: %d",myRdValue1 );
int32_t myValue2 = -480;
ext_eeprom_component_1->write_object(10, myValue2); //(location, data)
int32_t myRead2;
ext_eeprom_component_1->read_object(10, myRead2); //location to read, thing to put data into
ESP_LOGD("Eeprom", "I read: %d",myRead2 );
float myValue3 = -78.35;
ext_eeprom_component_1->write_object(20, myValue3); //(location, data)
float myRead3;
ext_eeprom_component_1->read_object(20, myRead3); //location to read, thing to put data into
ESP_LOGD("Eeprom","I read: %f",myRead3);
std::string myString = "This is a test of a very long string This is a test of a very long string This is a test of a very long string This is a test of a very long string This is a test of a very long string This is a test of a very long string ";
ext_eeprom_component_1->write_string_to_eeprom(40, myString); //(location, data)
std::string myRead4;
ext_eeprom_component_1->read_string_from_eeprom(40, myRead4); //location to read, thing to put data into
ESP_LOGD("Eeprom","I read: %s",myRead4.c_str());
ext_eeprom_component_1->write8(0, 0);
ext_eeprom_component_1->write8(1, 1);
ext_eeprom_component_1->write8(2, 2);
ext_eeprom_component_1->write8(3, 3);
ext_eeprom_component_1->write8(4, 4);
ext_eeprom_component_1->write8(5, 5);
ext_eeprom_component_1->write8(6, 6);
ext_eeprom_component_1->write8(7, 7);
ext_eeprom_component_1->dump_eeprom(0,8);