yllibed / Zigbee2MqttAssistant

GUI for Zigbee2Mqtt running in docker and HASS.IO
450 stars 42 forks source link

[BUG] Can't remove Philips Outdoor sensor #320

Open HA-TB303 opened 4 years ago

HA-TB303 commented 4 years ago

Describe the bug

[BUG] Can't remove Philips Outdoor sensor

To Reproduce

Steps to reproduce the behavior:

  1. Go to devices
  2. Click on the missing outdoor sensor (removed from network) image image
  3. Try to remove the device (either normal or forceful)
  4. See error

Expected behavior Device removal successfull and the device wont reappear.

Steps I took to try resolve the problem

Tried normal removal and "forced", but device keeps reappearing.

Installation

Version of Zigbee2MqttAssistant (this software): 0.3.178 (0.3.178+Branch.master.Sha.7b1877a40d9d37c5a18e33632ecf85e6eda09a95) Release Version of Zigbee2Mqtt: 1.14.3 Coordinator version: 20200805

Pertinent logs

fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
      An unhandled exception has occurred while executing the request.
System.Exception: Remove device failed.
   at Zigbee2MqttAssistant.Services.MqttConnectionService.RemoveDeviceAndWait(String deviceFriendlyName, Boolean forceRemove) in D:\a\1\s\Zigbee2MqttAssistant\Services\MqttConnectionService.cs:line 754
   at Zigbee2MqttAssistant.Services.BrigeOperationService.RemoveDeviceById(String deviceId, Boolean forceRemove) in D:\a\1\s\Zigbee2MqttAssistant\Services\BrigeOperationService.cs:line 29
   at Zigbee2MqttAssistant.Controllers.HomeController.RemoveDevice(String id, Boolean forceRemove) in D:\a\1\s\Zigbee2MqttAssistant\Controllers\HomeController.cs:line 117
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)

zigbee2mqtt log:

Zigbee2MQTT:error 2020-08-29 11:43:26: Cannot remove, device '0x001788010645c38c' does not exist
sym0nd0 commented 4 years ago

Try the reset local state button on the status page and rebooting host.

HA-TB303 commented 4 years ago

Thanks, but I have tried that already.

danieledwardgeorgehitchcock commented 4 years ago

I had this issue with a different sensor.

If a device isn't removed cleanly, the fragments of the topics and messages are retained in MQTT.

If you use a tool such as MQTT Explorer, you should be able to find the offending articles, and remove them from your broker.

After you have done that, restart Zigbee2MQTT and Zigbee2MQTT Assistant and reset the local state and see if the device has disappeared.

It may also be worth checking your configuration.yaml in Zigbee2MQTT to see if it is still listed under the Devices section.

trisomeyr commented 3 years ago

I had this issue with a different sensor.

If a device isn't removed cleanly, the fragments of the topics and messages are retained in MQTT.

If you use a tool such as MQTT Explorer, you should be able to find the offending articles, and remove them from your broker.

After you have done that, restart Zigbee2MQTT and Zigbee2MQTT Assistant and reset the local state and see if the device has disappeared.

It may also be worth checking your configuration.yaml in Zigbee2MQTT to see if it is still listed under the Devices section.

works, maybe this should be included as a hint, when device removing fails using the web ui.