Is it possbile to change Orion XS Battery Profile Settings automatically (Modbus, Mqtt, NodeRed)?

Is it possible to automate switching the input and output of a Victron Orion XS using a relay, and at the same time have the charging profile (battery type, AGM or LiFePO4) automatically adjust accordingly? Or is the charging profile only configurable manually through the VictronConnect app?