Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant set up the power consumption with HomeAssistant #355

Closed
tueftler0 opened this issue May 4, 2024 · 15 comments
Closed

Cant set up the power consumption with HomeAssistant #355

tueftler0 opened this issue May 4, 2024 · 15 comments

Comments

@tueftler0
Copy link

My Miner is an "Antminer S19J Pro Plus NoPic" with an integrated "Braiins BCB 100".
The problem is that I can't set the miner's power.
If i move the slider for that, i get an error and nothing happened in BaiinsOS+.
Same with Autotuning active and deactive.
Hope you can give me hint what i'm doing the wrong way.
Greetings


I'm using the latest version v1.1.9

Message displayed in HomeAssistant: "Fehler beim Aufrufen des Diensts number/set_value. Failed to set wattage."

Log after changing the wattage:

`2024-05-04 17:34:36.826 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140196477312320] Unexpected exception
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 239, in handle_call_service
response = await hass.services.async_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2738, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2779, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 975, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1047, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/number/init.py", line 116, in async_set_value
await entity.async_set_native_value(native_value)
File "/config/custom_components/miner/number.py", line 117, in async_set_native_value
raise pyasic.APIError("Failed to set wattage.")
pyasic.errors.APIError: Failed to set wattage.
2024-05-04 17:34:45.125 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 595, in state
if value.tzinfo is None:
^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'tzinfo'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 968, in async_update_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1132, in _async_write_ha_state
state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1067, in __async_calculate_state
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1015, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 606, in state
raise ValueError(
ValueError: Invalid datetime: sensor.last_lightning_strike has timestamp device class but provides state 2024-05-02T17:04:39+02:00:<class 'str'> resulting in ''str' object has no attribute 'tzinfo''
2024-05-04 17:35:12.907 WARNING (MainThread) [homeassistant.components.mqtt.light.schema_json] Invalid color mode 'hs' received for entity light.licht_ug_vorrat
2024-05-04 17:35:13.080 ERROR (Recorder) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 595, in state
if value.tzinfo is None:
^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'tzinfo'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 968, in async_update_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1132, in _async_write_ha_state
state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1067, in __async_calculate_state
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1015, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 606, in state
raise ValueError(
ValueError: Invalid datetime: sensor.last_lightning_strike has timestamp device class but provides state 2024-05-02T17:04:39+02:00:<class 'str'> resulting in ''str' object has no attribute 'tzinfo''
`

@b-rowan
Copy link
Collaborator

b-rowan commented May 4, 2024

Gonna do some testing with this. My guess is something about the gRPC return changed in a recent version and thats messing up the function.

@tueftler0
Copy link
Author

Hi. Thank you for your quite fast reply!
I'm curious to find out what it is...

@person65278
Copy link

Same thing for a regular S19. cant set wattage.

@b-rowan
Copy link
Collaborator

b-rowan commented May 14, 2024

Same thing for a regular S19. cant set wattage.

When you say "regular S19", does that mean stock firmware? Stock Antminer firmware doesn't support wattage setpoints.

@person65278
Copy link

person65278 commented May 14, 2024 via email

@b-rowan
Copy link
Collaborator

b-rowan commented May 15, 2024

Gonna do some testing with this. My guess is something about the gRPC return changed in a recent version and thats messing up the function.

My BCB100 has no miner to connect to, so I've kindof been flying blind here, but it appears for some reason my authentication is no longer working, even though literally nothing has changed? Possible it's related to the lack of miner thing, but your machines are able to gather data still, correct?

All functionality on newer miners goes through gRPC, so if that's the issue, then it would affect all the calls.

@tueftler0
Copy link
Author

@b-rowan Related to your pre-release on #357 (comment) - how can i test your made changes in HACS hass-miner ?

@b-rowan
Copy link
Collaborator

b-rowan commented May 26, 2024

Just released v1.1.10rc1, you can test with that. Just enable pre-releases when selecting the version and it should let you pick that version. Not sure it will fix it, and lmk if you have other issues, but its worth a shot.

@tueftler0
Copy link
Author

tueftler0 commented May 26, 2024

Old text from a few minutes ago: "I'm sorry to inform you that the problem is not solved with the update :("

New answer from now:
HA now suddenly shows the actual performance and has also passed the new value. I'm curious to see if it will work in the near future...

In any case, thank you very much first of all!

@tueftler0
Copy link
Author

tueftler0 commented May 26, 2024

Unfortunately it doesn't work stably :(
A new change had no effect again. The message is displayed often:
image

Sometime it worked, sometime not.

@b-rowan
Copy link
Collaborator

b-rowan commented May 26, 2024

But it's working some of the time? If so it might just need a cool down of some kind, usually it takes a bit for the miner to boot into the new wattage, it depends. There are some weird edge cases with BraiinsOS, such as if the miner has all working boards it shouldn't need to reboot, but if there is anything wrong it will reboot, etc.

@tueftler0
Copy link
Author

tueftler0 commented May 26, 2024

Yes, right. Sometime it worked. If i change the value and the message will not diplayed, the change take effect.
I have changed 16 values now for test, the 17th was working. Maybe it depends on the value itself. I'll send a reply after testing.

When it is working, the update process on the Miner WebUI is quite fast.

@b-rowan
Copy link
Collaborator

b-rowan commented May 26, 2024

Interesting. As long as you're cross referencing with the web UI, I assume it should work anytime that is responsive, but I don't know what the actual gRPC error code is... there may be a "Not Ready" code that I'm getting back, and I might be able to handle that by just resending.

@tueftler0
Copy link
Author

I have figured it out :(

There is a minimum value in BraiinsOS that I cannot reduce - for whatever reason.
So it would be great, if the slider can only used in the valid room ;)
A max value would be great to avoid demaging the miner, too.

image

@tueftler0
Copy link
Author

It's working with the newest version if you set the values in the allowed range.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants