Did you try a search in this forum ?
You are half way there with this !
https://forum.z-wave.me/viewtopic.php?f=3422&t=33319
Then my Arduino runs this, you could work out what it is doing and put that into a Python script.
void zwtemperature() //Tell zway the new temperature setting
{
zwaydevice=(F("HTTP_Device_switchMultilevel_276"));
zwaycommand=(F("exact?level="));
zwaycommand=zwaycommand+thermostat+'"';
zwayset();
}
void zwayset()
{
if (client.connect(server_zway, 8083)) //connect to zway
{
// client.print(F("GET /ZAutomation/api/v1/devices/ZWayVDev_zway_"));
client.print(F("GET /ZAutomation/api/v1/devices/"));
client.print(zwaydevice);
client.print(F("/command/"));
client.print(zwaycommand);
client.println(F(" HTTP/1.0")); // "on" or "off" or "update"
client.println(F("Authorization: Basic xxxxxxxxxxxxxxxxxx)); //BASE64 of username:password
client.println();
getresponse();
}
else
{
//Serial.println("connection to z-way failed");
}
I'm using HTTP Device, not Code Device this time.
screenshot of the settings
https://ibb.co/98kdrTX