forked from dbuezas/esphome-cc1101
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcc1101.yaml
62 lines (58 loc) · 1.39 KB
/
cc1101.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
# https://github.com/dbuezas/esphome-cc1101
esphome:
name: cc1101
platform: ESP8266
board: d1_mini
includes:
- cc1101.h
libraries:
- SPI
- "SmartRC-CC1101-Driver-Lib"
wifi:
ssid: !secret wifi_name
password: !secret wifi_pass
fast_connect: true
power_save_mode: HIGH
logger:
api:
ota:
sensor:
- platform: custom
lambda: |-
auto my_sensor = new CC1101(
D5, // SCK
D6, // MISO
D7, // MOSI
D3, // CSN
D1, // GDO0
200, // bandwidth_in_khz
433.92 // freq_in_mhz
);
App.register_component(my_sensor);
return {my_sensor};
sensors:
id: transciver
internal: true
remote_transmitter:
- pin: D1 # This is GDO0
carrier_duty_percent: 100%
remote_receiver:
- pin: D1 # This is GDO0
# on the esp8266 use any of D1,D2,D5,D6,D7,Rx
# Don't use D3,D4,D8,TX, boot often fails.
# Can't be D0 or GPIO17 b/c no interrupts
dump:
- raw
binary_sensor:
- platform: remote_receiver
name: Garage
raw:
code: [415,-300,370,-300,375,-300,378,-300,378,-300,379,-300,405]
button:
- platform: template
name: Garage
on_press:
- lambda: get_cc1101(transciver).beginTransmission();
- remote_transmitter.transmit_raw:
code: [415,-300,370,-300,375,-300,378,-300,378,-300,379,-300,405]
- lambda: get_cc1101(transciver).endTransmission();