How to switch multiplus gx II inverter and bypass modes by local switch?

Hello, New user here. My plan is control multiplus with shelly relay to switch inverter to inverting mode or “on” mode. wich connectors do i have to connect shelly and how do i configure multiplus to read its inputs? i would like to control inverter to use batteries when electricity is expensive and when electricity is cheap it goes to the “on” mode when it charges batteries and also bypass mode. is it possible thorough virtual switch or node-red or what? please help :slight_smile: