Difference between revisions of "Drivers Code"

From Hubitat Documentation
Jump to: navigation, search
Line 6: Line 6:
  
 
#<big>The developer of the app will normally post a link to their driver code. Follow their directions to get to the source code.</big>
 
#<big>The developer of the app will normally post a link to their driver code. Follow their directions to get to the source code.</big>
#<big>Typically developers will use GitHub to host code. When copying the code, choose the '''RAW''' button so that you are getting the raw form of the code, with no HTML formatting.</big>[[File:GitHub raw button v2.png|none|thumb|600x600px]]
+
#<big>Typically developers will use GitHub to host code. When copying the code, choose the '''RAW''' button so that you are getting the raw form of the code, with no HTML formatting.</big>[[File:GitHub raw button v2.png|none|thumb|600x600px|link=https://docs.hubitat.com/images/5/5c/GitHub_raw_button_v2.png
 +
]]
 
#'''Select All''' the raw code, and then '''Copy''' the code.
 
#'''Select All''' the raw code, and then '''Copy''' the code.
 
#From your Hubitat Elevation<sup>®</sup> Web Interface, select '''Drivers Code''' in the side bar.
 
#From your Hubitat Elevation<sup>®</sup> Web Interface, select '''Drivers Code''' in the side bar.
#Select the ''+New Driver'' button in the upper right corner.[[File:New User Driver code 2.0.png|none|thumb|600x600px]]
+
#Select the ''+New Driver'' button in the upper right corner.[[File:New User Driver code 2.0.png|none|thumb|600x600px|link=https://docs.hubitat.com/images/5/54/New_User_Driver_code_2.0.png
#<big>In the blank text field, simply paste the driver code. Alternatively, you can select the '''Import''' button and past a URL to the developers code in raw text format.</big>[[File:Add user driver code 2.0.png|none|thumb|600x600px]]
+
]]
#<big>Select the '''Save''' button in the top right of the page. When the '''modified''' goes away, your driver is saved.</big>[[File:User Driver code unsaved 2.0.png|none|thumb|600x600px]]
+
#<big>In the blank text field, simply paste the driver code. Alternatively, you can select the '''Import''' button and past a URL to the developers code in raw text format.</big>[[File:Add user driver code 2.0.png|none|thumb|600x600px|link=https://docs.hubitat.com/images/0/01/Add_user_driver_code_2.0.png
 +
]]
 +
#<big>Select the '''Save''' button in the top right of the page. When the '''modified''' goes away, your driver is saved.</big>[[File:User Driver code unsaved 2.0.png|none|thumb|600x600px|link=https://docs.hubitat.com/images/4/47/User_Driver_code_unsaved_2.0.png
 +
]]
  
 
<big>'''Note:''' You may experience an error in this step. If you do, your driver will not save and it will not work. Please contact the developer of the driver in the forum. It is usually best if you take a screen shot to help them diagnose the problem. Once the code is fixed, come back and try again.</big>
 
<big>'''Note:''' You may experience an error in this step. If you do, your driver will not save and it will not work. Please contact the developer of the driver in the forum. It is usually best if you take a screen shot to help them diagnose the problem. Once the code is fixed, come back and try again.</big>
Line 19: Line 23:
 
<big>Once your driver has successfully saved, you will need to update your device(s) with the new driver.</big>
 
<big>Once your driver has successfully saved, you will need to update your device(s) with the new driver.</big>
  
#<big>From the home page of your hub, select '''Devices''' in the side bar.</big>[[File:Add Virtual Device 2.0.png|none|thumb|600x600px]]
+
#<big>From the home page of your hub, select '''Devices''' in the side bar.</big>[[File:Add Virtual Device 2.0.png|none|thumb|600x600px|link=https://docs.hubitat.com/images/5/5c/Add_Virtual_Device_2.0.png
#<big>Select '''+Add Virtual Device''' or select the device for which you want to change the driver type. This opens the '''Edit Device''' view. Scroll down to find the ''Type'' field. The name of a driver will be listed there.</big>[[File:Change driver type 2.0.png|none|thumb|600x600px]]
+
]]
 +
#<big>Select '''+Add Virtual Device''' or select the device for which you want to change the driver type. This opens the '''Edit Device''' view. Scroll down to find the ''Type'' field. The name of a driver will be listed there.</big>[[File:Change driver type 2.0.png|none|thumb|600x600px|link=https://docs.hubitat.com/images/7/72/Change_driver_type_2.0.png
 +
]]
 
#<big>Select the drop-down menu and then choose the new device driver that you want to use.</big>
 
#<big>Select the drop-down menu and then choose the new device driver that you want to use.</big>
#*<big>'''NOTE:''' Custom drivers appear at the bottom of the list under the heading ''User''.</big>[[File:Select User Devices 2.0.png|none|thumb|394x394px]]
+
#*<big>'''NOTE:''' Custom drivers appear at the bottom of the list under the heading ''User''.</big>[[File:Select User Devices 2.0.png|none|thumb|394x394px|link=https://docs.hubitat.com/images/6/6e/Select_User_Devices_2.0.png
#<big>Select the '''Save''' button to the left of your screen.</big>[[File:Save Device Driver 2.0.png|none|thumb|600x600px]]
+
]]
 +
#<big>Select the '''Save''' button to the left of your screen.</big>[[File:Save Device Driver 2.0.png|none|thumb|600x600px|link=https://docs.hubitat.com/images/f/fb/Save_Device_Driver_2.0.png]]
  
 
<big>Your driver is now installed and will used by that device.</big>
 
<big>Your driver is now installed and will used by that device.</big>

Revision as of 01:44, 23 March 2021

Go to the top of the page

Hubitat Elevation continues to add to its list of included drivers. However, the generous Hubitat community continues to create drivers for devices we haven't integrated yet. When you find one you want for your device, you will need to install it on your system.

Installing custom drivers

  1. The developer of the app will normally post a link to their driver code. Follow their directions to get to the source code.
  2. Typically developers will use GitHub to host code. When copying the code, choose the RAW button so that you are getting the raw form of the code, with no HTML formatting.
    GitHub raw button v2.png
  3. Select All the raw code, and then Copy the code.
  4. From your Hubitat Elevation® Web Interface, select Drivers Code in the side bar.
  5. Select the +New Driver button in the upper right corner.
    New User Driver code 2.0.png
  6. In the blank text field, simply paste the driver code. Alternatively, you can select the Import button and past a URL to the developers code in raw text format.
    Add user driver code 2.0.png
  7. Select the Save button in the top right of the page. When the modified goes away, your driver is saved.
    User Driver code unsaved 2.0.png

Note: You may experience an error in this step. If you do, your driver will not save and it will not work. Please contact the developer of the driver in the forum. It is usually best if you take a screen shot to help them diagnose the problem. Once the code is fixed, come back and try again.

Loading your custom driver

Once your driver has successfully saved, you will need to update your device(s) with the new driver.

  1. From the home page of your hub, select Devices in the side bar.
    Add Virtual Device 2.0.png
  2. Select +Add Virtual Device or select the device for which you want to change the driver type. This opens the Edit Device view. Scroll down to find the Type field. The name of a driver will be listed there.
    Change driver type 2.0.png
  3. Select the drop-down menu and then choose the new device driver that you want to use.
    • NOTE: Custom drivers appear at the bottom of the list under the heading User.
      Select User Devices 2.0.png
  4. Select the Save button to the left of your screen.
    Save Device Driver 2.0.png

Your driver is now installed and will used by that device.