Advertisement
pmfernandes

PIPSolar

Jul 16th, 2024
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.14 KB | None | 0 0
  1. substitutions:
  2. hostname: 'pipsolar'
  3. HumanDeviceName: 'PIP Solar'
  4. tx_pin: D1
  5. rx_pin: D2
  6.  
  7. esphome:
  8. name: ${hostname}
  9. platform: ESP8266
  10. board: d1_mini
  11. esp8266_restore_from_flash: true
  12.  
  13. preferences:
  14. flash_write_interval: 10min
  15.  
  16. # Enable logging
  17. logger:
  18.  
  19. wifi:
  20. networks:
  21. - ssid: DECO_tplink
  22. password: carolEsanti1410
  23. # Enable fallback hotspot (captive portal) in case wifi connection fails
  24. ap:
  25. ssid: ${hostname}_WIFI
  26. password: UOAA2VoDf6sO
  27.  
  28. captive_portal:
  29.  
  30. # Turn on the web server
  31. web_server:
  32. port: 80
  33.  
  34. # Enable Home Assistant API
  35. api:
  36.  
  37. ota:
  38. - platform: esphome
  39. password: !secret ota_password
  40.  
  41.  
  42. button:
  43. - platform: restart
  44. id: ${hostname}_restart
  45. name: "${HumanDeviceName} Restart"
  46. icon: mdi:restart
  47. - platform: safe_mode
  48. name: "${HumanDeviceName} Restart in Safe Mode"
  49. id: ${hostname}_power_button
  50. icon: mdi:restart
  51. - platform: shutdown
  52. name: "${HumanDeviceName} Shutdown"
  53. id: ${hostname}_shutdown_button
  54. icon: mdi:restart
  55.  
  56. time:
  57. - platform: homeassistant
  58. id: ${hostname}_esptime
  59.  
  60. uart:
  61. id: ${hostname}_uart_0
  62. baud_rate: 2400
  63. tx_pin: ${tx_pin}
  64. rx_pin: ${rx_pin}
  65.  
  66. pipsolar:
  67. uart_id: ${hostname}_uart_0
  68. id: ${hostname}_inverter0
  69.  
  70. sensor:
  71. - platform: uptime
  72. name: "${HumanDeviceName} Uptime Sensor"
  73. id: ${hostname}_uptime_sensor
  74. update_interval: 60s
  75. on_raw_value:
  76. then:
  77. - text_sensor.template.publish:
  78. id: ${hostname}_uptime_human
  79. state: !lambda |-
  80. int seconds = round(id(${hostname}_uptime_sensor).raw_state);
  81. int days = seconds / (24 * 3600);
  82. seconds = seconds % (24 * 3600);
  83. int hours = seconds / 3600;
  84. seconds = seconds % 3600;
  85. int minutes = seconds / 60;
  86. seconds = seconds % 60;
  87. return (
  88. (days ? String(days) + "d " : "") +
  89. (hours ? String(hours) + "h " : "") +
  90. (minutes ? String(minutes) + "m " : "") +
  91. (String(seconds) + "s")
  92. ).c_str();
  93. - platform: wifi_signal
  94. name: "${HumanDeviceName} WiFi RSSI"
  95. id: ${hostname}_wifi_rssi
  96. update_interval: 60s
  97. - platform: pipsolar
  98. pipsolar_id: ${hostname}_inverter0
  99. # QPIRI
  100. # grid_rating_voltage:
  101. # name: "${name} grid_rating_voltage"
  102. # grid_rating_current:
  103. # name: "${HumanDeviceName} grid_rating_current"
  104. # ac_output_rating_voltage:
  105. # name: "${HumanDeviceName} ac_output_rating_voltage"
  106. # ac_output_rating_frequency:
  107. # name: "${HumanDeviceName} ac_output_rating_frequency"
  108. # ac_output_rating_current:
  109. # name: "${HumanDeviceName} ac_output_rating_current"
  110. # ac_output_rating_apparent_power:
  111. # name: "${HumanDeviceName} ac_output_rating_apparent_power"
  112. # ac_output_rating_active_power:
  113. # name: "${HumanDeviceName} ac_output_rating_active_power"
  114. # battery_rating_voltage:
  115. # name: "${HumanDeviceName} battery_rating_voltage"
  116. # battery_recharge_voltage:
  117. # name: "${HumanDeviceName} battery_recharge_voltage"
  118. # battery_under_voltage:
  119. # name: "${HumanDeviceName} battery_under_voltage"
  120. # battery_bulk_voltage:
  121. # name: "${HumanDeviceName} battery_bulk_voltage"
  122. # battery_float_voltage:
  123. # name: "${HumanDeviceName} battery_float_voltage"
  124. # battery_type:
  125. # name: "${HumanDeviceName} battery_type"
  126. # current_max_ac_charging_current:
  127. # name: "${HumanDeviceName} current_max_ac_charging_current"
  128. # current_max_charging_current:
  129. # name: "${HumanDeviceName} current_max_charging_current"
  130. # input_voltage_range:
  131. # name: "${HumanDeviceName} input_voltage_range"
  132. # output_source_priority:
  133. # name: "${HumanDeviceName} output_source_priority"
  134. # charger_source_priority:
  135. # name: "${HumanDeviceName} charger_source_priority"
  136. # parallel_max_num:
  137. # name: "${HumanDeviceName} parallel_max_num"
  138. # machine_type:
  139. # name: "${HumanDeviceName} machine_type"
  140. # topology:
  141. # name: "${HumanDeviceName} topology"
  142. # output_mode:
  143. # name: "${HumanDeviceName} output_mode"
  144. # battery_redischarge_voltage:
  145. # name: "${HumanDeviceName} battery_redischarge_voltage"
  146. # pv_ok_condition_for_parallel:
  147. # name: "${HumanDeviceName} pv_ok_condition_for_parallel"
  148. # pv_power_balance:
  149. # name: "${HumanDeviceName} pv_power_balance"
  150.  
  151. # QPIGS
  152. grid_voltage:
  153. id: ${hostname}_grid_voltage
  154. name: "${HumanDeviceName} Grid Voltage"
  155. grid_frequency:
  156. id: ${hostname}_grid_frequency
  157. name: "${HumanDeviceName} Grid Frequency"
  158. ac_output_voltage:
  159. id: ${hostname}_ac_output_voltage
  160. name: "${HumanDeviceName} AC Output Voltage"
  161. ac_output_frequency:
  162. id: ${hostname}_ac_output_frequency
  163. name: "${HumanDeviceName} AC Output Frequency"
  164. ac_output_apparent_power:
  165. id: ${hostname}_ac_output_apparent_power
  166. name: "${HumanDeviceName} AC Output Apparent Power"
  167. ac_output_active_power:
  168. id: ${hostname}_ac_output_active_power
  169. name: "${HumanDeviceName} AC Output Active Power"
  170. output_load_percent:
  171. id: ${hostname}_output_load_percent
  172. name: "${HumanDeviceName} Output Load Percent"
  173. bus_voltage:
  174. id: ${hostname}_bus_voltage
  175. name: "${HumanDeviceName} BUS Voltage"
  176. battery_voltage:
  177. id: ${hostname}_battery_voltage
  178. name: "${HumanDeviceName} Batery Voltave"
  179. battery_charging_current:
  180. id: ${hostname}_battery_charging_current
  181. name: "${HumanDeviceName} Battery Charging Current"
  182. battery_capacity_percent:
  183. id: ${hostname}_battery_capacity_percent
  184. name: "${HumanDeviceName} Battery Capacity Percent"
  185. inverter_heat_sink_temperature:
  186. id: ${hostname}_inverter_heat_sink_temperature
  187. name: "${HumanDeviceName} Inverter Heat Sink Temperature"
  188. pv_input_current_for_battery:
  189. id: ${hostname}_pv_input_current_for_battery
  190. name: "${HumanDeviceName} PV Input Current For Battery"
  191. pv_input_voltage:
  192. id: ${hostname}_pv_input_voltage
  193. name: "${HumanDeviceName} PV Input Voltage"
  194. battery_voltage_scc:
  195. id: ${hostname}_battery_voltage_scc
  196. name: "${HumanDeviceName} Battery Voltage SCC"
  197. battery_discharge_current:
  198. id: ${hostname}_battery_discharge_current
  199. name: "${HumanDeviceName} Battery Discharge Current"
  200. battery_voltage_offset_for_fans_on:
  201. id: ${hostname}_battery_voltage_offset_for_fans_on
  202. name: "${HumanDeviceName} Battery Voltage Offset For Fans On"
  203. # eeprom_version:
  204. # id: ${hostname}_eeprom_version
  205. # name: "${HumanDeviceName} eeprom_version"
  206. pv_charging_power:
  207. id: ${hostname}_pv_charging_power
  208. name: "${HumanDeviceName} PV Charging Power"
  209.  
  210. text_sensor:
  211. - platform: template
  212. name: "${HumanDeviceName} Uptime"
  213. id: ${hostname}_uptime_human
  214. icon: mdi:clock-start
  215. - platform: version
  216. name: "${HumanDeviceName} ESPHome Version"
  217. id: ${hostname}_esphome_version
  218. hide_timestamp: true
  219. - platform: wifi_info
  220. ip_address:
  221. id: ${hostname}_IP
  222. name: "${HumanDeviceName} Endereço IP"
  223. icon: mdi:ip-network
  224. ssid:
  225. id: ${hostname}_SSID
  226. name: "${HumanDeviceName} Rede Wifi"
  227. icon: mdi:wifi
  228. - platform: pipsolar
  229. pipsolar_id: ${hostname}_inverter0
  230. device_mode:
  231. id: ${hostname}_device_mode
  232. name: "${HumanDeviceName} Device Mode"
  233. # last_qpigs:
  234. # name: "${HumanDeviceName} last_qpigs"
  235. # last_qpiri:
  236. # name: "${HumanDeviceName} last_qpiri"
  237. # last_qmod:
  238. # name: "${HumanDeviceName} last_qmod"
  239. # last_qflag:
  240. # name: "${HumanDeviceName} last_qflag"
  241.  
  242. binary_sensor:
  243. - platform: status
  244. id: ${hostname}_status
  245. name: "${HumanDeviceName} Status"
  246. device_class: connectivity
  247. - platform: pipsolar
  248. pipsolar_id: ${hostname}_inverter0
  249. add_sbu_priority_version:
  250. id: ${hostname}_add_sbu_priority_version
  251. name: "${HumanDeviceName} ADD SBU Priority Version"
  252. configuration_status:
  253. id: ${hostname}_configuration_status
  254. name: "${HumanDeviceName} Configuration Status"
  255. # scc_firmware_version:
  256. # id: ${hostname}_scc_firmware_version
  257. # name: "${HumanDeviceName} scc_firmware_version"
  258. load_status:
  259. id: ${hostname}_load_status
  260. name: "${HumanDeviceName} Load Status"
  261. battery_voltage_to_steady_while_charging:
  262. id: ${hostname}_battery_voltage_to_steady_while_charging
  263. name: "${HumanDeviceName} Battery Voltage To Steady While Charging"
  264. charging_status:
  265. id: ${hostname}_charging_status
  266. name: "${HumanDeviceName} Charging Status"
  267. scc_charging_status:
  268. id: ${hostname}_scc_charging_status
  269. name: "${HumanDeviceName} SCC Charging Status"
  270. ac_charging_status:
  271. id: ${hostname}_ac_charging_status
  272. name: "${HumanDeviceName} AC Charging Status"
  273. charging_to_floating_mode:
  274. id: ${hostname}_charging_to_floating_mode
  275. name: "${HumanDeviceName} Charging To Floating Mode"
  276. switch_on:
  277. id: ${hostname}_switch_on
  278. name: "${HumanDeviceName} switch_on"
  279. # dustproof_installed:
  280. # id: ${hostname}_dustproof_installed
  281. # name: "${HumanDeviceName} dustproof_installed"
  282. silence_buzzer_open_buzzer:
  283. id: ${hostname}_silence_buzzer_open_buzzer
  284. name: "${HumanDeviceName} Silence Buzzer Open Buzzer"
  285. overload_bypass_function:
  286. id: ${hostname}_overload_bypass_function
  287. name: "${HumanDeviceName} Overload Bypass Function"
  288. lcd_escape_to_default:
  289. id: ${hostname}_lcd_escape_to_default
  290. name: "${HumanDeviceName} LCD Escape To Default"
  291. overload_restart_function:
  292. id: ${hostname}_overload_restart_function
  293. name: "${HumanDeviceName} Overload Restart Function"
  294. over_temperature_restart_function:
  295. id: ${hostname}_over_temperature_restart_function
  296. name: "${HumanDeviceName} Over Temperature Restart Function"
  297. # backlight_on:
  298. # id: ${hostname}_
  299. # name: "${HumanDeviceName} backlight_on"
  300.  
  301. switch:
  302. - platform: pipsolar
  303. pipsolar_id: ${hostname}_inverter0
  304. output_source_priority_utility:
  305. id: ${hostname}_output_source_priority_utility
  306. name: "${HumanDeviceName} Output Source Priority Utility"
  307. output_source_priority_solar:
  308. id: ${hostname}_output_source_priority_solar
  309. name: "${HumanDeviceName} Output Source Priority Solar"
  310. output_source_priority_battery:
  311. id: ${hostname}_output_source_priority_battery
  312. name: "${HumanDeviceName} Output Source Priority Battery"
  313. input_voltage_range:
  314. id: ${hostname}_input_voltage_range
  315. name: "${HumanDeviceName} Input VOltage Range"
  316. pv_ok_condition_for_parallel:
  317. id: ${hostname}_pv_ok_condition_for_parallel
  318. name: "${HumanDeviceName} PV Ok Condition For Parallel"
  319. pv_power_balance:
  320. id: ${hostname}_pv_power_balance
  321. name: "${HumanDeviceName} PV Power Balance"
  322.  
  323. output:
  324. - platform: pipsolar
  325. pipsolar_id: ${hostname}_inverter0
  326. battery_recharge_voltage:
  327. id: ${hostname}_inverter0_battery_recharge_voltage_out
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement