Hi Sunil,
The Self-consumption dispatch option is available for behind-the-meter batteries in SAM 2023.12.17:
As for your PySAM question, my recommendation would be to set up a base case in SAM with the inputs you want, then use the code generator to generate JSON for PySAM files and get that case working in PySAM so that its results match SAM. Then you can identify the inputs to change in PySAM and change only those inputs.
For instructions, see the PySAM documentation:
nrel-pysam.readthedocs.io
Note that PySAM has not been updated to match SAM 2023.12.17 yet, so you should continue to work with SAM 2022.11.21 for this purpose until PySAM is updated.
Best regards,
Paul.