Schnitzel / hass-miner

Controll your Bitcoin miner from Home Assistant
MIT License
53 stars 17 forks source link

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

Open Ben-in-Chicago opened 1 month ago

Ben-in-Chicago commented 1 month 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 1 month 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 1 month 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 1 month 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 1 month 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 1 month 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 1 month 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 1 month ago

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

leehmanQQ commented 1 week 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 1 week 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 6 days ago

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