Integrating SRNE MPPT Inverter with HA

solved


Baud Rate 9600 and everything go well

Hi Mattie
I have a question.
How did you setup energy dashboard? I mean battery storage. SRNE inverter doesnā€™t give data in kWh. Mathematic is simple but I donā€™t know how to setup it in HA:(

Hi! You were right about the colors, my bad. Actually I think I have them the other way around, I dont really think it matters? I tried a lot in the beginning when I didnt get any data so I guess I just left them as that when it finally worked.

As for the energy dashboard I got influx and grafana if you wanna go and do those handsome graphs.

And in hassio I have been testing out different calculations for my template sensors, Iā€™m sticking with these at the moment, the battery charge/discharge actually seems pretty acurate even tho I use a non changing 24.8 for voltage, I have been thinking about making an input_number that gets populated by the current voltage every hour to make these calculations instead in the future:

      inverter_overhead_daily:
        friendly_name: Inverter Overhead
        device_class: energy
        unit_of_measurement: 'kWh'
        value_template: >
          {{ (states('sensor.daily_inverter_ac') | float(0) + states('sensor.inverter_battery_discharge_ah_daily') | float(0) - states('sensor.inverter_battery_charge_ah_daily') | float(0) - states('sensor.daily_energy_ac') | float(0) - states('sensor.daily_soluttag_energy') | float(0) - states('sensor.daily_studioserver_energy') | float(0)) | round(1) }}

      inverter_battery_charge_ah_daily:
        friendly_name: Batteri laddat idag
        device_class: energy
        unit_of_measurement: 'kWh'
        icon_template: mdi:battery-high
        value_template: >
          {{ (states('sensor.daily_inverter_battery_charge_ah') | float(0) * 27.8 / 1000 | float) | round(2) }}  
          
      inverter_battery_discharge_ah_daily:
        friendly_name: Batteri urladdat idag
        device_class: energy
        unit_of_measurement: 'kWh'
        icon_template: mdi:battery-high
        value_template: >
          {{ (states('sensor.daily_inverter_battery_discharge_ah') | float(0) * 24.8 / 1000 | float) | round(2) }}

      inverter_battery_charge_energy:
        friendly_name: Batteri laddat Increasing
        device_class: energy
        unit_of_measurement: 'kWh'
        icon_template: mdi:battery-high
        value_template: >
          {{ (states('sensor.modbus_inverter_battery_charge') | float(0) * 24.8 / 1000 | float) | round(2) }}

      inverter_battery_discharge_energy:
        friendly_name: Batteri urladdat Increasing
        device_class: energy
        unit_of_measurement: 'kWh'
        icon_template: mdi:battery-high
        value_template: >
          {{ (states('sensor.modbus_inverter_battery_discharge') | float(0) * 24.8 / 1000 | float) | round(2) }}

      inverter_battery_power:
        friendly_name: Batteribank effekt
        device_class: power
        unit_of_measurement: 'W'
        icon_template: mdi:flash
        value_template: >
          {{ (states('sensor.modbus_inverter_batteryv') | float(0) * states('sensor.modbus_inverter_batterya') | float) | round(1) }}

      inverter_battery_power_kwh:
        friendly_name: Batteribank effekt kWh
        device_class: power
        unit_of_measurement: 'kWh'
        icon_template: mdi:flash
        value_template: >
          {{ (states('sensor.inverter_battery_power') | float(0) / 1000 | float(0) ) | round(2) }}

I use the battery charge discharge in Ah from modbus

#Accumulated battery charge AH
      - name: Modbus_Inverter_battery_charge
        unique_id: Modbus_Inverter_battery_charge
        scan_interval: 245
        unit_of_measurement: ah
        state_class: total_increasing
        device_class: energy
        scale: 1
        precision: 1
        slave: 1
        address: 61492
        input_type: holding
        
#Accumulated battery discharge AH
      - name: Modbus_Inverter_battery_discharge
        unique_id: Modbus_Inverter_battery_discharge
        scan_interval: 260
        unit_of_measurement: ah
        state_class: total_increasing
        device_class: energy
        scale: 1
        precision: 1
        slave: 1
        address: 61494
        input_type: holding

My latest version of the solar-dashboard looks like this:

Do you get any unavailable states when the sun is out from your modbus waveshare gateway? My current problem is that when the sun is out I get ā€œunavailableā€ state very often, this only happens when the sun is out, almost as if the inverter prioritizes the internal mppt calculation and not the modbus protocol when it has to ā€œwork moreā€

Wow
Thanks for you Mattie I learned what is template sensor. Game changer I have to say.
I have no problem with states. After 3 days its looks solid.
Did you connected GND wire to waveshare gateway because you didnā€™t mention about it. Or try my baud rate settings.
Ps. Do you have SRNE address book, I want to look inside

Yes templatesensors solve many issues!

Actually I havenā€™t connected the GND at this point, maybe Iā€™ll give it a try. Of course I have plenty of modbus requests also, at least 20 different sensors polling the gateway even though some are grouped into one. It is possible that Iā€™m on thr limit of what the inverter interface can deliver also.

Iā€™ve pasted the modbus address index in this post. Enjoy :slight_smile:

Easyupload.io - Upload files for free and transfer big files easily. (Link available for 30 days)

Never forget the GND! :slight_smile:

Everything seems fine now! Thanks for reminding me! Also I had the colors right, I just fat fingered in my initial post here :relieved:

ha! good to hear that:)


