Advertisement
Szafran

Untitled

Jun 8th, 2023
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.86 KB | None | 0 0
  1. substitutions:
  2. devicename: ws-rc-decoder
  3. upper_devicename: "WS - Remote control decoder"
  4. upper_devicename_nospace: "WS-Remote-Control-Decoder"
  5.  
  6.  
  7. esphome:
  8. name: ${devicename}
  9. platform: ESP8266
  10. board: esp01_1m
  11.  
  12.  
  13. logger:
  14. # level: NONE
  15. # level: ERROR
  16. # level: WARN
  17. # level: INFO
  18. level: DEBUG
  19. # level: VERBOSE
  20. # level: VERY_VERBOSE
  21.  
  22.  
  23. api:
  24. reboot_timeout: 360s
  25.  
  26.  
  27. ota:
  28. password: !secret ota_password
  29.  
  30.  
  31. wifi:
  32. ssid: !secret wifi_ssid
  33. password: !secret wifi_password
  34. reboot_timeout: 5min
  35. use_address: 192.168.1.250
  36. fast_connect: on
  37.  
  38. manual_ip:
  39. static_ip: 192.168.1.250
  40. gateway: 192.168.1.1
  41. subnet: 255.255.255.0
  42. dns1: 192.168.1.1
  43.  
  44.  
  45. web_server:
  46. port: 80
  47.  
  48.  
  49. captive_portal:
  50.  
  51.  
  52. ### PRG
  53.  
  54.  
  55. binary_sensor:
  56. - platform: status
  57. name: ${upper_devicename}
  58. id: sensor_status
  59.  
  60.  
  61. text_sensor:
  62. - platform: template
  63. name: "${upper_devicename} - Uptime"
  64. id: uptime_human
  65. icon: mdi:clock-outline
  66. - platform: template
  67. name: "${upper_devicename} - Siła sygnału WiFi"
  68. id: wifi_percentage
  69. icon: mdi:wifi
  70.  
  71.  
  72. #switch:
  73. # - platform: restart
  74. # name: "${upper_devicename} - Restart"
  75. # id: switch_restart
  76.  
  77.  
  78. time:
  79. - platform: sntp
  80. id: sensor_time
  81. timezone: "Europe/Warsaw"
  82. servers: [ 192.168.1.1, 0.pl.pool.ntp.org, 1.pl.pool.ntp.org ]
  83.  
  84.  
  85. sensor:
  86. - platform: uptime
  87. id: uptime_sensor
  88. update_interval: 5s
  89. internal: true
  90. on_raw_value:
  91. then:
  92. - text_sensor.template.publish:
  93. id: uptime_human
  94. state: !lambda |-
  95. int seconds = round(id(uptime_sensor).raw_state);
  96. int days = seconds / (24 * 3600);
  97. seconds = seconds % (24 * 3600);
  98. int hours = seconds / 3600;
  99. seconds = seconds % 3600;
  100. int minutes = seconds / 60;
  101. seconds = seconds % 60;
  102. return (
  103. (days ? String(days) + "d " : "") +
  104. (hours ? String(hours) + "h " : "") +
  105. (minutes ? String(minutes) + "m " : "") +
  106. (String(seconds) + "s")
  107. ).c_str();
  108. - platform: wifi_signal
  109. id: wifi_sensor
  110. update_interval: 5s
  111. internal: true
  112. on_raw_value:
  113. then:
  114. - text_sensor.template.publish:
  115. id: wifi_percentage
  116. state: !lambda |-
  117. int moc = round(id(wifi_sensor).raw_state);
  118. moc = 2 * (moc + 100);
  119. if (moc > 100) { moc = 100; };
  120. return ((moc ? String(moc) + "%" : "")).c_str();
  121.  
  122.  
  123. remote_receiver:
  124. id: receiver
  125. pin:
  126. number: GPIO2
  127. inverted: true
  128. # mode: INPUT_PULLUP
  129. dump:
  130. - lg
  131. - midea
  132. - nec
  133. - panasonic
  134. - pioneer
  135. - jvc
  136. - samsung
  137. - samsung36
  138. - sony
  139. - toshiba_ac
  140. - rc5
  141. - raw
  142.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement