Hello.
I have been working on creating a helium device from an analysis.
I have added the correct connector id and network id, but I have been failing at updated the EUI.
This is the code I have to generate a new device:
my_account = Account(account_token)# get the device token from the scopenew_device = {'name': command_vars['serial_number'],'active': True,'visible': True,'connector': '605c9654da971900114d4550','network': '602275f9fc48a40018510a8a','tags': [{'key': 'owner', 'value': command_vars['user_id']}],'type':'immutable','chunk_period': 'month','chunk_retention': 2,'eui': command_vars['eui']}result = my_account.devices.create(new_device)context.log(result)
My result is successful but I don’t see an EUI in the device page.
I’m guessing I am not creating the token correctly.
What is the correct format?
Hi caioangelomotta,
I’m going to check this out internally and get back to you tomorrow.
Hi caioangelomotta
Using the Python SDK there’s no way you can set the EUI at the moment, you can add tags and config params.
Ok.
What about with the RESTful API?
Without being able to set the EUI I am unable to add a helium device programmatically.
Caio
Hi caioangelomotta,
You’ll need to use the Javascript SDK in order to be able to create the devices programmatically.
Hello.
I looked at the RESTful API and the Javascript SDK.
The right keyword is “serie_number” in the config string.
You can use the python SDK like so to set the EUI programmatically.
my_account = Account(account_token)# get the device token from the scopenew_device = { 'name': command_vars['serial_number'], 'active': True, 'visible': True, 'connector': '605c9654da971900114d4550', 'network': '602275f9fc48a40018510a8a', 'tags': [ {'key': 'owner', 'value': command_vars['user_id']} ], 'type':'immutable', 'chunk_period': 'month', 'chunk_retention': 2, 'serie_number': command_vars['eui']}result = my_account.devices.create(new_device)context.log(result)
Nice job caioangelomotta.
Hi caioangelomotta,
Today we’re releasing a new documentation for the Python SDK. I imagine you’d be interested in checking it out. 
Thank you! I will check it out.