# Change the device driver type using script

**URL:** <https://forum.inductiveautomation.com/t/change-the-device-driver-type-using-script/35027>\
**Category:** Ignition\
**Created:** [May 25, 2020, 9:46pm UTC](https://forum.inductiveautomation.com/t/change-the-device-driver-type-using-script/35027 "2020-05-25T21:46:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mauricio.salazar.urr](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@mauricio.salazar.urr](https://forum.inductiveautomation.com/u/mauricio.salazar.urr)\
**Post date:** [May 25, 2020, 9:46pm UTC](https://forum.inductiveautomation.com/t/change-the-device-driver-type-using-script/35027/1 "2020-05-25T21:46:22Z")

</div>

It may be basic but I would like to know if it is possible to change the driver of a device through a script in the console.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [May 25, 2020, 10:07pm UTC](https://forum.inductiveautomation.com/t/change-the-device-driver-type-using-script/35027/2 "2020-05-25T22:07:45Z")

</div>

There’s no way to simply change the type. You would need to capture the settings, remove the device, and re-add it using the new driver type. You will probably need to do some settings translations as the new driver may not use exactly the same names for its properties or indeed have the same properties at all.  
Functions [here](https://docs.inductiveautomation.com/display/DOC80/system.device) in the help.

Edit: I figured you could get the properties of an existing device, but now that I look at it more closely, listDevices returns a dataset and not a class object… Hopefully someone else in the know can clarify. @paul-griffith or @Kevin.Herron?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 26, 2020, 3:59pm UTC](https://forum.inductiveautomation.com/t/change-the-device-driver-type-using-script/35027/3 "2020-05-26T15:59:28Z")

</div>

This is basically never going to happen, because the list of common settings for device types is basically just ‘name’ and ‘description’. Literally everything else, including hostname, is not actually required/a part of every device driver, so it won’t map to other driver types.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [May 26, 2020, 8:38pm UTC](https://forum.inductiveautomation.com/t/change-the-device-driver-type-using-script/35027/4 "2020-05-26T20:38:49Z")

</div>

I understand that, but couldn’t it return a dictionary of settings? Exactly what you provide the addDevice function

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 26, 2020, 8:52pm UTC](https://forum.inductiveautomation.com/t/change-the-device-driver-type-using-script/35027/5 "2020-05-26T20:52:11Z")

</div>

It could, but it’s impossible to change now, because it would invariably break existing scripts. Adding another system function with a different format for the same information is also…unlikely to happen.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [May 26, 2020, 8:55pm UTC](https://forum.inductiveautomation.com/t/change-the-device-driver-type-using-script/35027/6 "2020-05-26T20:55:19Z")

</div>

Could an extra optional argument be added to existing function that changes the return to the params dictionary? (forgive my Java ignorance. Not sure if you can even change the return type of a function like python)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 26, 2020, 9:29pm UTC](https://forum.inductiveautomation.com/t/change-the-device-driver-type-using-script/35027/7 "2020-05-26T21:29:06Z")

</div>

Well, changing the signature is tricky on the Java side, but that doesn’t make it impossible. But, either way, not going to happen unless it’s asked for 🙂
