2023-02-01 18:57:51 +01:00
|
|
|
esphome:
|
|
|
|
name: esp360remote
|
|
|
|
|
|
|
|
esp32:
|
|
|
|
board: esp32doit-devkit-v1
|
|
|
|
framework:
|
|
|
|
type: arduino
|
|
|
|
|
|
|
|
# Enable logging
|
|
|
|
logger:
|
|
|
|
|
|
|
|
# Enable Home Assistant API
|
2023-03-07 12:08:43 +01:00
|
|
|
# Services available for Home Assistant automation and SmartIR
|
2023-02-01 18:57:51 +01:00
|
|
|
api:
|
2023-02-21 15:48:42 +01:00
|
|
|
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
|
|
|
|
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;'
|
2023-02-01 18:57:51 +01:00
|
|
|
|
|
|
|
ota:
|
|
|
|
password: ""
|
|
|
|
|
|
|
|
wifi:
|
|
|
|
ssid: "nossid"
|
|
|
|
password: "nopassword"
|
|
|
|
|
2023-03-04 09:56:48 +01:00
|
|
|
#HotSpot when it can't connect to WiFi
|
2023-02-01 18:57:51 +01:00
|
|
|
ap:
|
|
|
|
ssid: "Esp360Remote"
|
|
|
|
password: "Esp360Remote"
|
|
|
|
|
|
|
|
captive_portal:
|
|
|
|
|
2023-03-04 09:56:48 +01:00
|
|
|
#i2c bus definition
|
2023-02-01 18:57:51 +01:00
|
|
|
i2c:
|
|
|
|
sda: 21
|
|
|
|
scl: 22
|
|
|
|
scan: true
|
|
|
|
id: bus_a
|
|
|
|
|
2023-03-04 09:56:48 +01:00
|
|
|
#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
|
2023-02-01 18:57:51 +01:00
|
|
|
sensor:
|
|
|
|
- platform: shtcx
|
|
|
|
temperature:
|
|
|
|
name: "Living Room Temperature"
|
|
|
|
filters:
|
|
|
|
- offset: -4
|
|
|
|
humidity:
|
|
|
|
name: "Living Room Humidity"
|
|
|
|
filters:
|
|
|
|
- offset: +19.1
|
|
|
|
address: 0x70
|
|
|
|
update_interval: 120s
|
|
|
|
- platform: bh1750
|
|
|
|
name: "BH1750 Illuminance"
|
2023-03-04 09:56:48 +01:00
|
|
|
filters:
|
|
|
|
- multiply: 5
|
2023-02-01 18:57:51 +01:00
|
|
|
address: 0x23
|
|
|
|
update_interval: 1s
|
|
|
|
|
2023-03-04 09:56:48 +01:00
|
|
|
#Setting up IR and RF receivers
|
2023-02-01 18:57:51 +01:00
|
|
|
remote_receiver:
|
|
|
|
- id: RF_RX
|
|
|
|
pin:
|
|
|
|
number: GPIO5
|
|
|
|
inverted: True
|
|
|
|
dump:
|
|
|
|
- rc_switch
|
|
|
|
tolerance: 35%
|
|
|
|
filter: 200us
|
|
|
|
idle: 4ms
|
|
|
|
buffer_size: 10kb
|
2023-02-24 09:10:54 +01:00
|
|
|
on_rc_switch:
|
|
|
|
- homeassistant.event:
|
|
|
|
event: esphome.rf_code_received
|
|
|
|
data:
|
|
|
|
protocol: !lambda 'return x.protocol;'
|
|
|
|
code: !lambda 'return x.code;'
|
2023-02-01 18:57:51 +01:00
|
|
|
- id: IR_RX
|
|
|
|
pin:
|
|
|
|
number: GPIO19
|
|
|
|
inverted: True
|
|
|
|
dump: all
|
|
|
|
|
|
|
|
|
2023-03-04 09:56:48 +01:00
|
|
|
#Setting up IR and RF transmitters
|
2023-02-01 18:57:51 +01:00
|
|
|
remote_transmitter:
|
|
|
|
- id: RF_TX
|
|
|
|
pin: GPIO18
|
|
|
|
carrier_duty_percent: 100%
|
|
|
|
- id: IR_TX
|
|
|
|
pin: GPIO13
|
|
|
|
carrier_duty_percent: 50%
|
|
|
|
|
|
|
|
|
|
|
|
web_server:
|
|
|
|
port: 80
|
|
|
|
|
|
|
|
#Status LED
|
|
|
|
switch:
|
|
|
|
- platform: gpio
|
|
|
|
pin: 12
|
|
|
|
name: "Status Led"
|
|
|
|
restore_mode: ALWAYS_ON
|