dictionary:unitinformation:queryof
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
dictionary:unitinformation:queryof [2017/10/15 16:05] – James Sentman | dictionary:unitinformation:queryof [2023/02/13 14:52] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====Query==== | ====Query==== | ||
- | Send a status | + | If supported by the device being queried this will generate |
- | Some " | ||
===Usage: | ===Usage: | ||
**query** (unit name) | **query** (unit name) | ||
- | ===Optional Parameters: | ||
- | **with no wait** (returns immediately to the script without the data, but when the device responds the database will be updated and any ON/OFF scripts will be run then in response to the update. | ||
===Examples: | ===Examples: | ||
<code applescript> | <code applescript> | ||
- | --did someone manually turn on that smart lamp unit? | + | query “a non reporting Z-Wave switch" |
- | if (query "My Lamp with Smart Module" | + | |
- | write log "hey, who turned on the lamp" | + | |
- | end if | + | |
</ | </ | ||
- | <code applescript> | ||
- | --just update database if the state of the heater has changed | ||
- | query "Smart Heater Module" | ||
- | </ | ||
===Notes: | ===Notes: | ||
- | If you try to query a non-smart X10 unit or a non-UPB unit it will hold the script for up to 30 seconds waiting for a reply. If you reply is received the script | + | In very old versions of XTension the query verb was synchronous and would return the current value of the unit. While the scripting dictionary still shows such switches as “with no wait” and a timeout function these are no longer supported. All queries are asynchronous. The new value will be returned in the normal way as if a new value had been received from the unit. |
- | + | ||
- | <code applescript> | + | |
- | try | + | |
- | query " | + | |
- | write log "unit responded, power must be on" | + | |
- | on error | + | |
- | write log "unit failed to respond, check breakers!" | + | |
- | end try | + | |
- | </ | + | |
dictionary/unitinformation/queryof.1508083544.txt.gz · Last modified: 2023/02/13 14:51 (external edit)