Schnitzel / hass-miner

Controll your Bitcoin miner from Home Assistant
MIT License
61 stars 19 forks source link

Second miner returning "does not generate unique IDs" error #368

Closed Ben-in-Chicago closed 1 month ago

Ben-in-Chicago commented 3 months ago

Version of the custom_component

VERSION_STORAGE = "6" STORENAME = "hacs"

Configuration

Add your logs here.

Describe the bug

Miner data for a specific miner is not being returned (as entities) and the miner (device) is not showing although it shows in the logs. When reviewing the logs, it appears an unique ID is needed, but unsure how to provide/resolve.

Debug log

Source: helpers/entity_platform.py:764
integration: Sensor (documentation, issues)
First occurred: 08:37:49 (100 occurrences)
Last logged: 11:36:39

Platform miner does not generate unique IDs. ID None-efficiency already exists - ignoring sensor.bitaxe_ultra_efficiency
Platform miner does not generate unique IDs. ID None-0-board_temperature already exists - ignoring sensor.bitaxe_ultra_board_0_board_temperature
Platform miner does not generate unique IDs. ID None-0-chip_temperature already exists - ignoring sensor.bitaxe_ultra_board_0_chip_temperature
Platform miner does not generate unique IDs. ID None-0-board_hashrate already exists - ignoring sensor.bitaxe_ultra_board_0_board_hashrate
Platform miner does not generate unique IDs. ID None-0-fan_speed already exists - ignoring sensor.bitaxe_ultra_fan_0_fan_speed
b-rowan commented 3 months ago

Seems like it's having trouble generating a UID for the bitaxe. Can never remember how those are generated, but it will be missing some piece of info.

Ben-in-Chicago commented 3 months ago

Seems like it's having trouble generating a UID for the bitaxe. Can never remember how those are generated, but it will be missing some piece of info.

I have another bitaxe which it does recognize / works. Unsure if that matters.

b-rowan commented 3 months ago

It's generating it by MAC address, it seems like I don't have a way to get the MAC for the bitaxes.

b-rowan commented 3 months ago

Seems like it's having trouble generating a UID for the bitaxe. Can never remember how those are generated, but it will be missing some piece of info.

I have another bitaxe which it does recognize / works. Unsure if that matters.

This is the issue, it's using None instead of the MAC, so when you add 2 it uses None for the UID and they overlap.

Ben-in-Chicago commented 3 months ago

Seems like it's having trouble generating a UID for the bitaxe. Can never remember how those are generated, but it will be missing some piece of info.

I have another bitaxe which it does recognize / works. Unsure if that matters.

This is the issue, it's using None instead of the MAC, so when you add 2 it uses None for the UID and they overlap.

OK, thanks! And to confirm, there isn't anything I can configure in the background to update?

b-rowan commented 3 months ago

I don't think so. I have to do some testing, it's a real pain to generate those UIDs when things aren't standardized...

Ben-in-Chicago commented 3 months ago

Thank you! I appreciate your help! Please let me know if there is anything that I can do to assist.

leehmanQQ commented 2 months ago

Using the IP address as unique id could a fix, couldn't it? It's not part of the api - but it is indeed part of the setup.

b-rowan commented 2 months ago

Using the IP address as unique id could a fix, couldn't it? It's not part of the api - but it is indeed part of the setup.

This could fix it temporarily, but it is explicitly disallowed by home assistant - https://developers.home-assistant.io/docs/config_entries_config_flow_handler?_highlight=unique#unacceptable-sources-for-a-unique-id

The reason for this is that the unique ID should not change for the same device, and with DHCP, that IP could change at any time. Integrations like this cannot expect that the user has set up their network in such a way that would solve this issue, thus, home assistant says no.

Ben-in-Chicago commented 2 months ago

I've been trying to follow your progress on getting this setup!

b-rowan commented 2 months ago

Ok, it is finally merged into ESP-Miner, so now we just have to wait for them to put out a version and I will get this added.

Ben-in-Chicago commented 2 months ago

Ok, it is finally merged into ESP-Miner, so now we just have to wait for them to put out a version and I will get this added.

Thanks for your contribution - it's greatly appreciated!

leehmanQQ commented 1 month ago

The changes were released in this version of ESP-Miner

b-rowan commented 1 month ago

The changes were released in this version of ESP-Miner

Awesome. Fixed in 2.3.0 of ESPMiner, if you update your bitaxe it should work now!

Ben-in-Chicago commented 1 month ago

The changes were released in this version of ESP-Miner

Awesome. Fixed in 2.3.0 of ESPMiner, if you update your bitaxe it should work now!

What about other miners that might be running Braiins OS, for example? Edit: nvm

Ben-in-Chicago commented 1 month ago

The changes were released in this version of ESP-Miner

Awesome. Fixed in 2.3.0 of ESPMiner, if you update your bitaxe it should work now!

Hey @b-rowan I've updated two different miners with the latest ESP-miner. I can see the MAC addresses for both via the web UI at the devices' respective IP addresses. HomeAssistant is still generating that "no unique ID" error after I downgraded to ha core version 2024.9.3.

b-rowan commented 1 month ago

HomeAssistant is still generating that "no unique ID" error after I downgraded to ha core version 2024.9.3.

You may have to remove and re-add the devices?

b-rowan commented 1 month ago

After checking, it seems I never added it in pyasic. I'll get that fixed shortly.

Ben-in-Chicago commented 1 month ago

HomeAssistant is still generating that "no unique ID" error after I downgraded to ha core version 2024.9.3.

You may have to remove and re-add the devices?

Tried re-adding, it seems to want a web username/password which I don't have or can recall setting up.

image

b-rowan commented 1 month ago

Ok, in pyasic as of 0.60.10, and I released a version here 1.1.16, which updates to that, and should also make that web user optional.

Ben-in-Chicago commented 1 month ago

Your update worked! I'm able to view each device separately now - thank you!

image