Updated external content (Jenkins build 1453)

pull/2077/head
openHAB Build Server 2023-04-16 05:34:17 +00:00
parent 0ee3708e74
commit 2005b62586
5 changed files with 148 additions and 40 deletions

File diff suppressed because one or more lines are too long

View File

@ -3,7 +3,7 @@ id: folderwatcher
label: FolderWatcher
title: FolderWatcher - Bindings
type: binding
description: "This binding is intended to monitor FTP and local folder and its subfolders and notify of new files"
description: "This binding is intended to monitor FTP, local folder and S3 bucket and its subfolders and notify of new files"
since: 3x
install: manual
---
@ -14,55 +14,67 @@ install: manual
# FolderWatcher Binding
This binding is intended to monitor FTP and local folder and its subfolders and notify of new files
This binding is intended to monitor FTP, local folder and S3 bucket and its subfolders and notify of new files
## Supported Things
Currently the binding support two types of things: `ftpfolder` and `localfolder`.
Currently the binding support three types of things: `ftpfolder`, `localfolder` and `s3bucket`.
## Thing Configuration
The `ftpfolder` thing has the following configuration options:
| Parameter | Name | Description | Required | Default value |
|-------------|--------------|------------------------------------------------------------------------------------------------------------------------|----------|---------------|
| ftpAddress | FTP server | IP address of FTP server | yes | n/a |
| ftpPort | FTP port | Port of FTP server | yes | 21 |
| secureMode | FTP Security | FTP Security | yes | None |
| ftpUsername | Username | FTP user name | yes | n/a |
| ftpPassword | Password | FTP password | yes | n/a |
| ftpDir | RootDir | Root directory to be watched | yes | n/a |
| listRecursiveFtp | List Sub Folders | Allow listing of sub folders | yes | No |
| listHidden | List Hidden | Allow listing of hidden files | yes | false |
| connectionTimeout | Connection timeout, s | Connection timeout for FTP request | yes | 30 |
| pollInterval | Polling interval, s | Interval for polling folder changes | yes | 60 |
| diffHours | Time stamp difference, h | How many hours back to analyze | yes | 24 |
| Parameter | Name | Description | Required | Default value |
|-------------------|--------------------------|-------------------------------------|----------|---------------|
| ftpAddress | FTP server | IP address of FTP server | yes | n/a |
| ftpPort | FTP port | Port of FTP server | yes | 21 |
| secureMode | FTP Security | FTP Security | yes | None |
| ftpUsername | Username | FTP user name | yes | n/a |
| ftpPassword | Password | FTP password | yes | n/a |
| ftpDir | RootDir | Root directory to be watched | yes | n/a |
| listRecursiveFtp | List Sub Folders | Allow listing of sub folders | yes | No |
| listHidden | List Hidden | Allow listing of hidden files | yes | false |
| connectionTimeout | Connection timeout, s | Connection timeout for FTP request | yes | 30 |
| pollInterval | Polling interval, s | Interval for polling folder changes | yes | 60 |
| diffHours | Time stamp difference, h | How many hours back to analyze | yes | 24 |
The `localfolder` thing has the following configuration options:
| Parameter | Name | Description | Required | Default value |
|-------------|--------------|------------------------------------------------------------------------------------------------------------------------|----------|---------------|
| localDir | Local Directory | Local directory to be watched | yes | n/a |
| listHiddenLocal | List Hidden | Allow listing of hidden files | yes | No |
| pollIntervalLocal | Polling interval, s | Interval for polling folder changes | yes | 60 |
| listRecursiveLocal | List Sub Folders | Allow listing of sub folders | yes | No |
| Parameter | Name | Description | Required | Default value |
|--------------------|---------------------|-------------------------------------|----------|---------------|
| localDir | Local Directory | Local directory to be watched | yes | n/a |
| listHiddenLocal | List Hidden | Allow listing of hidden files | yes | No |
| pollIntervalLocal | Polling interval, s | Interval for polling folder changes | yes | 60 |
| listRecursiveLocal | List Sub Folders | Allow listing of sub folders | yes | No |
The `s3bucket` thing has the following configuration options:
| Parameter | Name | Description | Required | Default value |
|----------------|----------------------|----------------------------------------------------|----------|---------------|
| s3BucketName | S3 Bucket Name | Name of the S3 bucket to be watched | yes | n/a |
| s3Path | S3 Path | S3 path (folder) to be monitored | no | n/a |
| pollIntervalS3 | Polling Interval | Interval for polling S3 bucket changes, in seconds | yes | 60 |
| awsKey | AWS Access Key | AWS access key | no | n/a |
| awsSecret | AWS Secret | AWS secret | no | n/a |
| awsRegion | AWS Region | AWS region of S3 bucket | yes | "" |
| s3Anonymous | Anonymous Connection | Connect anonymously (works for public buckets) | yes | true |
## Events
This binding currently supports the following events:
| Channel Type ID | Item Type | Description |
|-----------------|--------------|----------------------------------------------------------------------------------------|
| newftpfile | String | A new file name discovered on FTP |
| newlocalfile | String | A new file name discovered on in local folder |
| Channel Type ID | Item Type | Description |
|-----------------|-----------|----------------------------|
| newfile | String | A new file name discovered |
## Full Example
Thing configuration:
```java
folderwatcher:localfolder:myLocalFolder [ localDir="/myfolder", pollIntervalLocal=60, listHiddenLocal="false", listRecursiveLocal="false" ]
folderwatcher:ftpfolder:myLocalFolder [ ftpAddress="X.X.X.X", ftpPort=21, secureMode="EXPLICIT", ftpUsername="username", ftpPassword="password",ftpDir="/myfolder/",listHidden="true",listRecursiveFtp="true",connectionTimeout=33,pollInterval=66,diffHours=25]
folderwatcher:localfolder:myLocalFolder [ localDir="/myfolder", pollIntervalLocal=60, listHiddenLocal="false", listRecursiveLocal="false" ]
folderwatcher:ftpfolder:myLocalFolder [ ftpAddress="X.X.X.X", ftpPort=21, secureMode="EXPLICIT", ftpUsername="username", ftpPassword="password", ftpDir="/myfolder/", listHidden="true", listRecursiveFtp="true", connectionTimeout=33, pollInterval=66, diffHours=25 ]
folderwatcher:s3bucket:myS3bucket [ s3BucketName="mypublic-bucket", pollIntervalS3=60, awsRegion="us-west-1", s3Anonymous="true" ]
```
### Using in a rule:
@ -72,10 +84,10 @@ FTP example:
```java
rule "New FTP file"
when
Channel 'folderwatcher:ftpfolder:XXXXX:newfile' triggered
Channel "folderwatcher:ftpfolder:myLocalFolder:newfile" triggered
then
logInfo('NewFTPFile', receivedEvent.toString())
logInfo("NewFTPFile", receivedEvent.toString())
end
```
@ -85,10 +97,23 @@ Local folder example:
```java
rule "New Local file"
when
Channel 'folderwatcher:localfolder:XXXXX:newfile' triggered
Channel "folderwatcher:localfolder:myFTPFolder:newfile" triggered
then
logInfo('NewLocalFile', receivedEvent.toString())
logInfo("NewLocalFile", receivedEvent.toString())
end
```
S3 bucket example:
```java
rule "New S3 file"
when
Channel "folderwatcher:s3bucket:myS3bucket:newfile" triggered
then
logInfo("NewS3File", receivedEvent.toString())
end
```

View File

@ -103,6 +103,7 @@ The thermostat information that is retrieved is available as these channels:
| today_cool_runtime | Number:Time | The total number of minutes of cooling run-time today |
| yesterday_heat_runtime | Number:Time | The total number of minutes of heating run-time yesterday |
| yesterday_cool_runtime | Number:Time | The total number of minutes of cooling run-time yesterday |
| message | String (Write Only) | Used to display a number in the upper left 'price message' area of the thermostat's screen where the time is normally displayed |
## Full Example
@ -173,15 +174,16 @@ Number Therm_FanStatus "Fan Status [MAP(radiotherm.map):%s_fstus]"
Number Therm_Override "Override [MAP(radiotherm.map):%s_over]" { channel="radiothermostat:rtherm:mytherm1:override" }
Switch Therm_Hold "Hold" { channel="radiothermostat:rtherm:mytherm1:hold" }
Number Therm_Day "Thermostat Day [%s]" { channel="radiothermostat:rtherm:mytherm1:day" }
Number Therm_Hour "Thermostat Hour [%s]" { channel="radiothermostat:rtherm:mytherm1:hour" }
Number Therm_Minute "Thermostat Minute [%s]" { channel="radiothermostat:rtherm:mytherm1:minute" }
Number Therm_Day "Thermostat Day [%d]" { channel="radiothermostat:rtherm:mytherm1:day" }
Number Therm_Hour "Thermostat Hour [%d]" { channel="radiothermostat:rtherm:mytherm1:hour" }
Number Therm_Minute "Thermostat Minute [%d]" { channel="radiothermostat:rtherm:mytherm1:minute" }
String Therm_Dstmp "Thermostat DateStamp [%s]" <time> { channel="radiothermostat:rtherm:mytherm1:dt_stamp" }
Number:Time Therm_todayheat "Today's Heating Runtime [%d %unit%]" { channel="radiothermostat:rtherm:mytherm1:today_heat_runtime" }
Number:Time Therm_todaycool "Today's Cooling Runtime [%d %unit%]" { channel="radiothermostat:rtherm:mytherm1:today_cool_runtime" }
Number:Time Therm_yesterdayheat "Yesterday's Heating Runtime [%d %unit%]" { channel="radiothermostat:rtherm:mytherm1:yesterday_heat_runtime" }
Number:Time Therm_yesterdaycool "Yesterday's Cooling Runtime [%d %unit%]" { channel="radiothermostat:rtherm:mytherm1:yesterday_cool_runtime" }
String Therm_Message "Message: [%s]" { channel="radiothermostat:rtherm:mytherm1:message" }
// Override the thermostat's temperature reading with a value from an external sensor, set to -1 to revert to internal temperature mode
Number:Temperature Therm_Rtemp "Remote Temperature [%d]" <temperature> { channel="radiothermostat:rtherm:mytherm1:remote_temp" }
@ -243,5 +245,30 @@ then
// JSON to send directly to the thermostat's '/tstat' endpoint
// See RadioThermostat_CT50_Honeywell_Wifi_API_V1.3.pdf for more detail
actions.sendRawCommand('{"hold":1, "t_heat":' + "68" + ', "tmode":1}')
// Also a command can be sent to a specific endpoint on the thermostat by
// specifying it as the second argument to sendRawCommand():
// Reboot the thermostat
// actions.sendRawCommand('{"command": "reboot"}', 'sys/command')
// Control the energy LED (CT80 only) [0 = off, 1 = green, 2 = yellow, 4 = red]
// actions.sendRawCommand('{"energy_led": 1}', 'tstat/led')
// Send a message to the User Message Area (CT80 only)
// actions.sendRawCommand('{"line": 0, "message": "Hello World!"}', 'tstat/uma')
end
rule "Display outside temp in thermostat message area"
when
// An item containing the current outside temperature
Item OutsideTemp changed
then
// Display up to 5 numbers in the thermostat's Price Message Area (PMA)
// A decimal point can be used. CT80 can display a negative '-' number
// Send null or empty string to clear the number and restore the time display
var Number temp = Math.round((OutsideTemp.state as DecimalType).doubleValue).intValue
Therm_Message.sendCommand(temp)
end
```

View File

@ -62,13 +62,13 @@
</parameter>
<parameter name="connectionTimeout" type="integer" min="1" unit="s">
<label>Connection Timeout</label>
<description>Connection timeout for FTP request, sec</description>
<description>Connection timeout for FTP request, in seconds</description>
<default>30</default>
<advanced>true</advanced>
</parameter>
<parameter name="pollInterval" type="integer" min="1" unit="s">
<label>Polling Interval</label>
<description>Interval for polling folder changes, sec</description>
<description>Interval for polling folder changes, in seconds</description>
<default>60</default>
<advanced>true</advanced>
</parameter>
@ -105,7 +105,7 @@
</parameter>
<parameter name="pollIntervalLocal" type="integer" min="1" unit="s">
<label>Polling Interval</label>
<description>Interval for polling folder changes, sec</description>
<description>Interval for polling folder changes, in seconds</description>
<default>60</default>
<advanced>true</advanced>
</parameter>
@ -123,4 +123,50 @@
</parameter>
</config-description>
</thing-type>
<thing-type id="s3bucket">
<label>AWS S3 Bucket</label>
<description>AWS S3 bucket to be watched</description>
<channels>
<channel id="newfile" typeId="newfile-channel"/>
</channels>
<config-description>
<parameter name="s3BucketName" type="text" required="true">
<label>S3 Bucket Name</label>
<description>Name of the S3 bucket to be watched</description>
</parameter>
<parameter name="s3Path" type="text">
<label>S3 Path</label>
<description>S3 path (folder) to be monitored</description>
</parameter>
<parameter name="awsRegion" type="text" required="true">
<label>AWS Region</label>
<description>AWS region of S3 bucket</description>
</parameter>
<parameter name="pollIntervalS3" type="integer" min="1" unit="s">
<label>Polling Interval</label>
<description>Interval for polling S3 bucket changes, in seconds</description>
<default>60</default>
<advanced>true</advanced>
</parameter>
<parameter name="s3Anonymous" type="boolean">
<label>Anonymous Connection</label>
<default>false</default>
<description>Connect anonymously (works for public buckets)</description>
<advanced>true</advanced>
</parameter>
<parameter name="awsKey" type="text">
<label>AWS Access Key</label>
<description>AWS access key</description>
<advanced>true</advanced>
</parameter>
<parameter name="awsSecret" type="text">
<label>AWS Secret</label>
<description>AWS secret</description>
<context>password</context>
<advanced>true</advanced>
</parameter>
</config-description>
</thing-type>
</thing:thing-descriptions>

View File

@ -31,10 +31,14 @@
<channel id="today_cool_runtime" typeId="today_cool_runtime"/>
<channel id="yesterday_heat_runtime" typeId="yesterday_heat_runtime"/>
<channel id="yesterday_cool_runtime" typeId="yesterday_cool_runtime"/>
<channel id="message" typeId="message"/>
</channels>
<config-description-ref uri="thing-type:radiothermostat:thermostatconfig"/>
<properties>
<property name="thingTypeVersion">1</property>
</properties>
<config-description-ref uri="thing-type:radiothermostat:thermostatconfig"/>
</thing-type>
<channel-type id="temp-temperature">
@ -187,4 +191,10 @@
<state readOnly="true" pattern="%d %unit%"/>
</channel-type>
<channel-type id="message" advanced="true">
<item-type>String</item-type>
<label>Message</label>
<description>Use this channel to display a number in the price message area</description>
</channel-type>
</thing:thing-descriptions>