Como “leitor” seguir um tutorial da EDPBOX.
Quanto ao inversor:
Usar o pin 3 e 4 na ficha
No tasmota usar o seguinte script:
>D
time=""
date=""
wfc=""
wfp=0
cnt=0
>B
=>Delay 100
=>Delay 100
=>Delay 100
tper=31
smlj=0
=>Delay 100
=>SerialLog 0
=>WifiConfig
=>WifiPower
=>Delay 100
=>Sensor53 r
>E
wfc=WifiConfig#?
wfp=WifiPower
>S
time=st(tstamp T 2)
date=st(tstamp T 1)
if cnt==40
then
smlj=1
tper=15
=>UfsRun discovery.txt
endif
if cnt<99
then
cnt+=1
endif
>W
@<b>NTP </b> %date% %time%
@<b>Vars </b> cnt=%0cnt% tper=%0tper% smlj=%0smlj%
@<b>Wifi </b> %wfc% <b> Power </b> %0wfp% <b> Topic </b> %topic%
@<br>
; inverter growatt
>M 1
; esp32 19/18 (hardware serial)
; esp8266 3/1 (hardware serial)
; change to your gpios and mode
; power off is required
; v v v
+1,3,mN1,1,9600,PV1,1,15,r010400000002,r010400370002
; 0x0000
1,010404xxuu@i0:1,Inverter Status,,*,0
; 55-56 0x0037
1,010404UUuuUUuu@i1:10,Total Energy,kWh,PV_Energy,1
; eof meter
#
; eof script 14:57
Discovery personalizado:
Criar um ficheiro discovery.txt no ufs file manager com:
; switch
Publish2 homeassistant/switch/nikito7-PV1/restart/config {"name":"PV1 ESP Restart","unique_id":"PV1_ESP_Switch","command_topic":"cmnd/pv1/restart","payload_on":"1","payload_off":"1","icon":"mdi:restart","device":{"identifiers":"nikito7-PV1","name":"PV1","model":"Easy HAN RS485","manufacturer":"nikito7"}}
; sensor
; esp
Publish2 homeassistant/sensor/nikito7-PV1/uptime/config {"name":"PV1 ESP Uptime","unique_id":"PV1_ESP_Uptime","state_topic":"tele/pv1/STATE","value_template":"{{ ( value_json.UptimeSec / 3600 ) | round(1) }}","unit_of_measurement":"h","icon":"mdi:alarm","availability_topic":"tele/pv1/LWT","payload_available":"Online","payload_not_available":"Offline","device":{"identifiers":"nikito7-PV1","name":"PV1","model":"Easy HAN RS485","manufacturer":"nikito7"}}
Publish2 homeassistant/sensor/nikito7-PV1/freeheap/config {"name":"PV1 ESP Free Heap","unique_id":"PV1_ESP_Heap","state_topic":"tele/pv1/STATE","value_template":"{{ value_json.Heap }}","unit_of_measurement":"kB","icon":"mdi:chip","device":{"identifiers":"nikito7-PV1","name":"PV1","model":"Easy HAN RS485","manufacturer":"nikito7"}}
Publish2 homeassistant/sensor/nikito7-PV1/signal/config {"name":"PV1 ESP Signal","unique_id":"PV1_ESP_Signal","state_topic":"tele/pv1/STATE","value_template":"{{ value_json.Wifi.Signal }}","unit_of_measurement":"dB","device_class":"signal_strength","device":{"identifiers":"nikito7-PV1","name":"PV1","model":"Easy HAN RS485","manufacturer":"nikito7"}}
Publish2 homeassistant/sensor/nikito7-PV1/vcc/config {"name":"PV1 ESP Vcc","unique_id":"PV1_ESP_Vcc","state_topic":"tele/pv1/STATE","value_template":"{{ value_json.Vcc|float(0.000) }}","unit_of_measurement":"V","device_class":"voltage","state_class":"measurement","device":{"identifiers":"nikito7-PV1","name":"PV1","model":"Easy HAN RS485","manufacturer":"nikito7"}}
; PV Total kWh
Publish2 homeassistant/sensor/nikito7-PV1/totalkwh/config {"name":"PV1 Total Energy","unique_id":"PV1_TotEne","state_topic":"tele/pv1/SENSOR","value_template":"{%% set x = value_json.PV1.PV_Energy|float(0) %%} {%% if x > 0 %%} {{ x }} {%% endif %%}","unit_of_measurement":"kWh","device_class":"energy","state_class":"total_increasing","device":{"identifiers":"nikito7-PV1","name":"PV1","model":"Easy HAN RS485","manufacturer":"nikito7"}}
; eof
Isto é apenas o básico, o suficiente para adicionar ao Energy do Home Assistant.
Manual de registers: