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

My Solar PV Battery - Undefined object error when SOC field disabled #158

Open
jernaug opened this issue May 10, 2021 · 2 comments
Open

Comments

@jernaug
Copy link

jernaug commented May 10, 2021

My Solar PV Battery - Undefined object error when SOC field disabled
Reported by Neil Oakley

EmonCMS Error
Message: TypeError: undefined is not an object (evaluating ‘feeds[config.app.battery_soc.value].value’)
Route: app/view?name=My+Solar+Battery2
Line: 722
Column: 71

@jernaug
Copy link
Author

jernaug commented May 10, 2021

I’m able to reproduce the issue by disabling the SOC feed too. The issue seems to be due to
if (config.app.battery_soc.value)
evaluating to true when battery_soc has been disabled in the settings page. For me this then disabled access to the settings view when subsequently trying to access the app.

I managed to get access back to the settings view by modifying line 381 in mysolarpvbattery.php to set the optional property to false instead of true.
“battery_soc”:{“optional”:false, “type”:“feed”, “autoname”:“battery_soc”, “engine”:“5”, “description”:“Battery state of charge %”},

@FredM67
Copy link
Contributor

FredM67 commented Jun 11, 2021

When one of the feed is disabled, then the graph is broken...
Tried with "Wind"...

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