I have a victron multiplus 2.
I am trying to write the code so that AC2 out provides power whenever AC1 in has shore power OR whenever the aux input is closed. Obviously, I would still like power out when I have shore power AND the aux switch is closed.
I can write the code for the aux switch, but then the AC2 relay doesn’t automatically switch when shore power is connected.
I can write the code for the shore to switch the AC2 relay on, but the it ignores the aux switch.
Can anyone help by suggesting the correct code so that I can switch the AC2 relay on and off using shore power and/or the aux input?
Multiple Assistants can be used in one unit. For example the Programmable Relay is often used multiple times. When doing so; this is how they are evaluated:
- an ON condition always has priority over an OFF condition - multi criteria in the ON ( or OFF ) list go by the OR principle
Since you want an OR relation between the two inputs, you need at least three relay assistants, two to set the relay to on, and another to set it to off.
This should do the trick. First assistant sets the relay on when the ACin is available, OR second assistant set the relay on when the aux1 is closed, OR third assistant sets the relay off when both ACin is not available and Aux1 is open.
OR and AND relationships are not that obvious in the assistants, and its been a while since i last used one, so its possible that this also doesnt work as you wish.
I want to run OR for the ON function (hence 2 assistants) and AND for the OFF FUNCTION (combined in one assistant), as per the earlier code.
But however I try, I cannot produce the result I am looking for.
You state that Ac2 is always on when shore power is connected. Not true - as soon as I add an assistant to switch on ac2 via the aux1, it stops / overrides the automatic control of ac2 by the shore power.
Check out the code provided in the second reply. Do you agree that it should work? It meets the AND and OR requirements, but it simply doesn’t work.
(the one from chirgri) Your third one for the off condition both have to be true for it to be off. In other word if it is alreaady on, then it will just be on and not change state.
Add one for on if ac… One for off if ac…
Then add your aux for on condition. (Possibly you may have to move it up the list to above the off for ac not available.) Like suggested, maybe not.
It is very simple programming. Very easy to overcomplicate and then mess up the logic. There is no reasoning like in our heads.
I want EITHER condition (shore power OR aux 1) to switch on ac2. I want BOTH conditions (shore power removed AND aux1 off) to switch Ac2 off.
I believe the provided code should do this. But it doesn’t.
If I just add a single assistant to switch Ac2 on when aux1 closes, this works. But then shore power input doesn’t switch on ac2.
When I add two assistants, one for shore power on and the other for aux1 (which as 2 separate assistants means OR), both have to be on to activate ac2.
Is the logic wrong in my head, or is there an issue with the assistants and the ac2 relay?