Advertisement
Guest User

Solar ESPhome Yaml

a guest
Apr 7th, 2023
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.19 KB | None | 0 0
  1.  
  2. esphome:
  3. name: solar
  4. comment: Fornus
  5. project:
  6. name: "syssi.esphome-smg-ii"
  7. version: 1.0.0
  8.  
  9. esp32:
  10. board: nodemcu-32s
  11. framework:
  12. type: esp-idf
  13.  
  14.  
  15. ota:
  16. password: "63fefd787b8be7dd03612a0abec2e5f9"
  17.  
  18. # Enable logging
  19. logger:
  20. #hardware_uart: UART2
  21. level: verbose
  22.  
  23. # Enable Home Assistant API
  24. api:
  25.  
  26. wifi:
  27. ssid: "dlink 2g"
  28. password: abc123
  29.  
  30. manual_ip:
  31. static_ip: 198.42.12.119
  32. gateway: 198.42.12.1
  33. subnet: 255.255.255.0
  34. dns1: 198.42.12.1
  35.  
  36. # Enable fallback hotspot (captive portal) in case wifi connection fails
  37. ap:
  38. ssid: "Solar Inverter"
  39. password: abc123
  40.  
  41. #mqtt:
  42. # broker: 198.42.11.101
  43. # username: mqtt-user
  44. # password: Qwerty123
  45. # id: solar
  46.  
  47.  
  48. substitutions:
  49. name: smg-ii
  50. device_description: "Monitor and control a ISolar/EASUN SMG II inverter via RS232"
  51. tx_pin: GPIO17
  52. rx_pin: GPIO16
  53.  
  54.  
  55. uart:
  56. - id: uart2
  57. baud_rate: 9600
  58. tx_pin: ${tx_pin}
  59. rx_pin: ${rx_pin}
  60. debug:
  61. direction: BOTH
  62. dummy_receiver: false
  63.  
  64. modbus:
  65. - id: modbus0
  66. send_wait_time: 200ms
  67.  
  68. modbus_controller:
  69. - id: smg0
  70. address: 0x01
  71. modbus_id: modbus0
  72. command_throttle: 200ms
  73. update_interval: 10s
  74.  
  75. time:
  76. - platform: sntp
  77.  
  78. sensor:
  79. - platform: total_daily_energy
  80. name: "${name} PV energy today"
  81. restore: true
  82. icon: mdi:counter
  83. power_id: smg0_pv_average_power
  84. filters:
  85. # Multiplication factor from W to kW is 0.001
  86. - multiply: 0.001
  87. unit_of_measurement: kWh
  88.  
  89. # Fault code ULong 100 2 R
  90. - platform: modbus_controller
  91. modbus_controller_id: smg0
  92. name: "${name} fault code"
  93. address: 100
  94. register_type: holding
  95. value_type: U_DWORD
  96. accuracy_decimals: 0
  97.  
  98. # Warning code ULong 108 2 R
  99. - platform: modbus_controller
  100. modbus_controller_id: smg0
  101. name: "${name} warning code"
  102. address: 108
  103. register_type: holding
  104. value_type: U_DWORD
  105. accuracy_decimals: 0
  106.  
  107. # Operation Mode UInt 201 1 R 0: Power On
  108. # 1: Standby
  109. # 2: Mains
  110. # 3: Off-Grid
  111. # 4: Bypass
  112. # 5: Charging
  113. # 6: Fault
  114. - platform: modbus_controller
  115. modbus_controller_id: smg0
  116. name: "${name} operation mode id"
  117. address: 201
  118. register_type: holding
  119. value_type: U_WORD
  120. accuracy_decimals: 0
  121.  
  122. # Effective mains voltage 0.1V Int 202 1 R
  123. - platform: modbus_controller
  124. modbus_controller_id: smg0
  125. name: "${name} ac voltage"
  126. address: 202
  127. register_type: holding
  128. value_type: S_WORD
  129. unit_of_measurement: "V"
  130. device_class: voltage
  131. state_class: measurement
  132. accuracy_decimals: 1
  133. filters:
  134. - multiply: 0.1
  135.  
  136. # Mains Frequency 0.01Hz Int 203 1 R
  137. - platform: modbus_controller
  138. modbus_controller_id: smg0
  139. name: "${name} ac frequency"
  140. address: 203
  141. register_type: holding
  142. value_type: S_WORD
  143. unit_of_measurement: "Hz"
  144. device_class: frequency
  145. state_class: measurement
  146. accuracy_decimals: 2
  147. filters:
  148. - multiply: 0.01
  149.  
  150. # Average mains power 1W Int 204 1 R
  151. - platform: modbus_controller
  152. modbus_controller_id: smg0
  153. name: "${name} average mains power"
  154. address: 204
  155. register_type: holding
  156. value_type: S_WORD
  157. unit_of_measurement: "W"
  158. device_class: power
  159. state_class: measurement
  160. accuracy_decimals: 0
  161.  
  162. # Effective inverter voltage 0.1V Int 205 1 R
  163. - platform: modbus_controller
  164. modbus_controller_id: smg0
  165. name: "${name} effective inverter voltage"
  166. address: 205
  167. register_type: holding
  168. value_type: S_WORD
  169. unit_of_measurement: "V"
  170. device_class: voltage
  171. state_class: measurement
  172. accuracy_decimals: 1
  173. filters:
  174. - multiply: 0.1
  175.  
  176. # Effective inverter current 0.1A Int 206 1 R
  177. - platform: modbus_controller
  178. modbus_controller_id: smg0
  179. name: "${name} effective inverter current"
  180. address: 206
  181. register_type: holding
  182. value_type: S_WORD
  183. unit_of_measurement: "A"
  184. device_class: current
  185. state_class: measurement
  186. accuracy_decimals: 1
  187. filters:
  188. - multiply: 0.1
  189.  
  190. # Inverter frequency 0.01Hz Int 207 1 R
  191. - platform: modbus_controller
  192. modbus_controller_id: smg0
  193. name: "${name} inverter frequency"
  194. address: 207
  195. register_type: holding
  196. value_type: S_WORD
  197. unit_of_measurement: "Hz"
  198. device_class: frequency
  199. state_class: measurement
  200. accuracy_decimals: 2
  201. filters:
  202. - multiply: 0.01
  203.  
  204. # Average inverter power 1W Int 208 1 R Positive numbers indicate inverter output, negative numbers indicate inverter input
  205. - platform: modbus_controller
  206. modbus_controller_id: smg0
  207. name: "${name} average inverter power"
  208. address: 208
  209. register_type: holding
  210. value_type: S_WORD
  211. unit_of_measurement: "W"
  212. device_class: power
  213. state_class: measurement
  214. accuracy_decimals: 0
  215.  
  216. # Inverter charging power 1W Int 209 1 R
  217. - platform: modbus_controller
  218. modbus_controller_id: smg0
  219. name: "${name} inverter charging power"
  220. address: 209
  221. register_type: holding
  222. value_type: S_WORD
  223. unit_of_measurement: "W"
  224. device_class: power
  225. state_class: measurement
  226. accuracy_decimals: 0
  227.  
  228. # Output effective voltage 0.1V Int 210 1 R
  229. - platform: modbus_controller
  230. modbus_controller_id: smg0
  231. name: "${name} output effective voltage"
  232. address: 210
  233. register_type: holding
  234. value_type: S_WORD
  235. unit_of_measurement: "V"
  236. device_class: voltage
  237. state_class: measurement
  238. accuracy_decimals: 1
  239. filters:
  240. - multiply: 0.1
  241.  
  242. # Output effective Current 0.1A Int 211 1 R
  243. - platform: modbus_controller
  244. modbus_controller_id: smg0
  245. name: "${name} output effective Current"
  246. address: 211
  247. register_type: holding
  248. value_type: S_WORD
  249. unit_of_measurement: "A"
  250. device_class: current
  251. state_class: measurement
  252. accuracy_decimals: 1
  253. filters:
  254. - multiply: 0.1
  255.  
  256. # Output frequency 0.01Hz Int 212 1 R
  257. - platform: modbus_controller
  258. modbus_controller_id: smg0
  259. name: "${name} output frequency"
  260. address: 212
  261. register_type: holding
  262. value_type: S_WORD
  263. unit_of_measurement: "Hz"
  264. device_class: frequency
  265. state_class: measurement
  266. accuracy_decimals: 2
  267. filters:
  268. - multiply: 0.01
  269.  
  270. # Output active power 1W Int 213 1 R
  271. - platform: modbus_controller
  272. modbus_controller_id: smg0
  273. name: "${name} output active power"
  274. address: 213
  275. register_type: holding
  276. value_type: S_WORD
  277. unit_of_measurement: "W"
  278. device_class: power
  279. state_class: measurement
  280. accuracy_decimals: 0
  281.  
  282. # Output apparent power 1VA Int 214 1 R
  283. - platform: modbus_controller
  284. modbus_controller_id: smg0
  285. name: "${name} output apparent power"
  286. address: 214
  287. register_type: holding
  288. value_type: S_WORD
  289. unit_of_measurement: "VA"
  290. device_class: apparent_power
  291. state_class: measurement
  292. accuracy_decimals: 0
  293.  
  294. # Battery average voltage 0.1V Int 215 1 R
  295. - platform: modbus_controller
  296. modbus_controller_id: smg0
  297. name: "${name} battery average voltage"
  298. address: 215
  299. register_type: holding
  300. value_type: S_WORD
  301. unit_of_measurement: "V"
  302. device_class: voltage
  303. state_class: measurement
  304. accuracy_decimals: 1
  305. filters:
  306. - multiply: 0.1
  307.  
  308. # Battery average Current 0.1A Int 216 1 R
  309. - platform: modbus_controller
  310. modbus_controller_id: smg0
  311. name: "${name} battery average Current"
  312. address: 216
  313. register_type: holding
  314. value_type: S_WORD
  315. unit_of_measurement: "A"
  316. device_class: current
  317. state_class: measurement
  318. accuracy_decimals: 1
  319. filters:
  320. - multiply: 0.1
  321.  
  322. # Battery average power 1W Int 217 1 R
  323. - platform: modbus_controller
  324. modbus_controller_id: smg0
  325. name: "${name} battery average power"
  326. address: 217
  327. register_type: holding
  328. value_type: S_WORD
  329. unit_of_measurement: "W"
  330. device_class: power
  331. state_class: measurement
  332. accuracy_decimals: 0
  333.  
  334. # PV average voltage 0.1V Int 219 1 R
  335. - platform: modbus_controller
  336. modbus_controller_id: smg0
  337. name: "${name} pv average voltage"
  338. address: 219
  339. register_type: holding
  340. value_type: S_WORD
  341. unit_of_measurement: "V"
  342. device_class: voltage
  343. state_class: measurement
  344. accuracy_decimals: 1
  345. filters:
  346. - multiply: 0.1
  347.  
  348. # PV average current 0.1A Int 220 1 R
  349. - platform: modbus_controller
  350. modbus_controller_id: smg0
  351. name: "${name} pv average current"
  352. address: 220
  353. register_type: holding
  354. value_type: S_WORD
  355. unit_of_measurement: "A"
  356. device_class: current
  357. state_class: measurement
  358. accuracy_decimals: 1
  359. filters:
  360. - multiply: 0.1
  361.  
  362. # PV average power 1W Int 223 1 R
  363. - platform: modbus_controller
  364. modbus_controller_id: smg0
  365. id: smg0_pv_average_power
  366. name: "${name} pv average power"
  367. address: 223
  368. register_type: holding
  369. value_type: S_WORD
  370. unit_of_measurement: "W"
  371. device_class: power
  372. state_class: measurement
  373. accuracy_decimals: 0
  374.  
  375. # PV charging average power 1W Int 224 1 R
  376. - platform: modbus_controller
  377. modbus_controller_id: smg0
  378. name: "${name} pv charging average power"
  379. address: 224
  380. register_type: holding
  381. value_type: S_WORD
  382. unit_of_measurement: "W"
  383. device_class: power
  384. state_class: measurement
  385. accuracy_decimals: 0
  386.  
  387. # Load percentage 1% Int 225 1 R
  388. - platform: modbus_controller
  389. modbus_controller_id: smg0
  390. name: "${name} load percentage"
  391. address: 225
  392. register_type: holding
  393. value_type: S_WORD
  394. unit_of_measurement: "%"
  395. # device_class: battery
  396. state_class: measurement
  397. accuracy_decimals: 0
  398.  
  399. # DCDC Temperature 1°C Int 226 1 R
  400. - platform: modbus_controller
  401. modbus_controller_id: smg0
  402. name: "${name} dcdc temperature"
  403. address: 226
  404. register_type: holding
  405. value_type: S_WORD
  406. unit_of_measurement: "°C"
  407. device_class: temperature
  408. state_class: measurement
  409. accuracy_decimals: 0
  410.  
  411. # Inverter Temperature 1°C Int 227 1 R
  412. - platform: modbus_controller
  413. modbus_controller_id: smg0
  414. name: "${name} inverter temperature"
  415. address: 227
  416. register_type: holding
  417. value_type: S_WORD
  418. unit_of_measurement: "°C"
  419. device_class: temperature
  420. state_class: measurement
  421. accuracy_decimals: 0
  422.  
  423. # Battery state of charge 1% UInt 229 1 R
  424. - platform: modbus_controller
  425. modbus_controller_id: smg0
  426. name: "${name} battery state of charge"
  427. address: 229
  428. register_type: holding
  429. value_type: U_WORD
  430. unit_of_measurement: "%"
  431. device_class: battery
  432. state_class: measurement
  433. accuracy_decimals: 0
  434.  
  435. # Battery average current 0.1A Int 232 1 R Positive number means charging, negative number means discharging
  436. - platform: modbus_controller
  437. modbus_controller_id: smg0
  438. name: "${name} battery average current"
  439. address: 232
  440. register_type: holding
  441. value_type: S_WORD
  442. unit_of_measurement: "A"
  443. device_class: current
  444. state_class: measurement
  445. accuracy_decimals: 1
  446. filters:
  447. - multiply: 0.1
  448.  
  449. # Inverter charging average current 0.1A Int 233 1 R
  450. - platform: modbus_controller
  451. modbus_controller_id: smg0
  452. name: "${name} inverter charging average current"
  453. address: 233
  454. register_type: holding
  455. value_type: S_WORD
  456. unit_of_measurement: "A"
  457. device_class: current
  458. state_class: measurement
  459. accuracy_decimals: 1
  460. filters:
  461. - multiply: 0.1
  462.  
  463. # PV charging average current 0.1A Int 234 1 R
  464. - platform: modbus_controller
  465. modbus_controller_id: smg0
  466. name: "${name} pv charging average current"
  467. address: 234
  468. register_type: holding
  469. value_type: S_WORD
  470. unit_of_measurement: "A"
  471. device_class: current
  472. state_class: measurement
  473. accuracy_decimals: 1
  474. filters:
  475. - multiply: 0.1
  476.  
  477. # Output voltage 0.1V Uint 320 1 R/W
  478. - platform: modbus_controller
  479. modbus_controller_id: smg0
  480. name: "${name} output voltage"
  481. address: 320
  482. register_type: holding
  483. value_type: U_WORD
  484. unit_of_measurement: "V"
  485. device_class: voltage
  486. # state_class: measurement
  487. accuracy_decimals: 1
  488. filters:
  489. - multiply: 0.1
  490.  
  491. # Output frequency setting 0.01Hz Uint 321 1 R/W
  492. - platform: modbus_controller
  493. modbus_controller_id: smg0
  494. name: "${name} output frequency setting"
  495. address: 321
  496. register_type: holding
  497. value_type: U_WORD
  498. unit_of_measurement: "Hz"
  499. device_class: frequency
  500. # state_class: measurement
  501. accuracy_decimals: 2
  502. filters:
  503. - multiply: 0.01
  504.  
  505. # Battery overvoltage protection point 0.1V Uint 323 1 R/W
  506. - platform: modbus_controller
  507. modbus_controller_id: smg0
  508. name: "${name} battery overvoltage protection point"
  509. address: 323
  510. register_type: holding
  511. value_type: U_WORD
  512. unit_of_measurement: "V"
  513. device_class: voltage
  514. # state_class: measurement
  515. accuracy_decimals: 1
  516. filters:
  517. - multiply: 0.1
  518.  
  519. # Max charging voltage 0.1V Uint 324 1 R/W
  520. - platform: modbus_controller
  521. modbus_controller_id: smg0
  522. name: "${name} max charging voltage"
  523. address: 324
  524. register_type: holding
  525. value_type: U_WORD
  526. unit_of_measurement: "V"
  527. device_class: voltage
  528. # state_class: measurement
  529. accuracy_decimals: 1
  530. filters:
  531. - multiply: 0.1
  532.  
  533. # Floating charging voltage 0.1V Uint 325 1 R/W
  534. - platform: modbus_controller
  535. modbus_controller_id: smg0
  536. name: "${name} floating charging voltage"
  537. address: 325
  538. register_type: holding
  539. value_type: U_WORD
  540. unit_of_measurement: "V"
  541. device_class: voltage
  542. # state_class: measurement
  543. accuracy_decimals: 1
  544. filters:
  545. - multiply: 0.1
  546.  
  547. # Battery discharge recovery point in mains mode 0.1V Uint 326 1 R/W
  548. - platform: modbus_controller
  549. modbus_controller_id: smg0
  550. name: "${name} battery discharge recovery point in mains mode"
  551. address: 326
  552. register_type: holding
  553. value_type: U_WORD
  554. unit_of_measurement: "V"
  555. device_class: voltage
  556. # state_class: measurement
  557. accuracy_decimals: 1
  558. filters:
  559. - multiply: 0.1
  560.  
  561. # Battery low voltage protection point in mains mode 0.1V Uint 327 1 R/W
  562. - platform: modbus_controller
  563. modbus_controller_id: smg0
  564. name: "${name} battery low voltage protection point in mains mode"
  565. address: 327
  566. register_type: holding
  567. value_type: U_WORD
  568. unit_of_measurement: "V"
  569. device_class: voltage
  570. # state_class: measurement
  571. accuracy_decimals: 1
  572. filters:
  573. - multiply: 0.1
  574.  
  575. # Battery low voltage protection point in off-grid mode 0.1V Uint 329 1 R/W
  576. - platform: modbus_controller
  577. modbus_controller_id: smg0
  578. name: "${name} battery low voltage protection point in off-grid mode"
  579. address: 329
  580. register_type: holding
  581. value_type: U_WORD
  582. unit_of_measurement: "V"
  583. device_class: voltage
  584. # state_class: measurement
  585. accuracy_decimals: 1
  586. filters:
  587. - multiply: 0.1
  588.  
  589. # Maximum charging current 0.1A Uint 332 1 R/W
  590. - platform: modbus_controller
  591. modbus_controller_id: smg0
  592. name: "${name} maximum charging current"
  593. address: 332
  594. register_type: holding
  595. value_type: U_WORD
  596. unit_of_measurement: "A"
  597. device_class: current
  598. # state_class: measurement
  599. accuracy_decimals: 1
  600. filters:
  601. - multiply: 0.1
  602.  
  603. # Maximum mains charging current 0.1A Uint 333 1 R/W
  604. - platform: modbus_controller
  605. modbus_controller_id: smg0
  606. name: "${name} maximum mains charging current"
  607. address: 333
  608. register_type: holding
  609. value_type: U_WORD
  610. unit_of_measurement: "A"
  611. device_class: current
  612. # state_class: measurement
  613. accuracy_decimals: 1
  614. filters:
  615. - multiply: 0.1
  616.  
  617. # Eq Charging voltage 0.1V Uint 334 1 R/W
  618. - platform: modbus_controller
  619. modbus_controller_id: smg0
  620. name: "${name} Eq Charging voltage"
  621. address: 334
  622. register_type: holding
  623. value_type: U_WORD
  624. unit_of_measurement: "V"
  625. device_class: voltage
  626. # state_class: measurement
  627. accuracy_decimals: 1
  628. filters:
  629. - multiply: 0.1
  630.  
  631. # Rated power W Uint 643 1 R
  632. - platform: modbus_controller
  633. modbus_controller_id: smg0
  634. name: "${name} rated power"
  635. address: 643
  636. register_type: holding
  637. value_type: U_WORD
  638. unit_of_measurement: "W"
  639. device_class: power
  640. # state_class: measurement
  641. accuracy_decimals: 0
  642.  
  643. select:
  644. # Output Mode Uint 300 1 R/W 0: Single, 1: Parallel, 2: 3 Phase-P1, 3: 3 Phase-P2, 4: 3 Phase-P3
  645. - platform: modbus_controller
  646. modbus_controller_id: smg0
  647. name: "${name} output mode"
  648. use_write_multiple: true
  649. address: 300
  650. value_type: U_WORD
  651. optionsmap:
  652. "Single": 0
  653. "Parallel": 1
  654. "Phase P1": 2
  655. "Phase P2": 3
  656. "Phase P3": 4
  657.  
  658. # Output priority Uint 301 1 R/W 0: Utility-PV-Battery, 1: PV-Utility-Battery, 2: PV-Battery-Utility
  659. - platform: modbus_controller
  660. modbus_controller_id: smg0
  661. name: "${name} output priority"
  662. use_write_multiple: true
  663. address: 301
  664. value_type: U_WORD
  665. optionsmap:
  666. "Utility-PV-Battery (UTI)": 0
  667. "PV-Utility-Battery (SOL)": 1
  668. "PV-Battery-Utility (SBU)": 2
  669. "PV-Utility-Battery (SUB)": 3
  670.  
  671. # Input voltage range Uint 302 1 R/W 0: Wide range, 1: Narrow range
  672. - platform: modbus_controller
  673. modbus_controller_id: smg0
  674. name: "${name} input voltage range"
  675. use_write_multiple: true
  676. address: 302
  677. value_type: U_WORD
  678. optionsmap:
  679. "Wide range": 0
  680. "Narrow range": 1
  681.  
  682. # Buzzer mode Uint 303 1 R/W 0: Mute in all situations, 1: Sound when the input source is changed or there is a specific warning or fault, 2: Sound when there is aspecific warning or fault, 3: Sound when fault occurs
  683. - platform: modbus_controller
  684. modbus_controller_id: smg0
  685. name: "${name} buzzer mode"
  686. use_write_multiple: true
  687. address: 303
  688. value_type: U_WORD
  689. optionsmap:
  690. "Silent": 0
  691. "Beep on input source changes, warnings and faults": 1
  692. "Beep on warnings and faults": 2
  693. "Beep on faults": 3
  694.  
  695. # LCD backlight Uint 305 1 R/W 0: Timed off, 1: Always on
  696. - platform: modbus_controller
  697. modbus_controller_id: smg0
  698. name: "${name} lcd backlight"
  699. use_write_multiple: true
  700. address: 305
  701. value_type: U_WORD
  702. optionsmap:
  703. "Timed off": 0
  704. "Always on": 1
  705.  
  706. # Battery charging priority Uint 331 1 R/W 0: Utility priority, 1: PV priority, 2: PV is at the same level as the Utility, 3: Only PV charging is allowed
  707. - platform: modbus_controller
  708. modbus_controller_id: smg0
  709. name: "${name} battery charging priority"
  710. use_write_multiple: true
  711. address: 331
  712. value_type: U_WORD
  713. optionsmap:
  714. "Utility priority": 0
  715. "PV priority": 1
  716. "PV is at the same level as the Utility": 2
  717. "Only PV charging is allowed": 3
  718.  
  719. # Turn on mode Uint 406 1 R/W 0: Can be turn-on locally or remotely, 1: Only local turn-on, 2: Only remote turn-on
  720. - platform: modbus_controller
  721. modbus_controller_id: smg0
  722. name: "${name} turn on mode"
  723. use_write_multiple: true
  724. address: 406
  725. value_type: U_WORD
  726. optionsmap:
  727. "Local and remotely turn-on allowed": 0
  728. "Local turn-on only": 1
  729. "Remote turn-on only": 2
  730.  
  731. switch:
  732. # LCD automatically returns to the homepage Uint 306 1 R/W 0: Do not return automatically, 1: Automatically return after 1 minute
  733. - platform: modbus_controller
  734. modbus_controller_id: smg0
  735. name: "${name} lcd automatically returns to the homepage"
  736. use_write_multiple: true
  737. address: 306
  738. register_type: holding
  739. bitmask: 1
  740.  
  741. # Energy-saving mode Uint 307 1 R/W 0: Energy-saving mode is off, 1: Energy-saving mode is on
  742. - platform: modbus_controller
  743. modbus_controller_id: smg0
  744. name: "${name} energy-saving mode"
  745. use_write_multiple: true
  746. address: 307
  747. register_type: holding
  748. bitmask: 1
  749.  
  750. # Overload automatic restart Uint 308 1 R/W 0: Overload failure will not restart, 1: Automatic restart after overload failure
  751. - platform: modbus_controller
  752. modbus_controller_id: smg0
  753. name: "${name} overload automatic restart"
  754. use_write_multiple: true
  755. address: 308
  756. register_type: holding
  757. bitmask: 1
  758.  
  759. # Over temperature automatic restart Uint 309 1 R/W 0: Over temperature failure will not restart, 1: Automatic restart after over-temperature fault
  760. - platform: modbus_controller
  761. modbus_controller_id: smg0
  762. name: "${name} over temperature automatic restart"
  763. use_write_multiple: true
  764. address: 309
  765. register_type: holding
  766. bitmask: 1
  767.  
  768. # Overload transfer to bypass enabled Uint 310 1 R/W 0: Disable, 1: Enable
  769. - platform: modbus_controller
  770. modbus_controller_id: smg0
  771. name: "${name} overload transfer to bypass enabled"
  772. use_write_multiple: true
  773. address: 310
  774. register_type: holding
  775. bitmask: 1
  776.  
  777. # Battery Eq mode is enabled Uint 313 1 R/W 0: Disable, 1: Enable
  778. - platform: modbus_controller
  779. modbus_controller_id: smg0
  780. name: "${name} battery Eq mode is enabled"
  781. use_write_multiple: true
  782. address: 313
  783. register_type: holding
  784. bitmask: 1
  785.  
  786. # Remote switch Uint 420 1 R/W 0: Remote shutdown, 1: Remote turn-on
  787. - platform: modbus_controller
  788. modbus_controller_id: smg0
  789. name: "${name} remote switch"
  790. use_write_multiple: true
  791. address: 420
  792. register_type: holding
  793. bitmask: 1
  794.  
  795. text_sensor:
  796. # Fault code ULong 100 2 R
  797. - platform: modbus_controller
  798. modbus_controller_id: smg0
  799. name: "${name} fault"
  800. address: 100
  801. register_type: holding
  802. register_count: 2
  803. response_size: 4
  804. raw_encode: HEXBYTES
  805. lambda: |-
  806. static const uint8_t FAULTS_SIZE = 27;
  807. static const char *const FAULTS[FAULTS_SIZE] = {
  808. "Over temperature of inverter module", // 0000 0000 0000 0000 0000 0000 0000 0001 (1)
  809. "Over temperature of DCDC module", // 0000 0000 0000 0000 0000 0000 0000 0010 (2)
  810. "Battery over voltage", // 0000 0000 0000 0000 0000 0000 0000 0100 (3)
  811. "PV module over temperature", // 0000 0000 0000 0000 0000 0000 0000 1000 (4)
  812. "Output short circuit", // 0000 0000 0000 0000 0000 0000 0001 0000 (5)
  813. "Inverter over voltage", // 0000 0000 0000 0000 0000 0000 0010 0000 (6)
  814. "Output over load", // 0000 0000 0000 0000 0000 0000 0100 0000 (7)
  815. "Bus over voltage", // 0000 0000 0000 0000 0000 0000 1000 0000 (8)
  816. "Bus soft start timed out", // 0000 0000 0000 0000 0000 0001 0000 0000 (9)
  817. "PV over current", // 0000 0000 0000 0000 0000 0010 0000 0000 (10)
  818. "PV over voltage", // 0000 0000 0000 0000 0000 0100 0000 0000 (11)
  819. "Battery over current", // 0000 0000 0000 0000 0000 1000 0000 0000 (12)
  820. "Inverter over current", // 0000 0000 0000 0000 0001 0000 0000 0000 (13)
  821. "Bus low voltage", // 0000 0000 0000 0000 0010 0000 0000 0000 (14)
  822. "Reserve (Bit 15)", // 0000 0000 0000 0000 0100 0000 0000 0000 (15)
  823. "Inverter DC component is too high", // 0000 0000 0000 0000 1000 0000 0000 0000 (16)
  824. "Reserve (Bit 17)", // 0000 0000 0000 0001 0000 0000 0000 0000 (17)
  825. "The zero bias of output current is too large", // 0000 0000 0000 0010 0000 0000 0000 0000 (18)
  826. "The zero bias of inverter current is too large", // 0000 0000 0000 0100 0000 0000 0000 0000 (19)
  827. "The zero bias of battery current is too large", // 0000 0000 0000 1000 0000 0000 0000 0000 (20)
  828. "The zero bias of PV current is too large", // 0000 0000 0001 0000 0000 0000 0000 0000 (21)
  829. "Inverter low voltage", // 0000 0000 0010 0000 0000 0000 0000 0000 (22)
  830. "Inverter negative power protection", // 0000 0000 0100 0000 0000 0000 0000 0000 (23)
  831. "The host in the parallel system is lost", // 0000 0000 1000 0000 0000 0000 0000 0000 (24)
  832. "Synchronization signal abnormal in the parallel system", // 0000 0001 0000 0000 0000 0000 0000 0000 (25)
  833. "The battery type is incompatible", // 0000 0010 0000 0000 0000 0000 0000 0000 (26)
  834. "Parallel versions are incompatible", // 0000 0100 0000 0000 0000 0000 0000 0000 (27)
  835. };
  836. std::string values = "";
  837.  
  838. uint32_t mask = modbus_controller::dword_from_hex_str(x, 0);
  839. if (mask) {
  840. for (int i = 0; i < FAULTS_SIZE; i++) {
  841. if (mask & (1 << i)) {
  842. values.append(FAULTS[i]);
  843. values.append(";");
  844. }
  845. }
  846. if (!values.empty()) {
  847. values.pop_back();
  848. }
  849. }
  850. return values;
  851.  
  852. # Warning code ULong 108 2 R
  853. - platform: modbus_controller
  854. modbus_controller_id: smg0
  855. name: "${name} fault"
  856. address: 100
  857. register_type: holding
  858. register_count: 2
  859. response_size: 4
  860. raw_encode: HEXBYTES
  861. lambda: |-
  862. static const uint8_t WARNINGS_SIZE = 19;
  863. static const char *const WARNINGS[WARNINGS_SIZE] = {
  864. "Reserve (Bit 0)", // 0000 0000 0000 0000 0000 0000 0000 0001 (1)
  865. "Mains waveform abnormal", // 0000 0000 0000 0000 0000 0000 0000 0010 (2)
  866. "Reserve (Bit 2)", // 0000 0000 0000 0000 0000 0000 0000 0100 (3)
  867. "Mains low voltage", // 0000 0000 0000 0000 0000 0000 0000 1000 (4)
  868. "Mains over frequency", // 0000 0000 0000 0000 0000 0000 0001 0000 (5)
  869. "Mains low frequency", // 0000 0000 0000 0000 0000 0000 0010 0000 (6)
  870. "PV low voltage", // 0000 0000 0000 0000 0000 0000 0100 0000 (7)
  871. "Over temperature", // 0000 0000 0000 0000 0000 0000 1000 0000 (8)
  872. "Battery low voltage", // 0000 0000 0000 0000 0000 0001 0000 0000 (9)
  873. "Battery is not connected", // 0000 0000 0000 0000 0000 0010 0000 0000 (10)
  874. "Overload", // 0000 0000 0000 0000 0000 0100 0000 0000 (11)
  875. "Battery Eq charging", // 0000 0000 0000 0000 0000 1000 0000 0000 (12)
  876. "Battery undervoltage", // 0000 0000 0000 0000 0001 0000 0000 0000 (13)
  877. "Output power derating", // 0000 0000 0000 0000 0010 0000 0000 0000 (14)
  878. "Fan blocked", // 0000 0000 0000 0000 0100 0000 0000 0000 (15)
  879. "PV energy is too low to be use", // 0000 0000 0000 0000 1000 0000 0000 0000 (16)
  880. "Parallel communication interrupted", // 0000 0000 0000 0001 0000 0000 0000 0000 (17)
  881. "Output mode of Single and Parallel systems inconsistent", // 0000 0000 0000 0010 0000 0000 0000 0000 (18)
  882. "Battery voltage difference of parallel system is too large", // 0000 0000 0000 0100 0000 0000 0000 0000 (19)
  883. };
  884. std::string values = "";
  885.  
  886. uint32_t mask = modbus_controller::dword_from_hex_str(x, 0);
  887. if (mask) {
  888. for (int i = 0; i < WARNINGS_SIZE; i++) {
  889. if (mask & (1 << i)) {
  890. values.append(WARNINGS[i]);
  891. values.append(";");
  892. }
  893. }
  894. if (!values.empty()) {
  895. values.pop_back();
  896. }
  897. }
  898. return values;
  899.  
  900. # Operation Mode UInt 201 1 R 0: Power On, 1: Standby, 2: Mains, 3: Off-Grid, 4: Bypass, 5: Charging, 6: Fault
  901. - platform: modbus_controller
  902. modbus_controller_id: smg0
  903. name: "${name} operation mode"
  904. address: 201
  905. register_type: holding
  906. raw_encode: HEXBYTES
  907. lambda: |-
  908. uint16_t value = modbus_controller::word_from_hex_str(x, 0);
  909. switch (value) {
  910. case 0: return std::string("Power On");
  911. case 1: return std::string("Standby");
  912. case 2: return std::string("Mains");
  913. case 3: return std::string("Off-Grid");
  914. case 4: return std::string("Bypass");
  915. case 5: return std::string("Charging");
  916. case 6: return std::string("Fault");
  917. }
  918. return std::string("Unknown");
  919.  
  920. number:
  921. # Battery equalization time min Uint 335 1 R/W Range: 0~900
  922. - platform: modbus_controller
  923. modbus_controller_id: smg0
  924. name: "${name} battery equalization time"
  925. use_write_multiple: true
  926. address: 335
  927. register_type: holding
  928. value_type: U_WORD
  929. min_value: 0.0
  930. max_value: 900.0
  931. step: 1
  932. unit_of_measurement: "min"
  933.  
  934. # Equalization Timeout exit min Uint 336 1 R/W Range: 0~900
  935. - platform: modbus_controller
  936. modbus_controller_id: smg0
  937. name: "${name} equalization Timeout exit"
  938. use_write_multiple: true
  939. address: 336
  940. register_type: holding
  941. value_type: U_WORD
  942. min_value: 0.0
  943. max_value: 900.0
  944. step: 1
  945. unit_of_measurement: "min"
  946.  
  947. # Two equalization charging intervals day Uint 337 1 R/W Range: 1~90
  948. - platform: modbus_controller
  949. modbus_controller_id: smg0
  950. name: "${name} two equalization charging intervals"
  951. use_write_multiple: true
  952. address: 337
  953. register_type: holding
  954. value_type: U_WORD
  955. min_value: 0.0
  956. max_value: 90.0
  957. step: 1
  958. unit_of_measurement: "day"
  959.  
  960. # Button entities
  961.  
  962. # Exit the fault mode Uint 426 W 1: Exit the fault state(only when the inverter enters the fault mode , it could be available)
  963.  
  964. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement