Difference between revisions of "How to Troubleshoot Apps or Devices"

From Hubitat Documentation
Jump to: navigation, search
(Created page with "= <big>How to Troubleshoot Apps or Devices</big> = <big>Is an app not working as expected? Or, is a device not working like you think it should? If so, start here for some tro...")
 
(Replaced content with " <big>'''We're moving!''' Please visit http://docs2.hubitat.com for the latest documentation.</big> <big> This document is available at: http://docs2.hubitat.com/en/how-t...")
(Tag: Replaced)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
= <big>How to Troubleshoot Apps or Devices</big> =
 
<big>Is an app not working as expected? Or, is a device not working like you think it should? If so, start here for some troubleshooting tips!</big>
 
  
== <big>App Troubleshooting</big> ==
+
<big>'''We're moving!''' Please visit http://docs2.hubitat.com for the latest documentation.</big>
<big>Is an app not working as expected? For example:</big>
 
  
* <big>Rule Machine, Basic Rule, Simple Automation Rule, or other app fails to turn on/off device when you think it should;</big>
+
<big>
* <big>Motion Lighting does not turn on or off lights when you think they should; or</big>
+
This document is available at: http://docs2.hubitat.com/en/how-to/troubleshoot-apps-or-devices
* <big>Any problem you believe to be related to an app (automation) you have configured on your hub.</big>
+
</big>
 
 
<big>If so, here are some tips that may help.</big>
 
 
 
=== <big>Enable Logging</big> ===
 
