mirror of
https://github.com/ale1800/ESP-360-REMOTE.git
synced 2025-03-10 12:48:45 -03:00
Add files via upload
This commit is contained in:
parent
00e459e42a
commit
01e5bc6b03
181
ESPHome/esp360remote.yaml
Normal file
181
ESPHome/esp360remote.yaml
Normal file
@ -0,0 +1,181 @@
|
||||
substitutions:
|
||||
name: "esp360remote"
|
||||
friendly_name: "ESP360Remote"
|
||||
project_name: "ale1800.ESP360Remote"
|
||||
project_version: "2.0"
|
||||
|
||||
esphome:
|
||||
name: "${name}"
|
||||
name_add_mac_suffix: true
|
||||
project:
|
||||
name: "${project_name}"
|
||||
version: "${project_version}"
|
||||
|
||||
esp32:
|
||||
board: esp32dev
|
||||
framework:
|
||||
type: arduino
|
||||
|
||||
# Enable logging
|
||||
logger:
|
||||
|
||||
# Enable Home Assistant API
|
||||
api:
|
||||
services:
|
||||
- service: send_ir_raw
|
||||
variables:
|
||||
command: int[]
|
||||
then:
|
||||
- remote_transmitter.transmit_raw:
|
||||
transmitter_id: IR_TX
|
||||
code: !lambda 'return command;'
|
||||
- service: send_rf_raw
|
||||
variables:
|
||||
protocol_number: int
|
||||
raw_data: string
|
||||
repeat_times: int
|
||||
wait_time: int
|
||||
then:
|
||||
- remote_transmitter.transmit_rc_switch_raw:
|
||||
transmitter_id: RF_TX
|
||||
protocol: !lambda 'return esphome::remote_base::RC_SWITCH_PROTOCOLS[protocol_number];'
|
||||
code: !lambda 'return raw_data;'
|
||||
repeat:
|
||||
times: !lambda 'return repeat_times;'
|
||||
wait_time: !lambda 'return wait_time;'
|
||||
|
||||
ota:
|
||||
- platform: esphome
|
||||
|
||||
wifi:
|
||||
|
||||
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
||||
ap:
|
||||
ssid: "${name}"
|
||||
password: ""
|
||||
|
||||
web_server:
|
||||
port: 80
|
||||
|
||||
# Sets up the improv via serial client for Wi-Fi provisioning
|
||||
improv_serial:
|
||||
|
||||
|
||||
dashboard_import:
|
||||
package_import_url: github://ale1800/ESP-360-REMOTE/tree/main/ESPHome%20Configuration/esp360remote.yaml@main
|
||||
|
||||
|
||||
captive_portal:
|
||||
|
||||
#i2c bus definition
|
||||
i2c:
|
||||
sda: 21
|
||||
scl: 22
|
||||
scan: true
|
||||
id: bus_a
|
||||
|
||||
#Offsets have been added to the measurements taken.
|
||||
#These are necessary due to the heat generated by the PCB, the second layer of the board, and the case.
|
||||
#This way, sufficiently accurate values are obtained for automations
|
||||
sensor:
|
||||
- platform: shtcx
|
||||
temperature:
|
||||
name: "ESP360Remote Temperature"
|
||||
filters:
|
||||
- median:
|
||||
window_size: 5
|
||||
send_every: 1
|
||||
- offset: -3.7
|
||||
humidity:
|
||||
name: "ESP360Remote Humidity"
|
||||
filters:
|
||||
- median:
|
||||
window_size: 5
|
||||
send_every: 1
|
||||
- offset: +19.1
|
||||
address: 0x70
|
||||
update_interval: 300s
|
||||
- platform: bh1750
|
||||
name: "BH1750 Illuminance"
|
||||
filters:
|
||||
- multiply: 5
|
||||
address: 0x23
|
||||
update_interval: 1s
|
||||
|
||||
#Setting up IR and RF receivers
|
||||
remote_receiver:
|
||||
- id: RF_RX
|
||||
pin:
|
||||
number: GPIO5
|
||||
inverted: True
|
||||
dump:
|
||||
# - raw #(delete # for raw data)
|
||||
- rc_switch
|
||||
tolerance: 35%
|
||||
filter: 200us
|
||||
idle: 4ms
|
||||
buffer_size: 10kb
|
||||
on_rc_switch:
|
||||
- homeassistant.event:
|
||||
event: esphome.rf_code_received_test
|
||||
data:
|
||||
protocol: !lambda 'return x.protocol;'
|
||||
code: !lambda 'return x.code;'
|
||||
- id: IR_RX
|
||||
pin:
|
||||
number: GPIO19
|
||||
inverted: true
|
||||
mode:
|
||||
input: true
|
||||
pullup: true
|
||||
dump: all
|
||||
|
||||
|
||||
on_raw:
|
||||
- homeassistant.event:
|
||||
event: esphome.ir_raw_code_received
|
||||
data:
|
||||
code: !lambda '
|
||||
reverse(x.begin(), x.end());
|
||||
std::string str = "";
|
||||
for (auto it = x.begin(); it != x.end(); ++it)
|
||||
{
|
||||
str += to_string(*it);
|
||||
str += ",";
|
||||
if (it != x.end() - 1) str += " ";
|
||||
}
|
||||
if (str.size() > 0) str.erase( str.end() - 2);
|
||||
return esphome::to_string("[" + str + "]");'
|
||||
on_pronto:
|
||||
- homeassistant.event:
|
||||
event: esphome.ir_pronto_code_received
|
||||
data:
|
||||
code: !lambda 'return x.data;'
|
||||
on_lg:
|
||||
- homeassistant.event:
|
||||
event: esphome.ir_lg_code_received
|
||||
data:
|
||||
data: !lambda 'return x.data;'
|
||||
nbits: !lambda 'return x.nbits;'
|
||||
on_panasonic:
|
||||
- homeassistant.event:
|
||||
event: esphome.ir_panasonic_code_received
|
||||
data:
|
||||
address: !lambda 'return x.address;'
|
||||
command: !lambda 'return x.command;'
|
||||
|
||||
#Setting up IR and RF transmitters
|
||||
remote_transmitter:
|
||||
- id: RF_TX
|
||||
pin: GPIO18
|
||||
carrier_duty_percent: 100%
|
||||
- id: IR_TX
|
||||
pin: GPIO13
|
||||
carrier_duty_percent: 50%
|
||||
|
||||
#Status LED
|
||||
switch:
|
||||
- platform: gpio
|
||||
pin: 12
|
||||
name: "Status Led"
|
||||
restore_mode: ALWAYS_ON
|
Loading…
x
Reference in New Issue
Block a user