<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.hubitat.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rob</id>
	<title>Hubitat Documentation - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.hubitat.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rob"/>
	<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Special:Contributions/Rob"/>
	<updated>2026-04-30T13:22:57Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://docs.hubitat.com/index.php?title=Common_Methods_Object&amp;diff=1625</id>
		<title>Common Methods Object</title>
		<link rel="alternate" type="text/html" href="https://docs.hubitat.com/index.php?title=Common_Methods_Object&amp;diff=1625"/>
		<updated>2019-03-03T00:56:14Z</updated>

		<summary type="html">&lt;p&gt;Rob: Added runInMillis&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These methods can be used in both Apps and Drivers&lt;br /&gt;
&lt;br /&gt;
==&amp;lt;code&amp;gt;getLocation&amp;lt;/code&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
'''Signature:'''&lt;br /&gt;
 Location getLocation()&lt;br /&gt;
&lt;br /&gt;
==&amp;lt;code&amp;gt;getTemperatureScale&amp;lt;/code&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
Gets the current temperature scale set for the hub.&lt;br /&gt;
&lt;br /&gt;
'''Signature:'''&lt;br /&gt;
 String getTemperatureScale()&lt;br /&gt;
&lt;br /&gt;
'''Parameters:'''&lt;br /&gt;
&lt;br /&gt;
none&lt;br /&gt;
&lt;br /&gt;
'''Returns:'''&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;F&amp;quot; or &amp;quot;C&amp;quot; based on the setting in the hub.&lt;br /&gt;
&lt;br /&gt;
==&amp;lt;code&amp;gt;now&amp;lt;/code&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
'''Signature:'''&lt;br /&gt;
 long now()&lt;br /&gt;
&lt;br /&gt;
==&amp;lt;code&amp;gt;timeOfDayIsBetween&amp;lt;/code&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
Check if a date is between two dates.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Signature:'''&lt;br /&gt;
 boolean timeOfDayIsBetween(Date start, Date stop, Date value[, TimeZone timeZone])&lt;br /&gt;
&lt;br /&gt;
'''Parameters:'''&lt;br /&gt;
&lt;br /&gt;
:start - The date to start comparison against.&lt;br /&gt;
:stop - The date to stop comparison against.&lt;br /&gt;
:value - The date to compare&lt;br /&gt;
:timezone - (Optional) The timezone to use for the comparison&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Returns:'''&lt;br /&gt;
&lt;br /&gt;
:true if the value date is between the start and stop dates, otherwise returns false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==&amp;lt;code&amp;gt;unschedule&amp;lt;/code&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
Remove any scheduled tasks.  If method is called without paramters, all schedules will be removed.&lt;br /&gt;
&lt;br /&gt;
'''Signature:'''&lt;br /&gt;
 void unschedule()&lt;br /&gt;
 void unschedule(handlerMethod)&lt;br /&gt;
&lt;br /&gt;
'''Parameters:'''&lt;br /&gt;
&lt;br /&gt;
:handlerMethod - Only remove schedules for this handlerMethod&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==&amp;lt;code&amp;gt;asynchttpGet&amp;lt;/code&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
Send an http GET request and return control to the calling code.  Any response from the call will be passed to the callback method.&lt;br /&gt;
&lt;br /&gt;
'''Signature:'''&lt;br /&gt;
 void asynchttpGet(callbackMethod, Map params, Map data = null)&lt;br /&gt;
&lt;br /&gt;
'''Parameters:'''&lt;br /&gt;
&lt;br /&gt;
:callbackMethod - The name of a callback method to send the response to.  Can be null if the response can be ignored.&lt;br /&gt;
:params - the parameters to use to build the http GET call.&lt;br /&gt;
:data - optional data to be passed to the callback method.&lt;br /&gt;
&lt;br /&gt;
==&amp;lt;code&amp;gt;runInMillis&amp;lt;/code&amp;gt;==&lt;br /&gt;
'''Signature:'''&lt;br /&gt;
 void runInMillis(Long delayInMilliSeconds, String handlerMethod, Map options = null)&lt;br /&gt;
