Add new "3 to 1-phase switch current" number in installation#264
Conversation
* Add new number entity class `ZaptecThreeToOnePhaseSwitchCurrent()` * Add `Installation.set_three_to_one_switch_current()` method
|
I have the zaptec go 2 and would like to help with testing |
|
Had to figure out how to install the master branch with these changes merged into Home Assistant, but I managed it and I can say it is working great! By changing to 3to1 current setting to 32 I can force 1-phase and by setting it to 0 I can force 3-phase |
|
Thanks a lot for your work. I can confirm the behaviour. |
Thank you for testing
Thank you for testing My plans is to merge this into the next version, however its currently blocked by critical errors in 0.8.0 that have to be addressed first. Thank you for you patience.
I'm not sure how to do that in HA. There are three states available:
So this is not quite simple to put into a on-off-switch unfortunately. |
|
Then I'll have to do a little more thinking myself when I'm implementing my charge control with nodered. Thanks again. |
|
@steinmn since its tested by two users, lets bring this on board for 0.8.1 (as we have other critical fixes as well). Your review on this one would be much appreciated. |
steinmn
left a comment
There was a problem hiding this comment.
At some point I think it would be nice to avoid adding the three_to_one_phase_switch_current-entity for setups that don't support it anyway But since it's a little bit weird with the setting on the installation level and the model on the charger level, that can quickly get complicated, so I think we'll leave that as a future feature request.
I still think it would be a good idea to add a reminder in the readme that this setting will not do anything if you don't have the correct charger model, so that if/when we get bug reports about it not working, we can point to the explanation there.
Since my Zaptec Go doesn't support this, I haven't tested anything. Apart from an Any I would rather avoid, code looks good.
custom_components/zaptec/number.py
Outdated
| self._attr_native_value = self._get_zaptec_value() | ||
| self._attr_available = True | ||
|
|
||
| def _log_number(self, value: Any) -> None: |
There was a problem hiding this comment.
| def _log_number(self, value: Any) -> None: | |
| def _log_number(self, value: float) -> None: |
There was a problem hiding this comment.
I was really uncertain if I agreed to this. The function actually does not require value to be float, it can be anything. However the name and its usage seems to suggest so.
I fixed as suggested. For this usage, I agree this is best.
There was a problem hiding this comment.
Yes, if the function for instance had been named _log_value, I probably could have been persuaded to accept Any.
There was a problem hiding this comment.
You see, _log_value() is already used the base class for a slightly different purpose. That's the reason for it's somewhat strange name :D
Zaptec did tell us that they have future plans for "fixing" this somewhat strange placement in future updates. So I think we should wait until they add this feature in the right place. See #172 (comment)
Initially I had plans on just adding this entity for the chargers that supports it. But since this is a installation thing and not a charger thing, its not that easy. And while testing this on my system, which does not support phase switching, my installation now started reporting My thinking with this integration is that we're just a transparent proxy between HA and Zaptec Portal. We should not be stateful, nor should we interpret or filter the values. And we should not be documentation of how to use Zaptec. If Zaptec Portal presents |
|
Added README documentation section about this. |
| `available_current_phase3` to set the available current on individual phases. | ||
|
|
||
|
|
||
| ### 3 phase to 1 phase switch |
There was a problem hiding this comment.
(nitpick) I think the 3 phase current adjustment-headline above this one should also have ### for consistency, otherwise it goes 2-4-3 in the headline leveling
|
@steinmn Thank you very much |
Fixes #172
I do not have a system that support this function, so I am not able to any type of testing and verification of this. It would be nice if someone could chip in here.
ZaptecThreeToOnePhaseSwitchCurrent()Installation.set_three_to_one_switch_current()method