MatterVN / ModbusTCP2MQTT

Sungrow & SMA Solar Inverter addon for Home Assistant using mobusTCP
MIT License
69 stars 52 forks source link

Working - but with error initially #24

Closed sEdsKi closed 2 years ago

sEdsKi commented 2 years ago

Ive been adding sensors from attributes and noticed that everytime I restart HA the integration stops working.

To get it working I have to stop MQTT Broker and ModbusTCP2MQTT and then start MQTT Broker First, wait, then start ModbustTCP2MQTT

It then throws an error intitially, but then begins working.

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[10:23:33] INFO: Configured'core-mosquitto' mqtt broker.
INFO:root:Create SungrowModbusTcpClient. Model: sungrow-sg8kd
INFO:root:Modbus connected
INFO:root:Configured MQTT Client
INFO:root:Publish Home Assistant Discovery message
WARNING:root:Modbus connection failed
WARNING:root:Failed to scrape inverter, sleeping until next scan
ERROR:pymodbus.factory:Unable to decode response Modbus Error: Unknown response 0
ERROR:pymodbus.transaction:Modbus Error: [Input/Output] Unable to decode request
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/pymodbus/transaction.py", line 190, in execute
    self.client.framer.processIncomingPacket(response,
  File "/usr/lib/python3.9/site-packages/pymodbus/framer/socket_framer.py", line 165, in processIncomingPacket
    self._process(callback, error=True)
  File "/usr/lib/python3.9/site-packages/pymodbus/framer/socket_framer.py", line 175, in _process
    raise ModbusIOException("Unable to decode request")
pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] Unable to decode request
WARNING:root:Modbus connection failed
WARNING:root:Failed to scrape inverter, sleeping until next scan
INFO:root:{'inverter_size': 8.0, 'daily_power_yield': 14000.0, 'total_power_yield': 86.66, 'inverter_power_on_hours': 5080, 'internal_temp': 60.0, 'pv1_voltage': 176.3, 'pv1_current': 7.2, 'pv2_voltage': 294.8, 'pv2_current': 14.1, 'total_pv_power': 5452, 'grid_voltage': 245.9, 'inverter_current': 21.3, 'total_active_power': 5316, 'grid_frequency': 50.1, 'export_power': -2504, 'export_power_indicator': 65535, 'power_meter': 2811, 'daily_export_energy': 9900.0, 'total_export_energy': 5930.6, 'daily_import_energy': 6100.0, 'total_import_energy': 4548.8, 'daily_energy_consumption': 4100.0, 'total_energy_consumption': 2735.7, 'timestamp': '2022-02-02T10:23:53'}
sEdsKi commented 2 years ago

New version released meaning this error is no longer applicable.