In my case I finishing polishing my dashboard. Only problem I have is 12S battery and canā€™t setup it in inverter :frowning:
Did you try writing registers? in my case I want to control charging/discharging via HA. I have connected BMS to HA and by this data I want to control stop/start charging

Nice :slight_smile: I control my SRNE with HA writing registers to control charging mode and source mode. I have an integration polling the electricity price forecast that sets an automation to start charging batteries on the lowest cost hour. Works great, I also have an automation controlling the load so that the battery never goes beyond 24.4V on my 6p2s batterybank. When the voltage gets close the automation sets charge to ā€œPV onlyā€ and Source to ā€œmainsā€. I posted about writing registers a few posts up here, just use script

What SRNE model do you use exactly? I see that you got almost 3kWh from solar. And I already need to upgradeā€¦ :slight_smile:

Also where did you buy it? Anything you could recommend?

Hi Mattie
My model is 5k older SRNE

Iā€™m not super turbo extra happy about it because of minimum battery voltage which I cannot setup property. They got software limitation to 40V and I cant go lower with it
They selling it on AliExpress and I sow that they got new model. Iā€™m living in Sicilly and from 10 panels and this inverter I got more power that I need during the day and generally Iā€™m very happy about this setup :slight_smile:

Actually Iā€™m looking at this model now, did you order from Ali? Was it all good?

no no, I bring it from Poland, Iā€™m polish guy who moved to Sicily. But a lot of my friends ordered from Ali. You have to wait a little but its working well

Actually Iā€™m also from Poland but live in Sweden. :slight_smile: where did you get it from?? You could dm me!

Edit, saw your dm now :slight_smile:

Hello,
Can I also read this out with ESPHOME (ESP32)? I have an RS232 at the inverter and could read that via Modbus, right?

As long as you communicate with the same protocol you should be able to use esphome to do it with the code above. Iā€™ve seen a few videos on yt where ppl do it. It seems like a more troublesome way though. The waveshare unit costs about 25$ and itā€™s pretty much plug and play :slight_smile: I already have two of them to a srne and a epever tracer (differens modbus addresses ofc)
Works pretty good

