If your device is having a 6-character long ID, execute this command: http://<deviceip>/longifyid. The command will alter and extend the ID of your device, and you will be able to add it to your cloud account.
Please note that if the command does not work, then you have to update the firmware of the device first and then send the command again.
If the device is with 12-characters-long ID, login into the previous owner's account, click on pencil edit icon and then on the bin icon for the specific device
Then login back to the new account and include the device. In case you do not have access to the account to which device is assigned, please open a ticket with the Shelly Support Team to request to be released from the cloud.
Should you experience difficulties with the procedure, please, contact Shelly Technical support team for further assistance!