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

Consider rebranding/readme from RPI specific to any Linux system? #70

Open
MaxVRAM opened this issue Nov 26, 2020 · 10 comments
Open

Consider rebranding/readme from RPI specific to any Linux system? #70

MaxVRAM opened this issue Nov 26, 2020 · 10 comments

Comments

@MaxVRAM
Copy link
Contributor

MaxVRAM commented Nov 26, 2020

Since there's been a bit of change to the code base and it now running nicely on any Linux system (personally have it running on aarch64, armv61 and x86 64/32 bit platforms), perhaps this tool should be rebranded and readme updated to reflect its potential.

I'm happy to dig through the readme if you're keen.

@MaxVRAM
Copy link
Contributor Author

MaxVRAM commented Nov 27, 2020

Now that I'm looking at it, It's really just the title. Could be worth adding a mention in the readme still.

@Sennevds
Copy link
Owner

Yeah the project evolved from RPI specific to something more general. Cleaning of the readme is always welcome!

@floriskruisselbrink
Copy link

Nice project! And I also really like to use this on non-rpi hosts (macmini running ubuntu in my case).

I think a little more work is involved. The mqtt config topics for home assistants autodiscovery still add 'RPI' as manufacturer and 'RPI {deviceName}' as model for all the devices created.

And personally I have at least one error running this on something non-rpi, the underVoltage stuff doesn't work. Is there a dependency missing in requirements.txt or should this maybe become disableable as well?

Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "src/system_sensors.py", line 66, in run
    self.execute(*self.args, **self.kwargs)
  File "src/system_sensors.py", line 109, in updateSensors
    + f'"power_status": "{get_rpi_power_status()}",'
  File "src/system_sensors.py", line 183, in get_rpi_power_status
    return _underVoltage.get()
AttributeError: 'NoneType' object has no attribute 'get'

_underVoltage doesn't seem to get initialized, because the from rpi_bad_power import new_under_voltage import doesn't do anything.

@Sennevds
Copy link
Owner

Undervoltage wouldn't work because this is RPI specific. You can disable it in the settings.
I will see when I got time to change the manufacture and model to something generic

@brantje
Copy link

brantje commented Mar 13, 2021

@Sennevds Thank you for this project, loving it. I've modified it a bit to suite my needs. You can find my changes here (diff).

  • Most of the code has been rewritten to use dictionaries
  • Less code duplication
  • Added support to monitor rust servers
  • Added network info
  • Screen is now controlled with CEC and vcgencmd
  • You can now set device name, model and manufacturer

In the future i want to extend it, make it more modular so different type of services can be monitored

@sturgeo
Copy link

sturgeo commented Apr 7, 2021

May I ask how you have it on other platforms?
I have this working great on r-pi's but when trying a Ubuntu VM the sensors get added to HA but all the values are unknown.

Edit: I've just started it manually rather than via the service and get the below:

python3 src/system_sensors.py src/settings.yaml send config message Connected to broker cat: /sys/class/thermal/thermal_zone0/temp: No such file or directory Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner self.run() File "src/system_sensors.py", line 66, in run self.execute(*self.args, **self.kwargs) File "src/system_sensors.py", line 104, in updateSensors + f'"temperature": {get_temp()},' File "src/system_sensors.py", line 149, in get_temp reading = check_output(["cat", "/sys/class/thermal/thermal_zone0/temp"]).dec ode("UTF-8") File "/usr/lib/python3.8/subprocess.py", line 411, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/usr/lib/python3.8/subprocess.py", line 512, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['cat', '/sys/class/thermal/thermal_zone 0/temp']' returned non-zero exit status 1.

Edit Again: I manually removed the temperature and power sensors from the code, all is working well now for a VM.

@MBombeck
Copy link

May I ask how you have it on other platforms?
I have this working great on r-pi's but when trying a Ubuntu VM the sensors get added to HA but all the values are unknown.

Edit: I've just started it manually rather than via the service and get the below:

python3 src/system_sensors.py src/settings.yaml send config message Connected to broker cat: /sys/class/thermal/thermal_zone0/temp: No such file or directory Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner self.run() File "src/system_sensors.py", line 66, in run self.execute(*self.args, **self.kwargs) File "src/system_sensors.py", line 104, in updateSensors + f'"temperature": {get_temp()},' File "src/system_sensors.py", line 149, in get_temp reading = check_output(["cat", "/sys/class/thermal/thermal_zone0/temp"]).dec ode("UTF-8") File "/usr/lib/python3.8/subprocess.py", line 411, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/usr/lib/python3.8/subprocess.py", line 512, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['cat', '/sys/class/thermal/thermal_zone 0/temp']' returned non-zero exit status 1.

Edit Again: I manually removed the temperature and power sensors from the code, all is working well now for a VM.

Can you share your version?

@sturgeo
Copy link

sturgeo commented Apr 11, 2021

system_sensors - Copy.txt

Can you share your version?

Please see attached, I've also renamed all the references from RPi to VM.

@MBombeck
Copy link

system_sensors - Copy.txt

Can you share your version?

Please see attached, I've also renamed all the references from RPi to VM.

Works on my vm perfectly well. Thank you <3

@mariomare22
Copy link

system_sensors - Copy.txt

Can you share your version?

Please see attached, I've also renamed all the references from RPi to VM.

Hello! thanks for this! works perfectly on ubuntu! only one thing, I am not getting available updates :-( what am I missing?

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

7 participants