Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- substitutions:
- devicename: ws-rc-decoder
- upper_devicename: "WS - Remote control decoder"
- upper_devicename_nospace: "WS-Remote-Control-Decoder"
- esphome:
- name: ${devicename}
- platform: ESP8266
- board: esp01_1m
- logger:
- # level: NONE
- # level: ERROR
- # level: WARN
- # level: INFO
- level: DEBUG
- # level: VERBOSE
- # level: VERY_VERBOSE
- api:
- reboot_timeout: 360s
- ota:
- password: !secret ota_password
- wifi:
- ssid: !secret wifi_ssid
- password: !secret wifi_password
- reboot_timeout: 5min
- use_address: 192.168.1.250
- fast_connect: on
- manual_ip:
- static_ip: 192.168.1.250
- gateway: 192.168.1.1
- subnet: 255.255.255.0
- dns1: 192.168.1.1
- web_server:
- port: 80
- captive_portal:
- ### PRG
- binary_sensor:
- - platform: status
- name: ${upper_devicename}
- id: sensor_status
- text_sensor:
- - platform: template
- name: "${upper_devicename} - Uptime"
- id: uptime_human
- icon: mdi:clock-outline
- - platform: template
- name: "${upper_devicename} - Siła sygnału WiFi"
- id: wifi_percentage
- icon: mdi:wifi
- #switch:
- # - platform: restart
- # name: "${upper_devicename} - Restart"
- # id: switch_restart
- time:
- - platform: sntp
- id: sensor_time
- timezone: "Europe/Warsaw"
- servers: [ 192.168.1.1, 0.pl.pool.ntp.org, 1.pl.pool.ntp.org ]
- sensor:
- - platform: uptime
- id: uptime_sensor
- update_interval: 5s
- internal: true
- on_raw_value:
- then:
- - text_sensor.template.publish:
- id: uptime_human
- state: !lambda |-
- int seconds = round(id(uptime_sensor).raw_state);
- int days = seconds / (24 * 3600);
- seconds = seconds % (24 * 3600);
- int hours = seconds / 3600;
- seconds = seconds % 3600;
- int minutes = seconds / 60;
- seconds = seconds % 60;
- return (
- (days ? String(days) + "d " : "") +
- (hours ? String(hours) + "h " : "") +
- (minutes ? String(minutes) + "m " : "") +
- (String(seconds) + "s")
- ).c_str();
- - platform: wifi_signal
- id: wifi_sensor
- update_interval: 5s
- internal: true
- on_raw_value:
- then:
- - text_sensor.template.publish:
- id: wifi_percentage
- state: !lambda |-
- int moc = round(id(wifi_sensor).raw_state);
- moc = 2 * (moc + 100);
- if (moc > 100) { moc = 100; };
- return ((moc ? String(moc) + "%" : "")).c_str();
- remote_receiver:
- id: receiver
- pin:
- number: GPIO2
- inverted: true
- # mode: INPUT_PULLUP
- dump:
- - lg
- - midea
- - nec
- - panasonic
- - pioneer
- - jvc
- - samsung
- - samsung36
- - sony
- - toshiba_ac
- - rc5
- - raw
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement