Merge branch 'dev' into dev

This commit is contained in:
CptSkippy 2024-06-17 10:46:03 -07:00 committed by GitHub
commit 7527f84f5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
55 changed files with 213 additions and 480 deletions

View file

@ -631,7 +631,7 @@ void EthernetComponent::write_phy_register_(esp_eth_mac_t *mac, PHYRegister regi
ESPHL_ERROR_CHECK(err, "Writing PHY Register failed");
if (this->type_ == ETHERNET_TYPE_RTL8201 && register_data.page) {
ESP_LOGD(TAG, "Select PHY Register Page 0x%02" PRIX32, 0x0);
ESP_LOGD(TAG, "Select PHY Register Page 0x00");
err = mac->write_phy_reg(mac, this->phy_addr_, eth_phy_psr_reg_addr, 0x0);
ESPHL_ERROR_CHECK(err, "Select PHY Register Page 0 failed");
}

View file

@ -60,7 +60,7 @@ void HOT IRAM_ATTR GPIOOneWireBus::write_bit_(bool bit) {
// recovery time: t_rec: min=1µs
// ds18b20 appears to read the bus after roughly 14µs
uint32_t delay0 = bit ? 6 : 60;
uint32_t delay1 = bit ? 54 : 5;
uint32_t delay1 = bit ? 59 : 5;
// delay A/C
delayMicroseconds(delay0);

View file

@ -34,8 +34,8 @@ void ILI9XXXDisplay::setup() {
ESP_LOGD(TAG, "Setting up ILI9xxx");
this->setup_pins_();
this->init_lcd_(this->init_sequence_);
this->init_lcd_(this->extra_init_sequence_.data());
this->init_lcd(this->init_sequence_);
this->init_lcd(this->extra_init_sequence_.data());
switch (this->pixel_mode_) {
case PIXEL_MODE_16:
if (this->is_18bitdisplay_) {
@ -405,7 +405,7 @@ void ILI9XXXDisplay::reset_() {
}
}
void ILI9XXXDisplay::init_lcd_(const uint8_t *addr) {
void ILI9XXXDisplay::init_lcd(const uint8_t *addr) {
if (addr == nullptr)
return;
uint8_t cmd, x, num_args;
@ -427,6 +427,20 @@ void ILI9XXXDisplay::init_lcd_(const uint8_t *addr) {
}
}
void ILI9XXXGC9A01A::init_lcd(const uint8_t *addr) {
if (addr == nullptr)
return;
uint8_t cmd, x, num_args;
while ((cmd = *addr++) != 0) {
x = *addr++;
num_args = x & 0x7F;
this->send_command(cmd, addr, num_args);
addr += num_args;
if (x & 0x80)
delay(150); // NOLINT
}
}
// Tell the display controller where we want to draw pixels.
void ILI9XXXDisplay::set_addr_window_(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2) {
x1 += this->offset_x_;

View file

@ -109,7 +109,7 @@ class ILI9XXXDisplay : public display::DisplayBuffer,
virtual void set_madctl();
void display_();
void init_lcd_(const uint8_t *addr);
virtual void init_lcd(const uint8_t *addr);
void set_addr_window_(uint16_t x, uint16_t y, uint16_t x2, uint16_t y2);
void reset_();
@ -269,6 +269,7 @@ class ILI9XXXS3BoxLite : public ILI9XXXDisplay {
class ILI9XXXGC9A01A : public ILI9XXXDisplay {
public:
ILI9XXXGC9A01A() : ILI9XXXDisplay(INITCMD_GC9A01A, 240, 240, true) {}
void init_lcd(const uint8_t *addr) override;
};
//----------- ILI9XXX_24_TFT display --------------

View file

@ -6,12 +6,12 @@
#include "mqtt_const.h"
#ifdef USE_MQTT
#ifdef USE_DATETIME_TIME
#ifdef USE_DATETIME_DATETIME
namespace esphome {
namespace mqtt {
static const char *const TAG = "mqtt.datetime.time";
static const char *const TAG = "mqtt.datetime.datetime";
using namespace esphome::datetime;
@ -80,5 +80,5 @@ bool MQTTDateTimeComponent::publish_state(uint16_t year, uint8_t month, uint8_t
} // namespace mqtt
} // namespace esphome
#endif // USE_DATETIME_TIME
#endif // USE_DATETIME_DATETIME
#endif // USE_MQTT

View file

@ -3,7 +3,7 @@
#include "esphome/core/defines.h"
#ifdef USE_MQTT
#ifdef USE_DATETIME_TIME
#ifdef USE_DATETIME_DATETIME
#include "esphome/components/datetime/datetime_entity.h"
#include "mqtt_component.h"
@ -17,7 +17,7 @@ class MQTTDateTimeComponent : public mqtt::MQTTComponent {
*
* @param time The time entity.
*/
explicit MQTTDateTimeComponent(datetime::DateTimeEntity *time);
explicit MQTTDateTimeComponent(datetime::DateTimeEntity *datetime);
// ========== INTERNAL METHODS ==========
// (In most use cases you won't need these)
@ -41,5 +41,5 @@ class MQTTDateTimeComponent : public mqtt::MQTTComponent {
} // namespace mqtt
} // namespace esphome
#endif // USE_DATETIME_DATE
#endif // USE_DATETIME_DATETIME
#endif // USE_MQTT

View file

@ -243,7 +243,7 @@ ErrorCode VEML7700Component::configure_() {
}
PSMRegister psm{0};
psm.PSM = PSM::PSM_MODE_1;
psm.PSM = PSMMode::PSM_MODE_1;
psm.PSM_EN = false;
ESP_LOGV(TAG, "Setting PSM to 0x%04X", psm.raw);
err = this->write_register((uint8_t) CommandRegisters::PWR_SAVING, psm.raw_bytes, VEML_REG_SIZE);

View file

@ -24,7 +24,7 @@ enum class CommandRegisters : uint8_t {
ALS_INT = 0x06 // R: ALS INT trigger event
};
enum Gain : uint8_t {
enum Gain : uint16_t {
X_1 = 0,
X_2 = 1,
X_1_8 = 2,
@ -32,7 +32,7 @@ enum Gain : uint8_t {
};
const uint8_t GAINS_COUNT = 4;
enum IntegrationTime : uint8_t {
enum IntegrationTime : uint16_t {
INTEGRATION_TIME_25MS = 0b1100,
INTEGRATION_TIME_50MS = 0b1000,
INTEGRATION_TIME_100MS = 0b0000,
@ -42,14 +42,14 @@ enum IntegrationTime : uint8_t {
};
const uint8_t INTEGRATION_TIMES_COUNT = 6;
enum Persistence : uint8_t {
enum Persistence : uint16_t {
PERSISTENCE_1 = 0,
PERSISTENCE_2 = 1,
PERSISTENCE_4 = 2,
PERSISTENCE_8 = 3,
};
enum PSM : uint8_t {
enum PSMMode : uint16_t {
PSM_MODE_1 = 0,
PSM_MODE_2 = 1,
PSM_MODE_3 = 2,
@ -92,7 +92,7 @@ union PSMRegister {
uint8_t raw_bytes[2];
struct {
bool PSM_EN : 1;
uint8_t PSM : 2;
PSMMode PSM : 2;
uint16_t reserved : 13;
} __attribute__((packed));
};

View file

@ -799,7 +799,7 @@ void VoiceAssistant::on_audio(const api::VoiceAssistantAudio &msg) {
this->speaker_buffer_index_ += msg.data.length();
this->speaker_buffer_size_ += msg.data.length();
this->speaker_bytes_received_ += msg.data.length();
ESP_LOGV(TAG, "Received audio: %" PRId32 " bytes from API", msg.data.length());
ESP_LOGV(TAG, "Received audio: %u bytes from API", msg.data.length());
} else {
ESP_LOGE(TAG, "Cannot receive audio, buffer is full");
}

View file

@ -0,0 +1,11 @@
uart:
- id: uart_a01nyub
tx_pin: ${tx_pin}
rx_pin: ${rx_pin}
baud_rate: 9600
sensor:
- platform: a01nyub
id: a01nyub_sensor
name: a01nyub Distance
uart_id: uart_a01nyub

View file

@ -1,13 +1,5 @@
uart:
- id: uart_a01nyub
tx_pin:
number: 4
rx_pin:
number: 5
baud_rate: 9600
substitutions:
tx_pin: GPIO4
rx_pin: GPIO5
sensor:
- platform: a01nyub
id: a01nyub_sensor
name: a01nyub Distance
uart_id: uart_a01nyub
<<: !include common.yaml

View file

@ -1,13 +1,5 @@
uart:
- id: uart_a01nyub
tx_pin:
number: 4
rx_pin:
number: 5
baud_rate: 9600
substitutions:
tx_pin: GPIO4
rx_pin: GPIO5
sensor:
- platform: a01nyub
id: a01nyub_sensor
name: a01nyub Distance
uart_id: uart_a01nyub
<<: !include common.yaml

View file

@ -1,13 +1,5 @@
uart:
- id: uart_a01nyub
tx_pin:
number: 17
rx_pin:
number: 16
baud_rate: 9600
substitutions:
tx_pin: GPIO17
rx_pin: GPIO16
sensor:
- platform: a01nyub
id: a01nyub_sensor
name: a01nyub Distance
uart_id: uart_a01nyub
<<: !include common.yaml

View file

@ -1,13 +1,5 @@
uart:
- id: uart_a01nyub
tx_pin:
number: 17
rx_pin:
number: 16
baud_rate: 9600
substitutions:
tx_pin: GPIO17
rx_pin: GPIO16
sensor:
- platform: a01nyub
id: a01nyub_sensor
name: a01nyub Distance
uart_id: uart_a01nyub
<<: !include common.yaml

View file

@ -1,13 +1,5 @@
uart:
- id: uart_a01nyub
tx_pin:
number: 4
rx_pin:
number: 5
baud_rate: 9600
substitutions:
tx_pin: GPIO4
rx_pin: GPIO5
sensor:
- platform: a01nyub
id: a01nyub_sensor
name: a01nyub Distance
uart_id: uart_a01nyub
<<: !include common.yaml

View file

@ -1,13 +1,5 @@
uart:
- id: uart_a01nyub
tx_pin:
number: 4
rx_pin:
number: 5
baud_rate: 9600
substitutions:
tx_pin: GPIO4
rx_pin: GPIO5
sensor:
- platform: a01nyub
id: a01nyub_sensor
name: a01nyub Distance
uart_id: uart_a01nyub
<<: !include common.yaml

View file

@ -50,12 +50,12 @@ api:
then:
- logger.log:
# yamllint disable rule:line-length
format: "Bool: %s (%u), Int: %d (%u), Float: %f (%u), String: %s (%u)"
format: "Bool: %s (%u), Int: %ld (%u), Float: %f (%u), String: %s (%u)"
# yamllint enable rule:line-length
args:
- YESNO(bool_arr[0])
- bool_arr.size()
- int_arr[0]
- (long) int_arr[0]
- int_arr.size()
- float_arr[0]
- float_arr.size()

View file

@ -1,3 +0,0 @@
sensor:
- platform: esp32_hall
name: ESP32 Hall Sensor

View file

@ -1 +0,0 @@
<<: !include common.yaml

View file

@ -1 +1,3 @@
<<: !include common.yaml
sensor:
- platform: esp32_hall
name: ESP32 Hall Sensor

View file

@ -1,5 +1,5 @@
ethernet:
type: LAN8720
type: DP83848
mdc_pin: 23
mdio_pin: 25
clk_mode: GPIO0_IN

View file

@ -1,5 +1,5 @@
ethernet:
type: LAN8720
type: IP101
mdc_pin: 23
mdio_pin: 25
clk_mode: GPIO0_IN

View file

@ -0,0 +1,12 @@
ethernet:
type: JL1101
mdc_pin: 23
mdio_pin: 25
clk_mode: GPIO0_IN
phy_addr: 0
power_pin: 26
manual_ip:
static_ip: 192.168.178.56
gateway: 192.168.178.1
subnet: 255.255.255.0
domain: .local

View file

@ -0,0 +1,12 @@
ethernet:
type: KSZ8081
mdc_pin: 23
mdio_pin: 25
clk_mode: GPIO0_IN
phy_addr: 0
power_pin: 26
manual_ip:
static_ip: 192.168.178.56
gateway: 192.168.178.1
subnet: 255.255.255.0
domain: .local

View file

@ -0,0 +1,12 @@
ethernet:
type: KSZ8081RNA
mdc_pin: 23
mdio_pin: 25
clk_mode: GPIO0_IN
phy_addr: 0
power_pin: 26
manual_ip:
static_ip: 192.168.178.56
gateway: 192.168.178.1
subnet: 255.255.255.0
domain: .local

View file

@ -0,0 +1,12 @@
ethernet:
type: RTL8201
mdc_pin: 23
mdio_pin: 25
clk_mode: GPIO0_IN
phy_addr: 0
power_pin: 26
manual_ip:
static_ip: 192.168.178.56
gateway: 192.168.178.1
subnet: 255.255.255.0
domain: .local

View file

@ -1,11 +1,11 @@
ethernet:
type: W5500
clk_pin: GPIO19
mosi_pin: GPIO21
miso_pin: GPIO23
cs_pin: GPIO18
interrupt_pin: GPIO36
reset_pin: GPIO22
clk_pin: 19
mosi_pin: 21
miso_pin: 23
cs_pin: 18
interrupt_pin: 36
reset_pin: 22
clock_speed: 10Mhz
manual_ip:
static_ip: 192.168.178.56

View file

@ -0,0 +1 @@
<<: !include common-dp83848.yaml

View file

@ -0,0 +1 @@
<<: !include common-dp83848.yaml

View file

@ -0,0 +1 @@
<<: !include common-ip101.yaml

View file

@ -0,0 +1 @@
<<: !include common-ip101.yaml

View file

@ -0,0 +1 @@
<<: !include common-jl1101.yaml

View file

@ -0,0 +1 @@
<<: !include common-jl1101.yaml

View file

@ -0,0 +1 @@
<<: !include common-ksz8081.yaml

View file

@ -0,0 +1 @@
<<: !include common-ksz8081.yaml

View file

@ -0,0 +1 @@
<<: !include common-ksz8081rna.yaml

View file

@ -0,0 +1 @@
<<: !include common-ksz8081rna.yaml

View file

@ -0,0 +1 @@
<<: !include common-lan8720.yaml

View file

@ -0,0 +1 @@
<<: !include common-lan8720.yaml

View file

@ -0,0 +1 @@
<<: !include common-rtl8201.yaml

View file

@ -0,0 +1 @@
<<: !include common-rtl8201.yaml

View file

@ -0,0 +1 @@
<<: !include common-w5500.yaml

View file

@ -0,0 +1 @@
<<: !include common-w5500.yaml

View file

@ -1 +0,0 @@
<<: !include common.yaml

View file

@ -1 +0,0 @@
<<: !include common.yaml

View file

@ -1,14 +0,0 @@
ethernet:
type: W5500
clk_pin: GPIO19
mosi_pin: GPIO21
miso_pin: GPIO23
cs_pin: GPIO18
interrupt_pin: GPIO36
reset_pin: GPIO22
clock_speed: 10Mhz
manual_ip:
static_ip: 192.168.178.56
gateway: 192.168.178.1
subnet: 255.255.255.0
domain: .local

View file

@ -15,10 +15,10 @@ esphome:
on_response:
then:
- logger.log:
format: "Response status: %d, Duration: %u ms"
format: "Response status: %d, Duration: %lu ms"
args:
- response->status_code
- response->duration_ms
- (long) response->duration_ms
- http_request.post:
url: https://esphome.io
headers:

View file

@ -0,0 +1,59 @@
wifi:
ssid: "MySSID1"
password: "password1"
time:
- platform: sntp
wireguard:
address: 172.16.34.100
netmask: 255.255.255.0
# NEVER use the following keys for your VPN -- they are now public!
private_key: wPBMxtNYH3mChicrbpsRpZIasIdPq3yZuthn23FbGG8=
peer_public_key: Hs2JfikvYU03/Kv3YoAs1hrUIPPTEkpsZKSPUljE9yc=
peer_preshared_key: 20fjM5GRnSolGPC5SRj9ljgIUyQfruv0B0bvLl3Yt60=
peer_endpoint: wg.server.example
peer_persistent_keepalive: 25s
peer_allowed_ips:
- 172.16.34.0/24
- 192.168.4.0/24
binary_sensor:
- platform: wireguard
status:
name: 'WireGuard Status'
enabled:
name: 'WireGuard Enabled'
sensor:
- platform: wireguard
latest_handshake:
name: 'WireGuard Latest Handshake'
text_sensor:
- platform: wireguard
address:
name: 'WireGuard Address'
button:
- platform: template
name: 'Toggle WireGuard'
entity_category: config
on_press:
- if:
condition: wireguard.enabled
then:
- wireguard.disable:
else:
- wireguard.enable:
- platform: template
name: 'Log WireGuard status'
entity_category: config
on_press:
- if:
condition: wireguard.peer_online
then:
- logger.log: 'wireguard remote peer is online'
else:
- logger.log: 'wireguard remote peer is offline'

View file

@ -1,59 +1 @@
wifi:
ssid: "MySSID1"
password: "password1"
time:
- platform: sntp
wireguard:
address: 172.16.34.100
netmask: 255.255.255.0
# NEVER use the following keys for your vpn, they are now public!
private_key: wPBMxtNYH3mChicrbpsRpZIasIdPq3yZuthn23FbGG8=
peer_public_key: Hs2JfikvYU03/Kv3YoAs1hrUIPPTEkpsZKSPUljE9yc=
peer_preshared_key: 20fjM5GRnSolGPC5SRj9ljgIUyQfruv0B0bvLl3Yt60=
peer_endpoint: wg.server.example
peer_persistent_keepalive: 25s
peer_allowed_ips:
- 172.16.34.0/24
- 192.168.4.0/24
binary_sensor:
- platform: wireguard
status:
name: 'WireGuard Status'
enabled:
name: 'WireGuard Enabled'
sensor:
- platform: wireguard
latest_handshake:
name: 'WireGuard Latest Handshake'
text_sensor:
- platform: wireguard
address:
name: 'WireGuard Address'
button:
- platform: template
name: 'Toggle WireGuard'
entity_category: config
on_press:
- if:
condition: wireguard.enabled
then:
- wireguard.disable:
else:
- wireguard.enable:
- platform: template
name: 'Log WireGuard status'
entity_category: config
on_press:
- if:
condition: wireguard.peer_online
then:
- logger.log: 'wireguard remote peer is online'
else:
- logger.log: 'wireguard remote peer is offline'
<<: !include common.yaml

View file

@ -1,60 +1 @@
wifi:
ssid: MySSID
password: password1
time:
- platform: sntp
wireguard:
id: vpn
address: 172.16.34.100
netmask: 255.255.255.0
# NEVER use the following keys for your vpn, they are now public!
private_key: wPBMxtNYH3mChicrbpsRpZIasIdPq3yZuthn23FbGG8=
peer_public_key: Hs2JfikvYU03/Kv3YoAs1hrUIPPTEkpsZKSPUljE9yc=
peer_preshared_key: 20fjM5GRnSolGPC5SRj9ljgIUyQfruv0B0bvLl3Yt60=
peer_endpoint: wg.server.example
peer_persistent_keepalive: 25s
peer_allowed_ips:
- 172.16.34.0/24
- 192.168.4.0/24
binary_sensor:
- platform: wireguard
status:
name: 'WireGuard Status'
enabled:
name: 'WireGuard Enabled'
sensor:
- platform: wireguard
latest_handshake:
name: 'WireGuard Latest Handshake'
text_sensor:
- platform: wireguard
address:
name: 'WireGuard Address'
button:
- platform: template
name: 'Toggle WireGuard'
entity_category: config
on_press:
- if:
condition: wireguard.enabled
then:
- wireguard.disable:
else:
- wireguard.enable:
- platform: template
name: 'Log WireGuard status'
entity_category: config
on_press:
- if:
condition: wireguard.peer_online
then:
- logger.log: 'wireguard remote peer is online'
else:
- logger.log: 'wireguard remote peer is offline'
<<: !include common.yaml

View file

@ -1,60 +1 @@
wifi:
ssid: MySSID
password: password1
time:
- platform: sntp
wireguard:
id: vpn
address: 172.16.34.100
netmask: 255.255.255.0
# NEVER use the following keys for your vpn, they are now public!
private_key: wPBMxtNYH3mChicrbpsRpZIasIdPq3yZuthn23FbGG8=
peer_public_key: Hs2JfikvYU03/Kv3YoAs1hrUIPPTEkpsZKSPUljE9yc=
peer_preshared_key: 20fjM5GRnSolGPC5SRj9ljgIUyQfruv0B0bvLl3Yt60=
peer_endpoint: wg.server.example
peer_persistent_keepalive: 25s
peer_allowed_ips:
- 172.16.34.0/24
- 192.168.4.0/24
binary_sensor:
- platform: wireguard
status:
name: 'WireGuard Status'
enabled:
name: 'WireGuard Enabled'
sensor:
- platform: wireguard
latest_handshake:
name: 'WireGuard Latest Handshake'
text_sensor:
- platform: wireguard
address:
name: 'WireGuard Address'
button:
- platform: template
name: 'Toggle WireGuard'
entity_category: config
on_press:
- if:
condition: wireguard.enabled
then:
- wireguard.disable:
else:
- wireguard.enable:
- platform: template
name: 'Log WireGuard status'
entity_category: config
on_press:
- if:
condition: wireguard.peer_online
then:
- logger.log: 'wireguard remote peer is online'
else:
- logger.log: 'wireguard remote peer is offline'
<<: !include common.yaml

View file

@ -1,62 +1,4 @@
wifi:
ssid: "MySSID1"
password: "password1"
<<: !include common.yaml
network:
enable_ipv6: true
time:
- platform: sntp
wireguard:
address: 172.16.34.100
netmask: 255.255.255.0
# NEVER use the following keys for your vpn, they are now public!
private_key: wPBMxtNYH3mChicrbpsRpZIasIdPq3yZuthn23FbGG8=
peer_public_key: Hs2JfikvYU03/Kv3YoAs1hrUIPPTEkpsZKSPUljE9yc=
peer_preshared_key: 20fjM5GRnSolGPC5SRj9ljgIUyQfruv0B0bvLl3Yt60=
peer_endpoint: wg.server.example
peer_persistent_keepalive: 25s
peer_allowed_ips:
- 172.16.34.0/24
- 192.168.4.0/24
binary_sensor:
- platform: wireguard
status:
name: 'WireGuard Status'
enabled:
name: 'WireGuard Enabled'
sensor:
- platform: wireguard
latest_handshake:
name: 'WireGuard Latest Handshake'
text_sensor:
- platform: wireguard
address:
name: 'WireGuard Address'
button:
- platform: template
name: 'Toggle WireGuard'
entity_category: config
on_press:
- if:
condition: wireguard.enabled
then:
- wireguard.disable:
else:
- wireguard.enable:
- platform: template
name: 'Log WireGuard status'
entity_category: config
on_press:
- if:
condition: wireguard.peer_online
then:
- logger.log: 'wireguard remote peer is online'
else:
- logger.log: 'wireguard remote peer is offline'

View file

@ -1,62 +1,4 @@
wifi:
ssid: "MySSID1"
password: "password1"
<<: !include common.yaml
network:
enable_ipv6: true
time:
- platform: sntp
wireguard:
address: 172.16.34.100
netmask: 255.255.255.0
# NEVER use the following keys for your vpn, they are now public!
private_key: wPBMxtNYH3mChicrbpsRpZIasIdPq3yZuthn23FbGG8=
peer_public_key: Hs2JfikvYU03/Kv3YoAs1hrUIPPTEkpsZKSPUljE9yc=
peer_preshared_key: 20fjM5GRnSolGPC5SRj9ljgIUyQfruv0B0bvLl3Yt60=
peer_endpoint: wg.server.example
peer_persistent_keepalive: 25s
peer_allowed_ips:
- 172.16.34.0/24
- 192.168.4.0/24
binary_sensor:
- platform: wireguard
status:
name: 'WireGuard Status'
enabled:
name: 'WireGuard Enabled'
sensor:
- platform: wireguard
latest_handshake:
name: 'WireGuard Latest Handshake'
text_sensor:
- platform: wireguard
address:
name: 'WireGuard Address'
button:
- platform: template
name: 'Toggle WireGuard'
entity_category: config
on_press:
- if:
condition: wireguard.enabled
then:
- wireguard.disable:
else:
- wireguard.enable:
- platform: template
name: 'Log WireGuard status'
entity_category: config
on_press:
- if:
condition: wireguard.peer_online
then:
- logger.log: 'wireguard remote peer is online'
else:
- logger.log: 'wireguard remote peer is offline'

View file

@ -1,62 +1,4 @@
wifi:
ssid: "MySSID1"
password: "password1"
<<: !include common.yaml
network:
enable_ipv6: true
time:
- platform: sntp
wireguard:
address: 172.16.34.100
netmask: 255.255.255.0
# NEVER use the following keys for your vpn, they are now public!
private_key: wPBMxtNYH3mChicrbpsRpZIasIdPq3yZuthn23FbGG8=
peer_public_key: Hs2JfikvYU03/Kv3YoAs1hrUIPPTEkpsZKSPUljE9yc=
peer_preshared_key: 20fjM5GRnSolGPC5SRj9ljgIUyQfruv0B0bvLl3Yt60=
peer_endpoint: wg.server.example
peer_persistent_keepalive: 25s
peer_allowed_ips:
- 172.16.34.0/24
- 192.168.4.0/24
binary_sensor:
- platform: wireguard
status:
name: 'WireGuard Status'
enabled:
name: 'WireGuard Enabled'
sensor:
- platform: wireguard
latest_handshake:
name: 'WireGuard Latest Handshake'
text_sensor:
- platform: wireguard
address:
name: 'WireGuard Address'
button:
- platform: template
name: 'Toggle WireGuard'
entity_category: config
on_press:
- if:
condition: wireguard.enabled
then:
- wireguard.disable:
else:
- wireguard.enable:
- platform: template
name: 'Log WireGuard status'
entity_category: config
on_press:
- if:
condition: wireguard.peer_online
then:
- logger.log: 'wireguard remote peer is online'
else:
- logger.log: 'wireguard remote peer is offline'