mhwlng / fipha

Home Assistant integration with HWINFO, MQTT and optionally Logitech Flight Instrument Panel

Home Page:https://community.home-assistant.io/t/home-assistant-integration-with-logitech-flight-instrument-panel-hwinfo-mqtt/443045

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fipha.exe mqtt reconnects but entities 'unavailable'

vaibhav2912 opened this issue · comments

Hi,

First of all, thanks a ton for this awesome software. I love it.

Now, a minor problem,
I noticed that my HA instance lost network connection (loose cable) which caused fipha to lose mqtt connection. Once I fixed the network connection, log shows MqttOnConnected - MQTT Client: Connected with result: Success but my sensors in HA are still unavailable.
If I close fipha.exe and start it again, everything works normally again.
I can reproduce this issue/behavior by disconnecting and reconnecting network to my HA .

Is there any way to fix/change this behavior ?

Log:

ERROR 2023-11-26 19:20:00,640 MoveNext - No Home Assistant Connection for Flight Instrument Panels
INFO 2023-11-26 19:20:00,656 MoveNext - fipha started
INFO 2023-11-26 19:20:00,692 MoveNext - HWInfo task started, polling interval 1000 ms
INFO 2023-11-26 19:20:00,724 MoveNext - HWINFO Sensors found, Writing all HWINFO Sensors to hwinfo.json
INFO 2023-11-26 19:20:00,756 MqttOnConnected - MQTT Client: Connected with result: Success
ERROR 2023-11-26 19:26:24,323 b__16_2 - MQTT Client: Connection lost with reason: NormalDisconnection.
ERROR 2023-11-26 19:26:45,490 b__16_2 - MQTT Client: Connection lost with reason: UnspecifiedError.
ERROR 2023-11-26 19:26:45,490 b__16_3 - MQTT Client: Connection Failed
MQTTnet.Exceptions.MqttCommunicationTimedOutException: The operation has timed out.
at MQTTnet.Implementations.CrossPlatformSocket.d__47.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MQTTnet.Implementations.MqttTcpChannel.d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MQTTnet.Adapter.MqttChannelAdapter.d__34.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MQTTnet.Client.MqttClient.d__53.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MQTTnet.Client.MqttClient.d__41.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at MQTTnet.Client.MqttClient.d__41.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MQTTnet.Extensions.ManagedClient.ManagedMqttClient.d__69.MoveNext()
ERROR 2023-11-26 19:27:36,546 b__16_3 - MQTT Client: Connection Failed
MQTTnet.Exceptions.MqttCommunicationTimedOutException: The operation has timed out.
at MQTTnet.Implementations.CrossPlatformSocket.d__47.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MQTTnet.Implementations.MqttTcpChannel.d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MQTTnet.Adapter.MqttChannelAdapter.d__34.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MQTTnet.Client.MqttClient.d__53.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MQTTnet.Client.MqttClient.d__41.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at MQTTnet.Client.MqttClient.d__41.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MQTTnet.Extensions.ManagedClient.ManagedMqttClient.d__69.MoveNext()
ERROR 2023-11-26 19:27:36,546 b__16_2 - MQTT Client: Connection lost with reason: UnspecifiedError.
INFO 2023-11-26 19:28:10,027 MqttOnConnected - MQTT Client: Connected with result: Success

Regards,
Vaibhav

version 1.7 now restarts itself after MqttOnConnectingFailed and MqttOnConnected