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

[FEATURE REQUEST] Opt-Out of Sensors and Agent Side Command Definitions #171

Open
cmprmsd opened this issue May 30, 2024 · 3 comments
Open
Labels
enhancement New feature or request

Comments

@cmprmsd
Copy link

cmprmsd commented May 30, 2024

Hey there!

  1. Would it be a lot of effort to make the built-in sensors configurable, so that I may turn off everything I don't need? That would lower power consumption and save resources.

  2. I tried adding turn screen off and on with dpms without locking the screen for my info panel and this was quite complicated as I had to write a python script that registers a new dbus service in order to use the arbitrary dbus PR that was merged recently. Of course I had to configure two buttons in the scripts configuration of hass in order to publish the according mqtt messages.
    Wouldn't it be nice to parse a commands.toml on the agent side where we can define commands and on launch the agent will register e.g. buttons or switches with ways to execute commands for each state of the switch. This could be enhanced with "query state" so that we could e.g. read if the monitor is really turned of or on.

I could fiddle with the code a bit but I'm more the offensive person who searches for vulns in apps. 😂 What do you think of the ideas?

@cmprmsd cmprmsd added the enhancement New feature or request label May 30, 2024
@joshuar
Copy link
Owner

joshuar commented May 31, 2024

Hey thanks for trying out the agent!

Indeed, currently there is no way to disable the sensors in the agent. However, you can disable the sensor entities in Home Assistant, and the agent will then stop sending updates for them. It won't stop gathering the data, so this is probably only half the solution you are looking for. I would like the ability to customise which sensors are enabled in the agent, so look out for a full solution in a future release 😄

I really like the idea of custom commands, that complements the existing custom sensors that are already supported. So is the idea, for a button:

  • You have a script that does something when run.
  • You specify in commands.toml the script, and that it should be a button with some name.
  • The agent creates the button with that name in Home Assistant and hooks it up to the script.
  • You press the button in Home Assistant, the script runs.

That's cool. It might need a little more configuration for a switch and other types, as the switch would probably need a way to get the current state and a way to change the state between two values. That could just be a few different command-line switches for the script though.

@joshuar
Copy link
Owner

joshuar commented Jun 17, 2024

Hey there. So v9.4.0 contains initial support for custom commands, though you will need Home Assistant and the agent configured with MQTT support. For the moment, just buttons are supported, but I intend to add switches (on/off) and number support. Check out the README for details on configuration and usage.

Having the ability turn on/off sensors is still a way away, but I've refactored some code to make this closer to reality. Look out for it in a future release!

@cmprmsd
Copy link
Author

cmprmsd commented Jun 18, 2024

Amazing! Looks very promising! 😊

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

No branches or pull requests

2 participants