kevinvincent / ha-wyzesense

A Home Assistant Component to interface with the WYZE Sense hub and sensor system
369 stars 101 forks source link

scan sensor w/o MAC #109

Open Vendo232 opened 4 years ago

Vendo232 commented 4 years ago

Hi

How do I fix or Delete such a entity from HA?

Ca2222552505pture

tismondo commented 4 years ago

I have the same problem.

To give a bit more detail for how I arrived at this problem:

More Info: type=1, version=16

- The sensor appeared just as it does in OP's screenshot above:  `binary_sensor.wyzesense` with no MAC listed after
- For the entity in question,  there is an attribute listing for `mac:` -- but it's simply blank. No MAC listed.

Now I can't remove the sensor to attempt re-including with its MAC address. For now the sensor DOES function within HA, but I'm not sure what will happen if a second of my sensors experiences this problem.

edit:  I should mention other troubleshooting steps I've taken:

- Since the `mac:` attribute is blank, I tried calling the wyzesense.remove service with service data `mac: ""`. The service calls but HA gives an error notification as follows:

wyzesense No sensor with mac found to remove

- I've tried re-including the sensor without removing it first (since I can't do so!).  This gives me the same HA notification as before: 

Sensor found and added as: binarysensor.wyzesense (unless you have customized the entitiy id prior). To add more sensors, call wyzesense.scan again.

More Info: type=1, version=16

bschatzow commented 4 years ago

I had this on one sensor also. I think the sensor is defective.

tismondo commented 4 years ago

I had this on one sensor also. I think the sensor is defective.

Interesting. I wonder how frequent it is.... So I agree it could be defective (that might also explain the fast battery drain) but it doesn't solve the problem that there's no way to remove/exclude it from the integration, which probably warrants some looking-at.

gyerardos commented 4 years ago

Any solution? I have the same problem :S

ghost commented 4 years ago

I have the same issue now too. Was suffering from this issue so I upgraded my Wyze Bridge firmware from 0.30 to 0.33 which required re-pairing of all the sensors.

Was able to remove them all easily enough, and they all added back fine except for one sensor which has been added back without a MAC address as described here.

Does anyone know if there's any way of manually removing this sensor from the DB so that we can attempt to re-add it?

tteck commented 4 years ago

Remove the entry (mac will be something like 000/000/000/000) in /config/.storage/wyzesense.json and /config/.storage/core.entity_registry It is caused by a defective sensor.

ghost commented 4 years ago

Great, thanks! Is it likely a defective sensor, or just a poor pair? Because the sensor itself was working totally fine up until I upgraded the bridge. Would be a hell of a coincidence for it to become faulty at the very moment I decided to upgrade/remove/re-pair.

tteck commented 4 years ago

Great, thanks! Is it likely a defective sensor, or just a poor pair? Because the sensor itself was working totally fine up until I upgraded the bridge. Would be a hell of a coincidence for it to become faulty at the very moment I decided to upgrade/remove/re-pair.

If the sensor has no mac address = bad sensor. I've had a few to do this. BTW, when you re-scan sensors after a firmware update you don't have to remove the sensors.

soonerjim commented 4 years ago

It's not from a defective/bad sensor. I've had this problem, removed the sensor from core.entity_registry file in the config/storage folder and let it sit for a while and tried it again and get a MAC address. It's the Weirdest thing, but it's not from a faulty device.

smoke007 commented 4 years ago

I documented how to remove these contact sensors with all zero MAC, from the HA GUI at https://github.com/kevinvincent/ha-wyzesense/issues/130#issuecomment-624960162 I also confirmed in that post that this sensor no longer works with the Wyze bridge in a Wyze cam v2. Wyze support it warranting the sensor for free.

@soonerjim I did verify that my entity was listed within /workspace/config/.storage/core.entity_registry with "unique_id": "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000",. I then removed the sensor from HA using the GUI, rebooted, and verified it was gone from core.entity_registry. Each time I would scan to bring it back into HA, it would always come back with 00000000 MAC. I even restored my HA from a previous backup, but that didn't help either.

CorneliousJD commented 4 years ago

@soonerjim I did verify that my entity was listed within /workspace/config/.storage/core.entity_registry with "unique_id": "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000",. I then removed the sensor from HA using the GUI, rebooted, and verified it was gone from core.entity_registry. Each time I would scan to bring it back into HA, it would always come back with 00000000 MAC. I even restored my HA from a previous backup, but that didn't help either.

I have not been able to remove the entry from core.entity_registry at all, every time I do, it comes right back when I reboot HA...

