Hello.
In my case modbus platform configured for sma reading is working well… Exept for some modbus communication dopout. Tipically one, maximum two times per day I need to restart Ha because every sensor from modbus sma gone to value 0 (zero)
After HA restart, everything is ok.
This happened only with new integration. Before Core update everything was ok.
Are there any settings to put, to avoid this behaviour.?
Below mine configuration
On config.yaml
modbus:
- name: sma
type: tcp
host: 192.168.1.51
port: 502
sensors:
# - platform: modbus
# registers:
- name: SMApwrL1
# hub: sma
unit_of_measurement: kW
slave: 3
address: 30777
count: 2
data_type: uint
scale: 0.001
precision: 2
- name: SMApwrL2
# hub: sma
unit_of_measurement: kW
slave: 3
address: 30779
count: 2
data_type: uint
scale: 0.001
precision: 2
- name: SMApwrL3
# hub: sma
unit_of_measurement: kW
slave: 3
address: 30781
count: 2
data_type: uint
scale: 0.001
precision: 2
- name: SMAcurL1
# hub: sma
unit_of_measurement: A
slave: 3
address: 30977
count: 2
data_type: uint
scale: 0.001
precision: 2
- name: SMAcurL2
# hub: sma
unit_of_measurement: A
slave: 3
address: 30979
count: 2
data_type: uint
scale: 0.001
precision: 2
- name: SMAcurL3
# hub: sma
unit_of_measurement: A
slave: 3
address: 30981
count: 2
data_type: uint
scale: 0.001
precision: 2
- name: SMAvoltL1
# hub: sma
unit_of_measurement: V
slave: 3
address: 30783
count: 2
data_type: uint
scale: 0.01
precision: 1
- name: SMAvoltL2
# hub: sma
unit_of_measurement: V
slave: 3
address: 30785
count: 2
data_type: uint
scale: 0.01
precision: 1
- name: SMAvoltL3
# hub: sma
unit_of_measurement: V
slave: 3
address: 30787
count: 2
data_type: uint
scale: 0.01
precision: 1
- name: SMAnetHZ
# hub: sma
unit_of_measurement: Hz
slave: 3
address: 30803
count: 2
data_type: uint
scale: 0.01
precision: 2
- name: SMApwr
# hub: sma
unit_of_measurement: kW
slave: 3
address: 30775
count: 2
data_type: int
scale: 0.001
precision: 2
- name: SMAtotal
# hub: sma
unit_of_measurement: kWh
slave: 3
address: 30529
count: 2
data_type: uint
scale: 0.001
precision: 2
- name: SMAtoday
# hub: sma
unit_of_measurement: kWh
slave: 3
address: 30535
count: 2
data_type: uint
scale: 0.001
precision: 2
- name: SMAdevtype
# hub: sma
slave: 3
address: 30053
count: 2
data_type: int
- name: SMAgridrelay
# hub: sma
slave: 3
address: 30217
count: 2
data_type: int
On sma.yaml into packages
- platform: template
sensors:
sma_power_l1:
value_template: "{% if states('sensor.smapwrl1')|float > 10000 %}0{% else %}{{ states('sensor.smapwrl1') | float | round(2)}}{% endif %}"
friendly_name: "sma power L1"
unit_of_measurement: 'kW'
icon_template: mdi:solar-power
sma_power_l2:
value_template: "{% if states('sensor.smapwrl2')|float > 10000 %}0{% else %}{{ states('sensor.smapwrl2') | float | round(2)}}{% endif %}"
friendly_name: "sma power L2"
unit_of_measurement: 'kW'
icon_template: mdi:solar-power
sma_power_l3:
value_template: "{% if states('sensor.smapwrl3')|float > 10000 %}0{% else %}{{ states('sensor.smapwrl3') | float | round(2)}}{% endif %}"
friendly_name: "sma power L3"
unit_of_measurement: 'kW'
icon_template: mdi:solar-power
sma_corrente_l1:
value_template: "{% if states('sensor.smacurl1')|float > 100 %}0{% else %}{{ states('sensor.smacurl1') | float | round(2)}}{% endif %}"
friendly_name: "sma ampere L1"
unit_of_measurement: 'A'
icon_template: mdi:solar-power
sma_corrente_l2:
value_template: "{% if states('sensor.smacurl2')|float > 100 %}0{% else %}{{ states('sensor.smacurl2') | float | round(2)}}{% endif %}"
friendly_name: "sma ampere L2"
unit_of_measurement: 'A'
icon_template: mdi:solar-power
sma_corrente_l3:
value_template: "{% if states('sensor.smacurl3')|float > 100 %}0{% else %}{{ states('sensor.smacurl3') | float | round(2)}}{% endif %}"
friendly_name: "sma ampere L3"
unit_of_measurement: 'A'
icon_template: mdi:solar-power
sma_tensione_l1:
value_template: "{% if states('sensor.smavoltl1')|float > 1000 %}230{% else %}{{ states('sensor.smavoltl1') | float | round(2)}}{% endif %}"
friendly_name: "sma volt L1"
unit_of_measurement: 'V'
icon_template: mdi:solar-power
sma_tensione_l2:
value_template: "{% if states('sensor.smavoltl2')|float > 1000 %}230{% else %}{{ states('sensor.smavoltl2') | float | round(2)}}{% endif %}"
friendly_name: "sma volt L2"
unit_of_measurement: 'V'
icon_template: mdi:solar-power
sma_tensione_l3:
value_template: "{% if states('sensor.smavoltl3')|float > 1000 %}230{% else %}{{ states('sensor.smavoltl3') | float | round(2)}}{% endif %}"
friendly_name: "sma volt L3"
unit_of_measurement: 'V'
icon_template: mdi:solar-power
sma_frequenza_di_rete:
value_template: "{% if states('sensor.smanethz')|float > 1000 %}50{% else %}{{ states('sensor.smanethz') | float | round(2)}}{% endif %}"
friendly_name: "sma frequenza di rete"
unit_of_measurement: 'Hz'
icon_template: mdi:solar-power
sma_power:
value_template: "{% if states('sensor.smapwr')|float < 0 %}0{% else %}{{ states('sensor.smapwr') | float | round(2)}}{% endif %}"
friendly_name: "sma Power"
unit_of_measurement: 'kW'
icon_template: mdi:solar-power
sma_total:
value_template: "{% if states('sensor.smatotal')|float < 0 %}0{% else %}{{ states('sensor.smatotal') | float | round(3)}}{% endif %}"
friendly_name: "sma Total"
unit_of_measurement: 'kWh'
icon_template: mdi:solar-power
sma_today:
value_template: "{% if states('sensor.smatoday')|float > 1000 %}0{% else %}{{ states('sensor.smatoday') | float | round(2)}}{% endif %}"
friendly_name: "sma Today"
unit_of_measurement: 'kWh'
icon_template: mdi:solar-power
sma_device_type:
value_template: "{% if states('sensor.smadevtype')|float == 9165 %}SunnyBoy3.6{% else %}?{% endif %}"
friendly_name: "sma device type"
icon_template: mdi:solar-power
sma_grid_relay:
value_template: "{% if states('sensor.smagridrelay')|float == 51 %}Chiuso{% elif states('sensor.smagridrelay')|float == 311 %}Aperto{% elif states('sensor.smagridrelay')|float == 16777213 %}Spento{% else %}?{% endif %}"
friendly_name: "sma grid relay"
icon_template: mdi:solar-power
Thank you very much
Daniele