-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Add a Home Assistant Entity to Manually Force a Tariff Comparison #1994
Comments
Just to add, as a workaround for now. Under def initialize(self) in predbat.py I added
And then at the bottom of predbat.py
And finally I just manually created input_button.predbat_force_comparison in HA and this seems to work well for now |
Just another little update. In compare.py I also changed
to:
My hope is, that when the comparison runs, it will give me an estimated price from midnight tonight, to 11:59pm tomorrow. My goal is that once tomorrow's agile prices are released, I can have it run a comparison straight away, and then see which tariff is cheaper tomorrow, and switch to it. This one was just more as a test as well, but under def run_scenario(self, end_record), I added
This is more as a "worst case scenario" type thing, and have it assume the battery is empty at the start of the comparison |
* Compare active entity #1994 * [pre-commit.ci lite] apply automatic fixes * Update compare.md --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
**Is your feature request related to a problem? Please describe.
Currently, there is a "Force Comparison" button available in the Web UI. However, for users running PredBat in an AppDaemon container, the Web UI is not accessible. This means there is no easy way to trigger a tariff comparison from within Home Assistant.
Describe the solution you'd like
I would like a dedicated Home Assistant entity (e.g., input_boolean.predbat_force_comparison or button.predbat_force_comparison) that allows manually triggering a tariff comparison.
This entity should be available in Home Assistant so that automations, scripts, and UI interactions can trigger a tariff comparison.
When activated, it should set self.compare_tariffs = True inside PredBat, ensuring the comparison runs in the next cycle.
Describe alternatives you've considered
Manually restarting the AppDaemon container (which forces a comparison on startup after manually setting self.compare_tariffs = True on restart, but is inefficient).
Using Node-RED to call a custom API (but this requires modifying the AppDaemon script).
Using AppDaemon’s Web UI (but it is not accessible for users running PredBat inside a Home Assistant appdaemon container).
Additional context
This feature would be extremely useful for those of us running AppDaemon as a separate container, as it would allow direct control from Home Assistant without relying on external modifications or workarounds.
The text was updated successfully, but these errors were encountered: