I was going to post this question, but then I figured it out by looking at the …/cryosparc_command/command_rtp/init.py so now I am just going to post this for future reference.
My issue was that I wanted to add more exposure groups to a live session being created from a python script. Existing documentation didn’t seem to cover the answer (tutorial shows how to set up parameters of the one exposure created with the live session, but not how to add more).
So here it is: if you’d like to add more exposure groups via rtp, use this assuming that
rtp = client.CommandClient(host=host, port=command_rtp_port) // the usual
newid = rtp.exposure_group_add_new(project_uid, session_uid)
which returns the (integer) id of the new group that is then used in calls to rtp.exposure_group_update_value etc.
I have not tried that yet, but exposure groups can also be deleted with rtp.exposure_group_delete(project_uid, session_uid, exp_group_id). As far I can see following down the rabbit hole of reading the cryosparc python code, the exp_group_id assumes max(“existing exp_group_id”)+1 when a new group is added. So if you delete group #5 out of existing 9, next one will be #10 and #5 will never be reused. However, if you delete the last one (#9), its id will be reused.
Again, this ain’t really a question, so I am breaking some rules most likely, but I figured this could save time to someone else who will be, like me, trying to create multiple exposure groups via cli. Until documentation is updated, of course.