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

hardcoded sensor_power_load_no_var_loads sensor name in utils.py #459

Open
scruysberghs opened this issue Feb 12, 2025 · 1 comment
Open

Comments

@scruysberghs
Copy link

scruysberghs commented Feb 12, 2025

Describe the bug
A clear and concise description of what the bug is.
Whet you set a custom sensor for sensor_power_load_no_var_loads in the the EMHASS config file:
you still get the error :

ERROR - emhass.web_server - The retrieved JSON is empty, A sensor:sensor.power_load_no_var_loads may have 0 days of history, passed sensor may not be correct, or days to retrieve is set too heigh

To Reproduce
Steps to reproduce the behavior
Set a non default sensorname in the configfile and run a mpc or day ahead optimizer without passing the non default sensorname as runtime parameter

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Home Assistant installation type

  • Home Assistant OS
  • Home Assistant Supervised
  • Home Assistant Core

Your hardware

  • OS: HA OS, Windows, Linux, etc
  • Architecture: amd64, armhf, armv7, aarch64

EMHASS installation type

  • Add-on, Docker Standalone, Legacy Python virtual environment

Additional context
Add any other context about the problem here.

Created a PR for what where I think the problem is, line 615 in utils.py reads
if "var_model" not in runtimeparams.keys(): var_model = "sensor.power_load_no_var_loads"
while it should get the sensorname from the config file

@davidusb-geek
Copy link
Owner

It makes much more sense to go fetch the sensor name on the configuration.
I don't know why this was hard coded like that.
Thanks for the PR

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

2 participants