RomRider / ha_nicehash

💵 Custom NiceHash integration for Home-Assistant
MIT License
36 stars 13 forks source link

Add temperature and powerUsage per device #10

Closed qcasey closed 2 years ago

qcasey commented 3 years ago

Hello, excellent integration!

I agreed with #9, in that some device stats would be useful. This PR adds a sensor for each device's temperature and powerUsage. What are your thoughts on the feature?

There's a small annoyance, where if the HA instance is set to Imperial units, the temerature is converted to °F - do you know if it's possible to force °C?

Screenshot from 2021-03-25 16-00-27

Fixes #9

RomRider commented 3 years ago

That's great, thanks!

The conversion happens because of the device class I believe. The only way I see is to no set the device class for the temperature but then some people might still want the temperature in °F which in this case would require adding a setting in the integration config option.

qcasey commented 3 years ago

Hmm, even without device_class it still does the conversion. I'll need to revisit this later when I have time. Two notes to self:

  1. Workaround for displaying C without imperial conversion
  2. QuickMiner GPU/VRAM temperatures are combined into one giant number
jdeath commented 3 years ago

Hmm, even without device_class it still does the conversion. I'll need to revisit this later when I have time. Two notes to self:

  1. Workaround for displaying C without imperial conversion

I hack I did was change the temperature setup line in sensor.py to: {"temperature": {"numerical": True, "unit": "C"}},
Don't use °C, or it will figure it out and still convert it to F. I also use F, but prefer C for GPU temp. I also added the below lines to get Fan and load sensors: {"revolutionsPerMinutePercentage": {"unit": PERCENTAGE}}, {"load": {"unit": PERCENTAGE}}

My device stats stop updating after a while, not sure why. I manual refresh or core-restart brings them back.

qcasey commented 3 years ago

I sold off my cards, so unfortunately I won't be able to contribute more here as I can't test my work.

RomRider commented 2 years ago

This is superseded by #18, I'm going to close that.