Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # PROBLEM ROZWIĄZANY - PONIŻEJ DZIAŁAJĄCY KOD :)
- #################### 1_lvn_irda - BROADLINK RM3 MINI + ESP32 ###################
- #################### systemowe
- substitutions:
- hostname: 1_lvn_irda
- main_pswd: !secret esphome_password
- wifi_ssid: !secret wifi_main_ssid
- wifi_pswd: !secret wifi_main_pswd
- esphome:
- name: ${hostname}
- platform: ESP32
- board: wemos_d1_mini32
- packages:
- wifi: !include _includes/esphome_wifi.yaml
- device_base: !include _includes/esphome_base.yaml
- #################### szyna I²C
- i2c:
- sda: 21
- scl: 22
- scan: True
- id: bus_a
- #################### encje #####################################################
- sensor:
- #################### jasność
- - platform: bh1750
- name: "${hostname}_illuminance"
- address: 0x23
- measurement_duration: 254
- ## mało światła: 254
- ## średnio: 69
- ## dużo światła: 31
- update_interval: 60s
- #################### sygnał wifi
- - platform: wifi_signal
- name: "${hostname}_linkquality"
- update_interval: 60s
- #################### testowy włącznik
- switch:
- - platform: template
- name: "Samsung TV Power"
- turn_on_action:
- remote_transmitter.transmit_samsung:
- data: 0xE0E040BF
- #################### bluetooth #################################################
- # esp32_ble_tracker:
- # id: BTE_HUB
- #################### IrDA ######################################################
- #################### odbiornik
- # remote_receiver:
- # id: irda_in
- # pin:
- # number: GPIO25
- # inverted: True
- # mode: INPUT_PULLUP
- # dump: raw
- # tolerance: 50%
- # filter: 500ms
- # idle: 50ms
- # buffer_size: 1kb
- #################### nadajnik
- remote_transmitter:
- id: irda_out
- pin: GPIO27
- carrier_duty_percent: 50%
- #################### service
- api:
- services:
- - service: send_raw
- variables:
- command: int[]
- times: int
- then:
- - remote_transmitter.transmit_raw:
- carrier_frequency: 38kHz
- code: !lambda 'return command;'
- repeat:
- times: !lambda 'return times;'
- wait_time: 0ms
- - service: send_samsung
- variables:
- command: string
- times: int
- then:
- - remote_transmitter.transmit_samsung:
- data: !lambda 'return strtoul(command.c_str(), NULL, 16);'
- repeat:
- times: !lambda 'return times;'
- wait_time: 0ms
Add Comment
Please, Sign In to add comment