Guest User

Untitled

a guest
Sep 2nd, 2024
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.30 KB | None | 0 0
  1. esphome:
  2. name: kotela6
  3. friendly_name: KotelA6
  4. libraries:
  5. - "Wire"
  6. - "uFire SHT20"
  7. - "ArduinoJson"
  8. includes:
  9. - includes/sht20.h
  10.  
  11. esp32:
  12. board: esp32dev
  13. framework:
  14. type: arduino
  15.  
  16.  
  17. wifi:
  18. ssid: !secret wifi_ssid
  19. password: !secret wifi_password
  20.  
  21.  
  22.  
  23. logger:
  24.  
  25. api:
  26. encryption:
  27. key: "dmnpt0Z87/XJP5FIZRYK3lAusBjLBkybSUU5o8kkPJo="
  28.  
  29. captive_portal:
  30.  
  31. ota:
  32. password: "8d615cc4929798ff5139d001f2f6e7fc"
  33.  
  34. #########################
  35.  
  36. uart:
  37. - id: ubus1
  38. tx_pin: GPIO13
  39. rx_pin: GPIO12
  40. baud_rate: 9600
  41. stop_bits: 1
  42.  
  43.  
  44.  
  45.  
  46.  
  47. i2c:
  48. sda: GPIO4
  49. scl: GPIO15 # Change SCL to GPIO22 to avoid issues with GPIO15
  50. scan: true
  51.  
  52.  
  53.  
  54. ##########################
  55. pcf8574:
  56. - id: 'pcf8574_hub_out_1' # for output channel 1-8
  57. address: 0x24
  58. - id: 'pcf8574_hub_in_1' # for input channel 9-16
  59. address: 0x22
  60. pcf8575: false
  61.  
  62.  
  63. #####################
  64. time:
  65. - platform: ds1307
  66. id: rtc_time
  67.  
  68.  
  69. sensor:
  70.  
  71. #### PZEM-004T V3 ####
  72.  
  73. - platform: pzemac
  74. address: 1
  75. current:
  76. name: "pMeter_current"
  77. accuracy_decimals: 2
  78. voltage:
  79. name: "pMeter_voltage"
  80. accuracy_decimals: 2
  81. power:
  82. name: "pMeter_power"
  83. unit_of_measurement: W
  84. accuracy_decimals: 2
  85. id: pMeter_power
  86. frequency:
  87. name: "pMeter_frequency"
  88. unit_of_measurement: Hz
  89. accuracy_decimals: 2
  90. power_factor:
  91. name: "pMeter_power_factor"
  92. accuracy_decimals: 2
  93. id: pMeter_power_factor
  94. energy:
  95. name: "pMeter_energy"
  96. unit_of_measurement: Wh
  97. accuracy_decimals: 1
  98. id: pMeter_energy
  99. update_interval: 5s
  100.  
  101.  
  102. - platform: template
  103. name: "pMeter_cumulative power"
  104. unit_of_measurement: "kWh"
  105. accuracy_decimals: 1
  106. update_interval: 5s
  107. icon: mdi:power
  108. lambda: return (( (id(pMeter_energy).state)/1000.0));
  109.  
  110. - platform: total_daily_energy
  111. name: "pMeter_of_day"
  112. power_id: pMeter_power
  113. unit_of_measurement: "kWh"
  114. accuracy_decimals: 2
  115. id: pMeter_power_of_day
  116. filters:
  117. # Multiplication factor from W to kW is 0.001
  118. - multiply: 0.001
  119. icon: mdi:counter
  120.  
  121. - platform: template
  122. name: "pMeter_veille"
  123. id: template_pMeter_veille
  124. unit_of_measurement: "kwh"
  125. accuracy_decimals: 2
  126. icon: mdi:power
  127. update_interval: 10s
  128.  
  129. - platform: template
  130. name: "pMeter_power_apparente"
  131. id: pMeter_power_apparente
  132. unit_of_measurement: "VA"
  133. accuracy_decimals: 2
  134. update_interval: 10s
  135. icon: mdi:power
  136. lambda: return ( (id(pMeter_power).state/id(pMeter_power_factor).state));
  137.  
  138. - platform: template
  139. name: "pMeter_power_reactive"
  140. id: pMeter_power_reactive
  141. unit_of_measurement: "VAr"
  142. accuracy_decimals: 2
  143. update_interval: 10s
  144. icon: mdi:power
  145. lambda: return ( ( sqrt( (id(pMeter_power_apparente).state)*(id(pMeter_power_apparente).state) - (id(pMeter_power).state)*(id(pMeter_power).state) ) ) );
  146.  
  147. - platform: wifi_signal
  148. name: "WiFi power_pMeter"
  149. update_interval: 10s
  150.  
  151. - platform: uptime
  152. name: "up"
  153. id: uptime_sec
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161. text_sensor:
  162. - platform: template
  163. name: pMeter_uptime
  164. lambda: |-
  165. int seconds = (id(uptime_sec).state);
  166. int days = seconds / (24 * 3600);
  167. seconds = seconds % (24 * 3600);
  168. int hours = seconds / 3600;
  169. seconds = seconds % 3600;
  170. int minutes = seconds / 60;
  171. seconds = seconds % 60;
  172. return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
  173. icon: mdi:clock-start
  174. update_interval: 113s
  175.  
  176. ################################################# SENSOR
  177. binary_sensor:
  178.  
  179.  
  180. - platform: status
  181. name: "pMeter_status"
  182. - platform: gpio
  183. name: "flood_elling"
  184. icon: mdi:home-flood
  185. pin:
  186. pcf8574: pcf8574_hub_in_1
  187. number: 0
  188. mode: INPUT
  189. inverted: true
  190.  
  191. - platform: gpio
  192. name: "flood_pool"
  193. icon: mdi:home-flood
  194. pin:
  195. pcf8574: pcf8574_hub_in_1
  196. number: 1
  197. mode: INPUT
  198. inverted: true
  199. - platform: gpio
  200. name: "flood_pump"
  201. icon: mdi:home-flood
  202. pin:
  203. pcf8574: pcf8574_hub_in_1
  204. number: 2
  205. mode: INPUT
  206. inverted: true
  207. - platform: gpio
  208. name: "KC868-A6-IN-4"
  209. pin:
  210. pcf8574: pcf8574_hub_in_1
  211. number: 3
  212. mode: INPUT
  213. inverted: true
  214. - platform: gpio
  215. name: "KC868-A6-IN-5"
  216. pin:
  217. pcf8574: pcf8574_hub_in_1
  218. number: 4
  219. mode: INPUT
  220. inverted: true
  221. - platform: gpio
  222. name: "KC868-A6-IN-6"
  223. pin:
  224. pcf8574: pcf8574_hub_in_1
  225. number: 5
  226. mode: INPUT
  227. inverted: true
  228.  
  229.  
  230. ################################################# RELAYS
  231. switch:
  232.  
  233. - platform: restart
  234. name: "pMeter_restart"
  235.  
  236. ### KINCONY 1
  237. - platform: gpio
  238. name: "Boiler ten"
  239. id: relay_1
  240. icon: mdi:fan
  241. pin:
  242. pcf8574: pcf8574_hub_out_1
  243. number: 0
  244. mode: OUTPUT
  245. inverted: true
  246.  
  247.  
  248. - platform: gpio
  249. name: "free"
  250. id: relay_2
  251. pin:
  252. pcf8574: pcf8574_hub_out_1
  253. number: 1
  254. mode: OUTPUT
  255. inverted: true
  256.  
  257. ########################### ######### BOILER PUMP
  258. - platform: gpio
  259. name: "Boiler Pump"
  260. icon: mdi:pump
  261. id: relay_3
  262. pin:
  263. pcf8574: pcf8574_hub_out_1
  264. number: 2
  265. mode: OUTPUT
  266. inverted: true
  267.  
  268.  
  269. ################################## #RECIRCULATE
  270.  
  271.  
  272. - platform: gpio
  273. name: "Recirculate Pump"
  274. icon: mdi:pump
  275. id: relay_4
  276. pin:
  277. pcf8574: pcf8574_hub_out_1
  278. number: 3
  279. mode: OUTPUT
  280. inverted: true
  281.  
  282. ######################## INTERLOCK WATER STOP ###########################
  283. - platform: gpio
  284. name: "HouseWater OFF"
  285. icon: mdi:water-off-outline
  286.  
  287. id: relay_5
  288. pin:
  289. pcf8574: pcf8574_hub_out_1
  290. number: 4
  291. mode: OUTPUT
  292. inverted: true
  293. interlock: [relay_6] # Interlock with Grow Pump_6
  294.  
  295. - platform: gpio
  296. name: "HouseWater ON"
  297. icon: mdi:water
  298. id: relay_6
  299. pin:
  300. pcf8574: pcf8574_hub_out_1
  301. number: 5
  302. mode: OUTPUT
  303. inverted: true
  304. interlock: [relay_5]
  305. restore_mode: ALWAYS_ON
  306.  
  307.  
Advertisement
Add Comment
Please, Sign In to add comment