Mattie and others thanks for the great information in this thread. I own the 3000w SRNE hybrid inverter, and the waveshare gateway linked in the initial post by Mattie(My inverter is the 110v version since I live in Japan(I am Danish though). It was dead easy to set up thanks to this thread. I know how to make scripts in HA however I lack the reference to the registers. What I am trying to accomplish is something like what Mattie is doing ie change the working mode between CSO/OSO etc in setting ā€œ6ā€ in the inverter display. I saw that you shared a pdf with those Mattie but the Link has expired could you repost it or can I dm you with my e-mail and have you mail it to me? I could ask SRNE support and I have tried but they dont seam to respond Thanks in advance Best regards Anders

I envy you, I LOVE Japan and would like to travel there sometime :sweat_smile:

Send me your email address in dm here and Iā€™ll send you the file when I wake up tomorrow, itā€™s 01.00 here in Sweden. Or if you want I can give you my whole config. I have two different models now and it works like a charm on both of them :metal:t3:

1 Like

Thanks a lot for the kind words and your quick reply. I canā€™t make dmā€™s for some reason however, so I will type my e-mail it is: xxxxxxxxxxx. I would love to have a look at you config files if possible and not to much trouble. I am very impressed with your setup. Thanks again I really appreciate it. Tack sĆ„ mycket!

Figured I might as well paste my raw updated code here. Excuse the mess in the code, much trial and error so Iā€™ve commented some parts away that I dont use but may wanna get back to. Take what you need :slight_smile:

#################################################################################################################################
#                                   MODBUS
#################################################################################################################################
modbus:

#    SRNE HYBRID - 1600W
#############################################
    
  - type: rtuovertcp
    host: 192.168.1.30
    port: 8888
    name: modbus_tcp
    
    sensors:
      - name: "Main Battery"
        address: 256
        slave: 1
        count: 3
        scan_interval: 10
        data_type: custom
        structure: ">3H"
      - name: "Main Panel"
        address: 263
        slave: 1
        count: 3
        scan_interval: 11
        data_type: custom
        structure: ">3H"
      - name: "Main Usage"
        address: 61487
        slave: 1
        count: 2
        scan_interval: 12
        data_type: custom
        structure: ">2H"
      - name: "Main Info"
        address: 540
        slave: 1
        count: 10
        scan_interval: 13
        data_type: custom
        structure: ">10h"
    
#Load active power phase A
      - name: Modbus_Inverter_Power
        unique_id: Modbus_Inverter_Power
        scan_interval: 11
        unit_of_measurement: W
        scale: 1
        slave: 1
        address: 539
        input_type: holding

#Battery current
      - name: Modbus_Inverter_BatteryA
        unique_id: Modbus_Inverter_BatteryA
        scan_interval: 63
        unit_of_measurement: A
        scale: 0.1
        precision: 1
        slave: 1
        address: 258
        input_type: holding

#Total charge power, include charge power by mains and pv
      - name: Modbus_Inverter_Charge_power
        unique_id: Modbus_Inverter_Charge_power
        scan_interval: 64
        unit_of_measurement: W
        scale: 1
        slave: 1
        address: 270
        input_type: holding
        
#Charge state
      - name: Modbus_Inverter_battery_chargestate
        unique_id: Modbus_Inverter_battery_chargestate
        scan_interval: 65
        unit_of_measurement: state
        scale: 1
        slave: 1
        address: 267
        input_type: holding

#Current state of the machine
      - name: Modbus_Inverter_Operation
        unique_id: Modbus_Inverter_Operation
        scan_interval: 60
        scale: 1
        slave: 1
        address: 528
        input_type: holding

#Battery side current by PV charging
      - name: Modbus_Inverter_PV_charge_current
        unique_id: Modbus_Inverter_PV_charge_current
        scan_interval: 63
        unit_of_measurement: A
        scale: 0.1
        precision: 1
        slave: 1
        address: 548
        input_type: holding
        
        
#
#   RƄKNARE       
##############################

#Accumulated PV power generation
      - name: Modbus_Inverter_PV_Generated
        unique_id: Modbus_Inverter_PV_Generated
        scan_interval: 240
        unit_of_measurement: kWh
        state_class: total_increasing
        device_class: energy
        scale: 0.1
        precision: 1
        slave: 1
        address: 61496
        input_type: holding
        
#Accumulated battery charge AH
      - name: Modbus_Inverter_battery_charge
        unique_id: Modbus_Inverter_battery_charge
        scan_interval: 245
        unit_of_measurement: ah
        state_class: total_increasing
        device_class: power
        scale: 1
        precision: 1
        slave: 1
        address: 61492
        input_type: holding
        
#Accumulated battery discharge AH
      - name: Modbus_Inverter_battery_discharge
        unique_id: Modbus_Inverter_battery_discharge
        scan_interval: 260
        unit_of_measurement: ah
        state_class: total_increasing
        device_class: power
        scale: 1
        precision: 1
        slave: 1
        address: 61494
        input_type: holding
        
        
#Power consumption by load from mains of today
      - name: Modbus_Inverter_Main_load_power_daily
        unique_id: Modbus_Inverter_Main_load_power_daily
        scan_interval: 280
        unit_of_measurement: kWh
        scale: 0.1
        precision: 1
        slave: 1
        address: 61501
        input_type: holding

#Output Priority
      - name: Modbus_Inverter_output_priority
        unique_id: Modbus_Inverter_output_priority
        scan_interval: 34
        scale: 1
        slave: 1
        address: 57860
        input_type: holding 
        
#Charge Priority
      - name: Modbus_Inverter_charge_priority
        unique_id: Modbus_Inverter_charge_priority
        scan_interval: 35
        scale: 1
        slave: 1
        address: 57871
        input_type: holding  
     
#Mains Charge Limit
      - name: Modbus_Inverter_mains_charge_limit
        unique_id: Modbus_Inverter_mains_charge_limit
        scan_interval: 30
        unit_of_measurement: 'A'
        scale: 0.1
        slave: 1
        address: 57861
        input_type: holding  
     
        
        
        
        


#    SRNE HYBRID - 4000W
#############################################
    
  - type: rtuovertcp
    host: 192.168.1.29
    port: 8888
    name: modbus_500v_tcp
    
    sensors:
      - name: "Main Battery 500v"
        address: 256
        slave: 1
        count: 3
        scan_interval: 10
        data_type: custom
        structure: ">3H"
      - name: "Main Panel 500v"
        address: 263
        slave: 1
        count: 3
        scan_interval: 11
        data_type: custom
        structure: ">3H"
      - name: "Main Usage 500v"
        address: 61487
        slave: 1
        count: 2
        scan_interval: 12
        data_type: custom
        structure: ">2H"
      - name: "Main Info 500v"
        address: 540
        slave: 1
        count: 10
        scan_interval: 13
        data_type: custom
        structure: ">10h"
    
#Load active power phase A
      - name: Modbus_Inverter_500v_Power
        unique_id: Modbus_Inverter_500v_Power
        scan_interval: 11
        unit_of_measurement: W
        scale: 1
        slave: 1
        address: 539
        input_type: holding

#Battery current
      - name: Modbus_Inverter_500v_BatteryA
        unique_id: Modbus_Inverter_500v_BatteryA
        scan_interval: 63
        unit_of_measurement: A
        scale: 0.1
        precision: 1
        slave: 1
        address: 258
        input_type: holding

#Total charge power, include charge power by mains and pv
      - name: Modbus_Inverter_500v_Charge_power
        unique_id: Modbus_Inverter_500v_Charge_power
        scan_interval: 64
        unit_of_measurement: W
        scale: 1
        slave: 1
        address: 270
        input_type: holding
        
#Charge state
      - name: Modbus_Inverter_500v_battery_chargestate
        unique_id: Modbus_Inverter_500v_battery_chargestate
        scan_interval: 65
        unit_of_measurement: state
        scale: 1
        slave: 1
        address: 267
        input_type: holding

#Current state of the machine
      - name: Modbus_Inverter_500v_Operation
        unique_id: Modbus_Inverter_500v_Operation
        scan_interval: 60
        scale: 1
        slave: 1
        address: 528
        input_type: holding

#Battery side current by PV charging
      - name: Modbus_Inverter_500v_PV_charge_current
        unique_id: Modbus_Inverter_500v_PV_charge_current
        scan_interval: 63
        unit_of_measurement: A
        scale: 0.1
        precision: 1
        slave: 1
        address: 548
        input_type: holding
        
        
#
#   RƄKNARE       
##############################

#Accumulated PV power generation
      - name: Modbus_Inverter_500v_PV_Generated
        unique_id: Modbus_Inverter_500v_PV_Generated
        scan_interval: 240
        unit_of_measurement: kWh
        state_class: total_increasing
        device_class: energy
        scale: 0.1
        precision: 1
        slave: 1
        address: 61496
        input_type: holding
        
#Accumulated battery charge AH
      - name: Modbus_Inverter_500v_battery_charge
        unique_id: Modbus_Inverter_500v_battery_charge
        scan_interval: 245
        unit_of_measurement: ah
        state_class: total_increasing
        device_class: power
        scale: 1
        precision: 1
        slave: 1
        address: 61492
        input_type: holding
        
#Accumulated battery discharge AH
      - name: Modbus_Inverter_500v_battery_discharge
        unique_id: Modbus_Inverter_500v_battery_discharge
        scan_interval: 260
        unit_of_measurement: ah
        state_class: total_increasing
        device_class: power
        scale: 1
        precision: 1
        slave: 1
        address: 61494
        input_type: holding
        
        
#Power consumption by load from mains of today
      - name: Modbus_Inverter_500v_Main_load_power_daily
        unique_id: Modbus_Inverter_500v_Main_load_power_daily
        scan_interval: 280
        unit_of_measurement: kWh
        scale: 0.1
        precision: 1
        slave: 1
        address: 61501
        input_type: holding

#Output Priority
      - name: Modbus_Inverter_500v_output_priority
        unique_id: Modbus_Inverter_500v_output_priority
        scan_interval: 34
        scale: 1
        slave: 1
        address: 57860
        input_type: holding 
        
#Charge Priority
      - name: Modbus_Inverter_500v_charge_priority
        unique_id: Modbus_Inverter_500v_charge_priority
        scan_interval: 35
        scale: 1
        slave: 1
        address: 57871
        input_type: holding  
     
#Mains Charge Limit
      - name: Modbus_Inverter_500v_mains_charge_limit
        unique_id: Modbus_Inverter_500v_mains_charge_limit
        scan_interval: 30
        unit_of_measurement: 'A'
        scale: 0.1
        slave: 1
        address: 57861
        input_type: holding  

		
		
		
#################################################################################################################################
# TEMPLATE SENSORER
#################################################################################################################################
  - platform: template
    sensors:
    

      daily_solar_total_energy:
        unique_id: daily_solar_total_energy
        friendly_name: Sol Totalt Idag
        device_class: energy
        unit_of_measurement: 'kWh'
        value_template: >
          {{ (states('sensor.daily_inverter_pv') | float(0) + states('sensor.daily_inverter_500v_pv') | float(0) + states('sensor.daily_epever_energy') | float(0)) | round(1) }}
    

#Main power bƄda inverters
      inverters_ac_power:
        unique_id: inverters_ac_power
        friendly_name: "Inverters AC Totalt"
        unit_of_measurement: 'W'
        device_class: power
        value_template: "{{ (states('sensor.inverter_ac_power') | float(0) + states('sensor.inverter_500v_ac_power') | float(0)) | round(0) }}"
    

#Fƶrbrukare bƄda inverters
      inverters_power:
        unique_id: inverters_power
        friendly_name: "Fƶrbrukare Totalt"
        unit_of_measurement: 'W'
        device_class: power
        value_template: "{{ (states('sensor.modbus_inverter_power') | float(0) + states('sensor.modbus_inverter_500v_power') | float(0)) | round(0) }}"
    



      solar_total_power:
        unique_id: solar_total_power
        friendly_name: "Sol Totalt"
        unit_of_measurement: 'W'
        device_class: power
        value_template: "{{ (states('sensor.modbus_inverter_pv_power') | float(0) + states('sensor.modbus_inverter_500v_pv_power') | float(0) + states('sensor.epever_array_power_template') | float(0)) | round(0) }}"
    
      solar_total_power_kwh:
        unique_id: solar_total_power_kwh
        friendly_name: "Sol Totalt"
        unit_of_measurement: 'kWh'
        device_class: power
        value_template: "{{ ((states('sensor.modbus_inverter_pv_power') | float(0) + states('sensor.modbus_inverter_500v_pv_power') | float(0) + states('sensor.epever_array_power_template') | float(0)) / 1000) | round(1) }}"
    
      batterybank_shelly_template:
        unique_id: batterybank_shelly_template
        friendly_name: "Batteribank"
        unit_of_measurement: 'V'
        icon_template: mdi:car-battery
        value_template: "{{ states('sensor.batterybank_low_adc') | float(0) + states('sensor.shelly_uni_batteri_adc') | float(0) | round(1) }}"




#      inverter_forbrukare_energy:
#        friendly_name: "Inverter Fƶrbrukare -Batteri"
#        device_class: energy
#        unit_of_measurement: 'kWh'
#        icon_template: mdi:power-socket-eu     
#        value_template: "{{ (states('sensor.daily_soluttag_energy') | float + states('sensor.daily_satoshi') | float + states('sensor.daily_energy_ac') | float + states('sensor.inverter_battery_charge_ah_daily') | float(0) + states('sensor.daily_energy_studioserver') | float) | round(1) }}"

# + states('sensor.daily_energy_studioserver') | float

      soluttag_total_daily_energy:
        unique_id: soluttag_total_daily_energy
        friendly_name: Soluttag Totalt
        device_class: energy
        unit_of_measurement: 'kWh'
        icon_template: mdi:flash
        value_template: >
          {{ (states('sensor.daily_energy_ac') | float(0) + states('sensor.daily_satoshi') | float(0) + states('sensor.daily_soluttag_energy') | float(0) + states('sensor.daily_energy_studioserver') | float) | round(1) }} 
# + states('sensor.daily_energy_studioserver') | float



#   
#  SRNE 1600W Templates
#################################
      modbus_inverter_batterylevel:
        friendly_name: "Main Battery SOC"
        unit_of_measurement: '%'
        value_template: "{{ (states('sensor.main_battery').split(',')[0])  }}"
      modbus_inverter_batteryv:
        friendly_name: "Main Battery Voltage"
        unit_of_measurement: V
        value_template: "{{ (states('sensor.main_battery').split(',')[1]|float * 0.1)|round(1)  }}"
#      modbus_inverter_batterya:
#        friendly_name: "Main Battery Current"
#        unit_of_measurement: A
#        value_template: "{{ (states('sensor.main_battery').split(',')[2]|float * 0.1)|round(1)  }}"
      modbus_inverter_pv_voltage:
        friendly_name: "Main Panel Voltage"
        unit_of_measurement: V
        value_template: "{{ (states('sensor.main_panel').split(',')[0]|float * 0.1)|round(1)  }}"
      modbus_inverter_pv_current:
        friendly_name: "Main Panel Current"
        unit_of_measurement: A
        value_template: "{{ (states('sensor.main_panel').split(',')[1]|float * 0.1)|round(1)  }}"
      modbus_inverter_pv_power:
        unique_id: modbus_inverter_pv_power
        friendly_name: 'Main Panel Power'
        unit_of_measurement: W
        value_template: "{{ (states('sensor.main_panel').split(',')[2])  }}"
      modbus_inverter_pv_power_kwh:
        unique_id: modbus_inverter_pv_power_kwh
        friendly_name: 'Main Panel Power'
        unit_of_measurement: kWh
        value_template: "{{ (states('sensor.main_panel').split(',')[2]|float / 1000) | round(2) }}"        
#ANVƄNDS??
      main_power_generated:
        friendly_name: "Main Power Generated"
        device_class: energy
        #state_class: total_increasing
        unit_of_measurement: kWh
        value_template: "{{ (states('sensor.main_usage').split(',')[0]|float * 0.1)|round(1)  }}"
      main_power_consumed:
        friendly_name: "Main Power Consumed"
        device_class: energy
        #state_class: total_increasing
        unit_of_measurement: kWh
        value_template: "{{ (states('sensor.main_usage').split(',')[1]|float * 0.1)|round(1)  }}"
#      main_load_power:
#        friendly_name: "Main Load Power"
#        unit_of_measurement: W
#        value_template: "{{ (states('sensor.main_load').split(',')[0])  }}"
#      main_load_percent:
#        friendly_name: "Main Load Percentage"
#        unit_of_measurement: '%'
#        value_template: "{{ (states('sensor.main_load').split(',')[3])  }}"
        
        
        
      modbus_inverter_main_charge_current_new:
        friendly_name: "Main Charge Current"
        unit_of_measurement: 'A'
        value_template: "{{ (states('sensor.main_info').split(',')[2]|float * 0.1)  }}"        
        
      modbus_inverter_loadratio:
        friendly_name: "Main Charge Current"
        unit_of_measurement: '%'
        value_template: "{{ (states('sensor.main_info').split(',')[3])  }}"

      modbus_inverter_dcdc_temp:
        friendly_name: "DC-DC"
        unit_of_measurement: 'Ā°C'
        value_template: "{{ (states('sensor.main_info').split(',')[4]|float * 0.1)  }}"
        
      modbus_inverter_dcac_temp:
        friendly_name: "DC-AC"
        unit_of_measurement: 'Ā°C'
        value_template: "{{ (states('sensor.main_info').split(',')[5]|float * 0.1)  }}"
        
      modbus_inverter_translator_temp:
        friendly_name: "Translator"
        unit_of_measurement: 'Ā°C'
        value_template: "{{ (states('sensor.main_info').split(',')[6]|float * 0.1)  }}"
        
#      modbus_inverter_pv_charge_current_new:
#        friendly_name: "PV Charge Current"
#        unit_of_measurement: 'A'
#        value_template: "{{ (states('sensor.main_info').split(',')[8]|float * 0.1)  }}"




#   
#  SRNE 4000W Templates
#################################
      modbus_inverter_500v_batterylevel:
        friendly_name: "Main Battery SOC"
        unit_of_measurement: '%'
        value_template: "{{ (states('sensor.main_battery_500v').split(',')[0])  }}"
      modbus_inverter_500v_batteryv:
        friendly_name: "Main Battery Voltage"
        unit_of_measurement: V
        value_template: "{{ (states('sensor.main_battery_500v').split(',')[1]|float * 0.1)|round(1)  }}"
#      modbus_inverter_500v_batterya:
#        friendly_name: "Main Battery Current"
#        unit_of_measurement: A
#        value_template: "{{ (states('sensor.main_battery_500v').split(',')[2]|float * 0.1)|round(1)  }}"
      modbus_inverter_500v_pv_voltage:
        friendly_name: "Main Panel Voltage"
        unit_of_measurement: V
        value_template: "{{ (states('sensor.main_panel_500v').split(',')[0]|float * 0.1)|round(1)  }}"
      modbus_inverter_500v_pv_current:
        friendly_name: "Main Panel Current"
        unit_of_measurement: A
        value_template: "{{ (states('sensor.main_panel_500v').split(',')[1]|float * 0.1)|round(1)  }}"
      modbus_inverter_500v_pv_power:
        unique_id: modbus_inverter_500v_pv_power
        friendly_name: 'Main Panel Power'
        unit_of_measurement: W
        value_template: "{{ (states('sensor.main_panel_500v').split(',')[2])  }}"
      modbus_inverter_500v_pv_power_kwh:
        unique_id: modbus_inverter_500v_pv_power_kwh
        friendly_name: 'Main Panel Power'
        unit_of_measurement: kWh
        value_template: "{{ (states('sensor.main_panel_500v').split(',')[2]|float / 1000) | round(2) }}"        
#ANVƄNDS??
      main_500v_power_generated:
        friendly_name: "Main Power Generated"
        device_class: energy
        #state_class: total_increasing
        unit_of_measurement: kWh
        value_template: "{{ (states('sensor.main_usage_500v').split(',')[0]|float * 0.1)|round(1)  }}"
      main_500v_power_consumed:
        friendly_name: "Main Power Consumed"
        device_class: energy
        #state_class: total_increasing
        unit_of_measurement: kWh
        value_template: "{{ (states('sensor.main_usage_500v').split(',')[1]|float * 0.1)|round(1)  }}"

        
        
        
      modbus_inverter_500v_main_charge_current_new:
        friendly_name: "Main Charge Current"
        unit_of_measurement: 'A'
        value_template: "{{ (states('sensor.main_info_500v').split(',')[2]|float * 0.1)  }}"        
        
      modbus_inverter_500v_loadratio:
        friendly_name: "Main Charge Current"
        unit_of_measurement: '%'
        value_template: "{{ (states('sensor.main_info_500v').split(',')[3])  }}"

      modbus_inverter_500v_dcdc_temp:
        friendly_name: "DC-DC"
        unit_of_measurement: 'Ā°C'
        value_template: "{{ (states('sensor.main_info_500v').split(',')[4]|float * 0.1)  }}"
        
      modbus_inverter_500v_dcac_temp:
        friendly_name: "DC-AC"
        unit_of_measurement: 'Ā°C'
        value_template: "{{ (states('sensor.main_info_500v').split(',')[5]|float * 0.1)  }}"
        
      modbus_inverter_500v_translator_temp:
        friendly_name: "Translator"
        unit_of_measurement: 'Ā°C'
        value_template: "{{ (states('sensor.main_info_500v').split(',')[6]|float * 0.1)  }}"






#      inverter_mains_power:
#        friendly_name: Inverter Mains Power
#        device_class: energy
#        unit_of_measurement: 'W'
#        value_template: >
#          {{ states('sensor.modbus_grid_voltage') | float(0) * states('sensor.modbus_grid_current') | float(0) }}
       
      inverter_batterybank_soc:
        friendly_name: Batteribank SOC
        unit_of_measurement: '%'
        value_template: >
          {{ (100 - ((states('sensor.inverter_battery_discharge_ah_daily2') | float(0) / 9 ) * 100)) | round(0) }}
          
      inverter_batterybank_soc2:
        friendly_name: Batteribank SOC
        unit_of_measurement: '%'
        value_template: >
          {{ (100 - ((states('sensor.inverter_battery_laddat_net_idag') | float(0) / 9 ) * 100)) | round(0) }}
		  
		  
#################################################################################################################################
#     Utility Meter Tracking - tracks specific state time of a device/counter
#################################################################################################################################
utility_meter:
  daily_epever_energy:
    source: sensor.epever_total_generated_energy
    cycle: daily
  daily_inverter_battery_charge_ah:
    source: sensor.modbus_inverter_battery_charge
    cycle: daily
  daily_inverter_battery_discharge_ah:
    source: sensor.modbus_inverter_battery_discharge
    cycle: daily
  daily_inverter_500v_battery_charge_ah:
    source: sensor.modbus_inverter_500v_battery_charge
    cycle: daily
  daily_inverter_500v_battery_discharge_ah:
    source: sensor.modbus_inverter_500v_battery_discharge
    cycle: daily
  daily_soluttag_energy:
    unique_id: daily_soluttag_energy
    source: sensor.soluttag_energy
    cycle: daily
  daily_inverter_pv:
    unique_id: daily_inverter_pv
    source: sensor.modbus_inverter_pv_generated
    cycle: daily
  daily_inverter_500v_pv:
    unique_id: daily_inverter_500v_pv
    source: sensor.modbus_inverter_500v_pv_generated
    cycle: daily
  daily_inverter_ac:
    source: sensor.inverter_ac_energy
    cycle: daily
  monthly_inverter_ac:
    source: sensor.inverter_ac_energy
    cycle: monthly
		  
1 Like

I have a Waveshare RS485 to ETH on my PowMR inverter. The communication is established, data is being sent and also received, but Iā€™m probably querying the wrong register via modbus. Can someone help me here?

Thank you very much.