Modbus TCP variable scale register

Im rather new to home assistant.

My first topic is to read values from my solar inverter (Fronius Symo).
I´m able to read the modbus register from the inverter, the problem comes when i realize that the scale changes depending on the power output from the inverter.
The scale comes on register 40084 as a value 0, -1 or -2, that gives the scale for register 40083, as value * 10^scale value.
How can I get a variable scale to the sensor “Production” in my configuration file below?
regards
Patrik

modbus:
  name: fronius
  type: tcp
  host: 192.168.0.148
  port: 502
  # Example configuration.yaml entry
sensor:
# Example configuration.yaml entry
      
- platform: modbus
  scan_interval: 5
  registers:
   - name: Production
     hub: fronius
     unit_of_measurement: W
     slave: 1
     register: 40083
     count: 1
     data_type: int
     scale: 0.1
   - name: Productionscale
     hub: fronius
     unit_of_measurement: scale
     slave: 1
     register: 40084
     count: 1
     scale: 1

I find the solution with a simple template sensor.

- platform: template
  sensors:
    nat_meter:
      friendly_name: "Net meter"
      unit_of_measurement: 'W'
      value_template: "{{ states('sensor.matareffekt')|int * 10 ** states('sensor.matareffektscala') | int }}"
    fronius:
      friendly_name: "Fronius"
      unit_of_measurement: 'W'
      value_template: "{{ states('sensor.Production')|int * 10 ** states('sensor.Productionscale') | int }}"  

regards
Patrik

1 Like

Hi Patrik,
I have seen you have integrated your Fronius Symo via Modbus. I have a Symo Hybrid and would like to integrate mine as well. could you maybe share your configuration with me so I could work on it and find out how to integrate mine? I am also wondering if it is possible to set the scan interval to 5 seconds.
Thanks a lot

I am also interested to do this with my Symo Inverter.
It seems it should be possible with no additional hradware/equipment. There is general Modbus integration https://www.home-assistant.io/integrations/modbus/ and on inverter local admin page, I can set Modbus to be available on TCP:


Is this enough ?
How do I know when to find values (registry ?) and how to potentially control inverter (if this is possible).
Last, is this integration better then “normal” one with web links ?