I have used your comment in order to do the customization and also edited my entity ID itself to contain the MAC address as well, hoping that this will "solve" it since I cannot remove it. Sensors were likely purchased over a year ago and have no warranty on them I assume.

CorneliousJD commented 4 years ago

Ok, I just added another door sensor after the battery died and seeing the same thing with all 0 MAC addresses.

Something isn't right, seems very unlikley that both sensors are randomly bad all of a sudden. Seems to be an issue with changing batteries maybe and this integration?

soonerjim commented 4 years ago

Ok, I just added another door sensor after the battery died and seeing the same thing with all 0 MAC addresses.

Something isn't right, seems very unlikley that both sensors are randomly bad all of a sudden. Seems to be an issue with changing batteries maybe and this integration?

Sorry, I'm just a fellow enthusiast posting my own experience. But I agree that they're not bad. I've had one "come back to life" and sent its Mac address. Maybe one of the more technical people can help us out. I think once they're added, we need to make note of their MAC address and maybe we can manually enter them in the core.entity_registry. I've gotten frustrated enough with these to move on to building my own based on ESP-01 modules and instructions from the hook up.

kzaoaai commented 4 years ago

I've had this happen on a couple sensors now. It might not be what fixed it, but it has worked for me on the two occurrences:

CorneliousJD commented 4 years ago

I've had this happen on a couple sensors now. It might not be what fixed it, but it has worked for me on the two occurrences:

  • Delete both the new sensor with the "\u0000..." and the correct mac from \config.storage\wyzesense.json
  • Delete only new the new sensor with the "\u0000..." from core.entity_registry (Keep the one with the correct mac to preserve customizations)
  • Remove battery from sensor for a couple minutes.
  • Restart HA
  • Replace battery in sensor. The sensor should not be continuously blinking now (it was continuously blinking when it was sending the corrupt format MAC)
  • Re-add from the HA interface.

Hmmm, I did try this exact thing and it didn't end up working for me. I ended up getting frustrated enough to try contacting Wyze and they agreed to replace the 2 bad sensors I have under warranty surprisingly!

kzaoaai commented 4 years ago

Hmmm, I did try this exact thing and it didn't end up working for me. I ended up getting frustrated enough to try contacting Wyze and they agreed to replace the 2 bad sensors I have under warranty surprisingly!

Someone on the wyze forums mentioned that 3 blinks indicates a dying battery. I wonder if replacing it would fix this.

CorneliousJD commented 4 years ago

Someone on the wyze forums mentioned that 3 blinks indicates a dying battery. I wonder if replacing it would fix this.

I got my new sensors in and tried the brand new battery that came with them in the old unit, but it still wouldn't work, and pulled in all 00000000 for the MAC address again. Weird... :(

kzaoaai commented 4 years ago

It is weird. My problem is definitely battery related. I just switched batteries between two I have, and the problem followed the battery. Also, my battery tester shows the defective sensor’s battery to be way lower.

mattyb8562 commented 4 years ago

I've had the same issue as y'all have described. Is wasn't a bad sensor. The battery died in a motion sensor. I replaced the battery, rebooted HA and HA wasn't recognizing the state changes. I removed the sensor from HA using the .remove service, rescanned and it found the sensor but no MAC in the name. I removed the sensor again, updated from release 0.0.6 to 0.0.7, rescanned, and it found the sensor correctly.

turbo4door commented 4 years ago

I've had this happen on a couple sensors now. It might not be what fixed it, but it has worked for me on the two occurrences:

  • Delete both the new sensor with the "\u0000..." and the correct mac from \config.storage\wyzesense.json
  • Delete only new the new sensor with the "\u0000..." from core.entity_registry (Keep the one with the correct mac to preserve customizations)
  • Remove battery from sensor for a couple minutes.
  • Restart HA
  • Replace battery in sensor. The sensor should not be continuously blinking now (it was continuously blinking when it was sending the corrupt format MAC)
  • Re-add from the HA interface.

No luck on this....still coming back with all zero's for the mac after doing this for my motion sensor.

JP13090 commented 3 years ago

No luck with this procedure either. I've replaced two batteries so far - one in my mailbox WyzeSensor and one attached to my garage door. The mailbox worked out fine and kept its MAC address. The garage door, on the other hand, did not. The difference is that the mailbox showed 2.93 Volts when I replaced it, and the garage door showed 74 millivolts! Apparently, taking it that low for however length of time it was that dead, killed it. I'm getting the same "unique_id": "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" you all are getting.

Looks like it'll be a chat session and a hopeful replacement. Lesson learned: when Home Assistant shows 80% or less on the battery sensor, start looking at these carefully. Don't let them go too far.