-
-
Notifications
You must be signed in to change notification settings - Fork 565
Fix Home Assistant Energy Management #2584
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
base: master
Are you sure you want to change the base?
Changes from 4 commits
88954d2
ec72485
10ed086
293cfe3
7b4f01e
6dc22a2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -74,7 +74,7 @@ bool InverterAbstract::isProducing() | |
|
|
||
| bool InverterAbstract::isReachable() | ||
| { | ||
| return _enablePolling && Statistics()->getRxFailureCount() <= _reachableThreshold; | ||
| return _enablePolling && Statistics()->getRxFailureCount() <= _reachableThreshold && Statistics()->getLastUpdate() > 0; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This makes sense and should have gone into its own PR 😉 |
||
| } | ||
|
|
||
| void InverterAbstract::setEnablePolling(const bool enabled) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,7 +76,7 @@ void DatastoreClass::loop() | |
| if (inv->isReachable()) { | ||
| isReachable++; | ||
| } else { | ||
| if (inv->getEnablePolling()) { | ||
| if (cfg->Poll_Enable) { | ||
|
||
| _isAllEnabledReachable = false; | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style: This should be CamelCase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have replaced this with an even better implementation. Instead of blindly waiting a few iterations,
ac/is_validis published with QOS 1, and the data is only published once the topic is confirmed to be published.A less complex option would be to simply not publish data when
ac/is_valid=false. However, that would be backwards incompatible for non-HA uses of mqtt.