Replies: 1 comment
-
ok, so this is what I have done so far... on Sensors_custom
Followed by:
Actually im not Python coder, and im not sure if this logic works to count as graph:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
This is the first time I tried to develop the dashboard monitor for 3.5 screen.
Anybody have experience on create custom monitor for phys memory ?
First of all I initiate call the sensor from:
external/LibreHardwareMonitor/test_librehardwaremonitor.py
Then I get the result as:
Memory | Generic Memory | /ram
Data | Memory Used | 13.599735260009766
Data | Memory Available | 50.30704879760742
Load | Memory | 21.28057861328125
Data | Virtual Memory Used | 22.604106903076172
Data | Virtual Memory Available | 45.302677154541016
Load | Virtual Memory | 33.286964416503906
on customs sensors I tried to adapt the code like this:
class PHYSMEMORY(CustomDataSource):
def as_numeric(self) -> float:
ram = get_hw_and_update(Hardware.HardwareType.Memory)
for sensor in ram.Sensors:
if "MEMORY USED" in str(sensor.Name) and sensor.SensorType == Hardware.SensorType.Data:
return float(sensor.Value)
#return float(50)
logger.error("RAM DATA cannot be read")
return math.nan
def as_string(self) -> str:
return f'{int(self.as_numeric())}M'
at theme.yaml
CUSTOM:
INTERVAL: 1
PHYSMEMORY:
TEXT:
SHOW: True
X: 125
Y: 250
SHOW_TEXT: True
SHOW_UNIT: True
FONT: generale-mono/GeneraleMonoA.ttf
FONT_SIZE: 13
FONT_COLOR: 255, 255, 255
BACKGROUND_COLOR: 0, 0, 0
But I'm having an issues on the ERROR below:
9/4/2024 1:26:19 PM [ERROR] Error loading custom sensor class PHYSMEMORY from sensors_custom.py : cannot convert float NaN to integer
Im not sure if I call and get the values correctly, but seems like I still got an wrong idea how to get the value from LHM,
Hope someone can give some guide,
Cheers,
Raff
Beta Was this translation helpful? Give feedback.
All reactions