1
0
mirror of https://github.com/esphome/esphome.git synced 2025-02-01 02:31:00 +00:00

70 lines
1.7 KiB
YAML
Raw Normal View History

2024-11-25 03:31:34 +01:00
globals:
- id: hub_address
type: uint64_t
initial_value: "0xE86BEA23CD98"
restore_value: yes
2024-10-08 11:34:50 +02:00
2024-07-26 16:23:36 +02:00
espnow:
auto_add_peer: true
predefined_peers:
2024-07-26 16:23:36 +02:00
- FF:FF:FF:FF:FF:FF
2024-11-24 17:50:56 +01:00
- peer_id: keeper
mac_address: 11:22:33:44:55:66
wifi_channel: 2
2024-08-24 20:08:40 +02:00
on_receive:
2024-07-26 16:23:36 +02:00
- logger.log:
2024-11-17 21:11:35 +01:00
format: "Received: '%s' from '%s' command: %d RSSI: %d"
args:
[
packet.get_payload(),
packet.get_peer_code().c_str(),
packet.get_command(),
packet.rssi,
]
on_broadcast:
- command: 123
then:
- logger.log:
format: "Broadcast Received from: '%s' RSSI: %d: %s"
args:
[
packet.get_peer_code().c_str(),
packet.rssi,
packet.get_payload(),
]
interval:
- interval: 10sec
then:
2024-11-25 01:54:18 +01:00
- espnow.broadcast:
2024-11-17 21:11:35 +01:00
payload: "hallo everyone"
command: 123
- espnow.send:
2024-11-24 17:50:56 +01:00
mac_address: keeper
2024-11-17 21:11:35 +01:00
payload: "hallo everyone"
2024-11-24 17:50:56 +01:00
command: 230
- espnow.send:
2024-11-25 02:40:52 +01:00
mac_address: 44:55:66:77:88:33
2024-11-24 17:50:56 +01:00
payload: "hallo everyone"
command: 230
- espnow.send:
# dynamic peer address
mac_address: !lambda return keeper;
payload: "use keeper dynamicly "
command: 62
- espnow.send:
mac_address: !lambda return id(hub_address);
payload: "Using a global numberic value dynamicly"
command: 132
2024-07-26 16:23:36 +02:00
binary_sensor:
- platform: gpio
pin: GPIO39
name: Button
on_click:
2024-11-25 02:45:07 +01:00
- espnow.peer.add:
2024-11-24 17:50:56 +01:00
mac_address: 22:44:66:88:AA:CC
wifi_channel: 3
- espnow.peer.del: 22:44:66:88:AA:CC