<big>Most apps have one or more types of logging that can be enabled. For example, Rule Machine rules have a '''Logging''' option that allows you to enable one or more of '''Trigger''', '''Action''', and '''Event''' logging. Enabling '''Action''' logging in particular will tell you what actions the rule is executing when (though enabling all may be helpful) and is a good first step to answering questions like "why didn't my rule run?" (perhaps it did and your devices simply didn't respond as expected, or it will reveal issues with your rule logic):</big>
 
[[File:Rule-5.1-Enable-Logging.png|alt=Action, Trigger, and Event logging options in Rule 5.1 shown as checkboxes|none|thumb]]
 
<big>Most simpler apps have a toggle to enable all informational. For example, in Motion Lighting:</big>
 
[[File:Enable-Log-Motion-Lighting.png|alt="Enable debug logging" option in Motion Lighting app|none|thumb]]
 
<big>Other apps may have different options (and custom/community apps may vary), but most built-in apps offer one or more logging options similar to the above that may help.</big>
 
 
 
=== <big>Check Logs</big> ===
 
<big>Check the [[Logs|Logs page]] (current logs or past logs) to see logs that apps may generate if logging is enabled as described above.</big>
 
 
 
<big>With or without any kind of app (or device) logging enabled specifically, you may also wish to scan the logs for "error" or "warning" lines that may indicate a problem.</big>
 
 
 
=== <big>Verify Configuration</big> ===
 
<big>Ensure the options you have selected in the app are the correct selections to achieve your desired outcome. The Apps documentation section may be helpful. For Rule Machine rules or other complicated (or not!) apps, it may be helpful to ask the [https://community.hubitat.com Community] to look at your rule or other app configuration. For rules, it is generally helpful to post:</big>
 
 
 
* <big>A screenshot or description of your entire rule, including triggers and actions to run (and required expression, if used)</big>
 
* <big>A description of what you want the rule to do (in plain language, not thinking of rule implementation details)</big>
 
* <big>A screenshot of any relevant output from "Logs" (try enabling them as described above if you believe the actions are not running when or how you think they should)</big>
 
 
 
=== <big>Test Devices</big> ===
 
<big>If the app appears to be configured correctly and logging suggests it should be sending commands to devices correctly, perhaps there is a problem with the device. Try navigating to '''Devices''', selecting the device in question, and manually running commands (buttons at the top of the [[Device Detail|device detail page]]) to see if they work as expected. For example, a switch device may present <code>On</code> and <code>Off</code> commands, and they would be a good idea to test if you're troubleshooting an app that is supposed to turn the device on or off.</big>
 
 
 
== <big>Device Troubleshooting</big> ==
 
<big>Is a device not working as you expect? For example:</big>
 
 
 
* <big>A device is not updating states (e.g., on/off switch state) on the hub when the actual device changes or doesn't appear to respond to commands;</big>
 
* <big>A device is unable to be paired to the hub; or</big>
 
* <big>Any problem you believe to be related to a device you have added to your hub.</big>
 
 
 
=== <big>Test Device</big> ===
 
<big>To help verify if a device is working correctly, try navigating to '''Devices''', selecting the device in question, and manually running commands (buttons at the top of the [[Device Detail|device detail page]]) to see if they work as expected. The goal is to test by manually running commands from the device page to see if the command works here; if it does not, then it will not work with any app, either (including Hubitat® Dashboard, Rule Machine, Motion Lighting, or any built-in or custom app).</big>
 
 
 
<big>For example, a dimmer or bulb should have a <code>Set Level</code> command (and many others). For this command, type a level value (for example, '''50'''), then select the <code>Set Level</code> button itself to run the command. Verify that the device responds as expected. Try other commands if needed, ideally ones you think the app would be calling based on what the app should be doing, if you are troubleshooting a device as part of an app/automation.</big>
 
 
 
<big>If commands appear to work here, additional troubleshooting with the app in question may be necessary (see above).</big>
 
 
 
=== <big>Enable Logging</big> ===
 
<big>Most device drivers offer an '''Enable debug logging''' option, which (when enabled) will generally log information that comes into the hub from the device. This can be helpful to determine if/how this information becomes an event, such as "switch on" or "level is 50%" but provides view closer to the "raw" data from the device before it gets parsed into an event (or not). Some drivers may also log when commands are executed, but not all do; most apps offer an option that will indicate when they are running a command (see above) and will be more helpful in such cases.</big>
 
 
 
<big>Most drivers also offer an '''Enable descriptionText logging''' option. This generally logs events, like "switch on" or "thermostat operating state is heating." This does ''not'' show when commands are executed, simply when the device sends information to the hub and the driver creates an event. Its use in troubleshooting is therefore more limited than debug logging on devices or most app logging, but it may still be helpful.</big>
 
[[File:Enable-info-or-debug-log.jpg|alt="Enable debug logging" and "Enable descriptionText logging" options in a typical driver|none|thumb]]
 
<big>These descriptions apply to built-in drivers. Custom code (community drivers) may vary, though third-party developers are encouraged to offer similar options.</big>
 
 
 
=== <big>Check Logs</big> ===
 
<big>Check the Logs page (current logs or past logs) to see logs that device drivers may generate if logging is enabled as described above.</big>
 
 
 
<big>With or without logging enabled, errors that the driver does not handle are automatically logged. Thus, even before enabling logging, you can still scan the '''Logs''' page for "error" entries that may indicate a problem (but it is generally helpful to enable).</big>
 
 
 
=== <big>Other Device Troubleshooting</big> ===
 
 
 
* <big>Check the Compatible Device List to verify you are using the recommended built-in driver for your specific device (or for third-party code, verify that the driver is supposed to be compatible)</big>
 
* <big>It is generally recommended to run the <code>Configure</code> command on the device page after switching drivers. Try this if you haven't.</big>
 
* <big>The <code>Configure</code> command can also be run manually as part of troubleshooting specific device problems, including a Zigbee device not reporting updated states back to the hub as expected (note that you will ''not'' see anything happen on the device page when this command is executed; you ''may'' see entries in Logs)</big>
 
 
 
<big>''Select (click or tap) the "Configure" button to execute the command, then wait a few seconds. Normally, you will not see anything happen after executing the command, but it may be important in order for the driver to work correctly.''</big>
 
 
 
== <big>Soft Reset</big> ==
 
<big>For cases of suspected database corruption (for example, apps with "Scheduled Jobs" that appear to be scheduled correctly but do not execute when expected; SQL errors in Logs; and others), a soft reset and restore from a backup may help. As long as the radios are ''not'' reset, a soft reset is a generally safe procedure. To perform a soft reset:</big>
 
 
 
# <big>Download a backup from '''Settings''' > '''Backup and Restore''' by selecting '''Download''' under '''Create New Backup and Download Locally'''.</big>
 
#* <big>Save this file locally to your computer (Hub Protect subscribers may opt to make a cloud backup instead)</big>
 
# <big>Navigate to the [[Hubitat Diagnostic Tool]] from '''Settings''' > '''Diagnostic Tool'''.</big>
 
# <big>Select '''Soft Reset''' and follow the prompts.</big>
 
#* <big>You may wish to navigate to '''Settings''' > '''Hub Details''' before this to obtain the MAC address of your hub, which you may be prompted for.</big>
 
# <big>When the hub reboots after the soft reset, select the '''Restore from backup?''' link at the bottom of the Getting Started screen, then select the backup you downloaded in step 1 as the file to restore, follow the prompts, and wait for the process to complete.</big>
 
# <big>The hub will automatically reboot when finished, now operating with the restored/cleaned database.</big>
 
 
 
== <big>Problems After Upgrading?</big> ==
 
<big>Did you recently update your hub and suspect that the upgrade "broke" an existing device or automation? Hubitat allows you to downgrade to up to three previously installed platform versions. You can downgrade to test again and verify your suspicion.</big>
 
 
 
# <big>Optional, but recommended: download a backup from '''Settings''' > '''Backup and Restore''' by selecting '''Download''' under '''Create New Backup and Download Locally'''.</big>
 
#* <big>Save this file locally to your computer (Hub Protect subscribers may opt to make a cloud backup instead)</big>
 
# <big>Navigate to the [[Hubitat Diagnostic Tool]] from '''Settings''' > '''Diagnostic Tool'''.</big>
 
# <big>Select '''Restore Previous Version''' and select the specific previous version to which you wish to restore.</big>
 
# <big>Wait for the process to complete. The hub will automatically reboot.</big>
 
# <big>Re-test the app or automation. (Optionally, re-upgrade to verify the problem re-appears and was not addressed by a simple reboot.) If you believe you have found a problem, you may wish to ask about it in the [https://community.hubitat.com Hubitat Community].</big>
 

Latest revision as of 21:20, 30 September 2022

We're moving! Please visit http://docs2.hubitat.com for the latest documentation.

This document is available at: http://docs2.hubitat.com/en/how-to/troubleshoot-apps-or-devices