&lt;br /&gt;
'''Parameters:'''&lt;br /&gt;
&lt;br /&gt;
:delayInMilliseconds - How long to wait until the handler should be called, don't expect that it will be called in exactly that time.&lt;br /&gt;
:handlerMethod - the name of a handler method in your driver or app. The method name should not contain parentheses.&lt;br /&gt;
:options - a Map of optional parameters. If you specify &amp;lt;code&amp;gt;[data: 'Some value']&amp;lt;/code&amp;gt; then &amp;lt;code&amp;gt;'Some value'&amp;lt;/code&amp;gt; will be passed to your handler method. You can pass lists, maps etc. as a data parameter.&amp;lt;!-- Does the overwrite parameter apply to runInMillis as with runIn? --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  private processQueue(Map queue) {&lt;br /&gt;
    if (isQueueEmpty(queue)) {&lt;br /&gt;
        sendEvent name: 'lifxdiscovery', value: 'complete'&lt;br /&gt;
        return&lt;br /&gt;
    }&lt;br /&gt;
    def data = getNext(queue)&lt;br /&gt;
    sendPacket data.ipAddress, data.packet&lt;br /&gt;
    runInMillis(queue.delay, 'processQueue', [data: queue])&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  runInMillis(50, 'processQueue', [data: queue])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==&amp;lt;code&amp;gt;Additional to be documented&amp;lt;/code&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
'''Signature:'''&lt;br /&gt;
 BigDecimal celsiusToFahrenheit(BigDecimal val)&lt;br /&gt;
 BigDecimal fahrenheitToCelsius(BigDecimal val)&lt;br /&gt;
 void httpGet(String uri, Closure closure)&lt;br /&gt;
 void httpGet(Map params, Closure closure)&lt;br /&gt;
 void httpPost(String uri, String body, Closure closure)&lt;br /&gt;
 void httpPost(Map params, Closure closure)&lt;br /&gt;
 void httpPutJson(String uri, String body, Closure closure)&lt;br /&gt;
 void httpPutJson(String uri, Map body, Closure closure)&lt;br /&gt;
 void httpPutJson(Map params, Closure closure)&lt;br /&gt;
 void httpPut(String uri, String body, Closure closure)&lt;br /&gt;
 void httpPut(Map params, Closure closure)&lt;br /&gt;
 void httpDelete(Map params, Closure closure)&lt;br /&gt;
 String getMACFromIP(String ipAddr)&lt;br /&gt;
 String convertTemperatureIfNeeded(BigDecimal value, String scale, Integer precision)&lt;br /&gt;
 Object parseJson(String stringToParse)&lt;br /&gt;
 GPathResult parseXML(String stringToParse)&lt;br /&gt;
 Map parseLanMessage(String stringToParse)&lt;br /&gt;
 void pauseExecution(Long millisecs)&lt;br /&gt;
 void runEvery1Minute(String handlerMethod, Map options = null)&lt;br /&gt;
 void runEvery5Minutes(String handlerMethod, Map options = null)&lt;br /&gt;
 void runEvery10Minutes(String handlerMethod, Map options = null)&lt;br /&gt;
 void runEvery15Minutes(String handlerMethod, Map options = null)&lt;br /&gt;
 void runEvery30Minutes(String handlerMethod, Map options = null)&lt;br /&gt;
 void runEvery1Hour(String handlerMethod, Map options = null)&lt;br /&gt;
 void runEvery3Hours(String handlerMethod, Map options = null)&lt;br /&gt;
 void runIn(Long delayInSeconds, String handlerMethod, Map options = null)&lt;br /&gt;
 void runOnce(Date dateTime, String handlerMethod, Map options = null)&lt;br /&gt;
 void runOnce(String dateTime, String handlerMethod, Map options = null)&lt;br /&gt;
 void schedule(Date dateTime, String handlerMethod, Map options = null)&lt;br /&gt;
 void schedule(String expression, String handlerMethod, Map options = null)&lt;br /&gt;
 void asynchttpGet(String callbackMethod = null, Map params, Map data = null)&lt;br /&gt;
 void asynchttpPost(String callbackMethod = null, Map params, Map data = null)&lt;br /&gt;
 void asynchttpPut(String callbackMethod = null, Map params, Map data = null)&lt;br /&gt;
 void asynchttpDelete(String callbackMethod = null, Map params, Map data = null)&lt;br /&gt;
 void asynchttpPatch(String callbackMethod = null, Map params, Map data = null)&lt;br /&gt;
 void asynchttpHead(String callbackMethod = null, Map params, Map data = null)&lt;br /&gt;
 Map textToSpeech(String stringToBeSynthesized, String voice = null)&lt;br /&gt;
 String encrypt(String value)&lt;br /&gt;
 String decrypt(String value)&lt;br /&gt;
 void sendLocationEvent(Map properties)&lt;br /&gt;
 void httpPostJson(String uri, String body, Closure closure)&lt;br /&gt;
 void httpPostJson(String uri, Map body, Closure closure)&lt;br /&gt;
 void httpPostJson(Map params, Closure closure)&lt;br /&gt;
 Date timeToday(String timeString, TimeZone timeZone = null)&lt;br /&gt;
 Date toDateTime(String dateTimeString)&lt;/div&gt;</summary>
		<author><name>Rob</name></author>
		
	</entry>
</feed>