The easiest method to get the device local key is to log into TuyaIOT and go to API Explorer and use Device Management > ‘Query device details’ and enter in your device ID. The local key is in the response returned.
https://eu.iot.tuya.com/cloud/explorer?groupId=group-1633641687672688668&interfaceId=1633017151335964700
(Linked updated)
And while you are in there, you can also retrieve the DP values for your device using:
Device Control > Query Properties
https://eu.iot.tuya.com/cloud/explorer?groupId=group-1633641501546254380&interfaceId=1633017088845021200
(Linked updated)
And your can get the valid values for each setting from here:
Device Control (Standard Instruction Set) > Get the specifications and properties of the device