brianberg / ha-nicehash

NiceHash Home Assistant Integration
MIT License
21 stars 12 forks source link

strangly shows temp of video #6

Closed fufar closed 1 year ago

fufar commented 3 years ago

Version of the custom_component

72543f6 ? latest

Configuration

2021.5.3, docker, debian

Describe the bug

A clear and concise description of what the bug is. image image This is not my gpu temp. This is sun temp or whatever :)

I have only 1 gpu so cant say - it is problem for one or all

tcate03 commented 3 years ago

i have the same issue. excavator temp reads as 4718652*C

agoncalvesos commented 3 years ago

I have the same :) Do we need to devide the value by 100.000? :D

fufar commented 3 years ago

for me divison by 100000 wouldnt work - numbers are different may be there is a way to test throu api what nicehash data recives - and understand where error is? @brianberg any ideas?

fufar commented 3 years ago

ok, found that addon based on https://github.com/nicehash/rest-clients-demo find issue https://github.com/nicehash/rest-clients-demo/issues/29 temp must be divided by 65536 for me it gives right temp

for ha i changed in custom_components/nicehash/device_sensors.py

264: self._temperature = device.temperature

to

264: self._temperature = device.temperature % 65536

and now see correct temp

fufar commented 3 years ago

@tcate03 @agoncalvesos try this pls, if work ok - i will make a pr

brianberg commented 3 years ago

% is the modulus operator. I'm curious to understand why that's necessary. It seems as though the NiceHash API is giving you the wrong value. What is the significance of 65536?

Edit: Curiously, 2^16 = 65536 🤔

brianberg commented 3 years ago

Did NiceHash change their API responses for GPU temps? Seems like an easy change to make to the integration but I don't want to break it for everyone else.

fufar commented 3 years ago

dont know why, found it here https://github.com/nicehash/rest-clients-demo/issues/29 may be some difference between nice hash versions( i use quick miner) or between versions of program?

brianberg commented 3 years ago

This is more of a bandaid solution, but we could check the value of the temperature if it's above a certain value (eg. 1000 or 65536) then % 65536 🤷‍♂️

brianberg commented 3 years ago

@fufar I think you're right, it's a QuickMiner thing

https://github.com/nicehash/NiceHashQuickMiner/issues/146

brianberg commented 3 years ago

It's been a long time since I've even thought about unsigned integers 😆

fufar commented 3 years ago

ok, so can you make some fix?

brianberg commented 3 years ago

I need to get my local test setup working again, but I think I can get a fix out for this, this week

Edit: this should do it but I need to verify and test

fufar commented 3 years ago

tryed, looks like working ok for me

brianberg commented 3 years ago

Latest version 0.1.1 should fix this issue, I'll leave this open until it's confirmed

fufar commented 3 years ago

for me - ok @tcate03 @agoncalvesos ?

tcate03 commented 3 years ago

negative. Still seeing excavator temps of 65,535 C

andrewhair commented 3 years ago

Negative for me too, but at least the number is not as big.

agoncalvesos commented 3 years ago

@fufar using the low_temperature property works for me :) I have temperatures of 57ºC