Compare commits

...

5 Commits

Author SHA1 Message Date
eugen
7a9c7c2e57
Merge 334fffc31f into d36b2a8d82 2025-01-08 13:50:23 -07:00
jimtng
d36b2a8d82
[basicprofiles] Add a table-of-contents at top of README.md (#18058)
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2025-01-08 20:15:25 +01:00
Mark Herwege
5ac2780749
fix offline when image not available (#18066)
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
2025-01-08 20:03:21 +01:00
Eugen Freiter
334fffc31f add new line to properties file
Signed-off-by: Eugen Freiter <freiter@gmx.de>
2024-12-25 14:20:04 +01:00
Eugen Freiter
05365effeb add listen to network changes switch
Signed-off-by: Eugen Freiter <freiter@gmx.de>
2024-12-25 14:00:47 +01:00
8 changed files with 62 additions and 20 deletions

View File

@ -365,13 +365,19 @@ public class SpeedtestHandler extends BaseThingHandler {
isp = tmpCont.getIsp();
interfaceInternalIp = tmpCont.getInterface().getInternalIp();
interfaceExternalIp = tmpCont.getInterface().getExternalIp();
resultUrl = tmpCont.getResult().getUrl();
String url = String.valueOf(resultUrl) + ".png";
logger.debug("Downloading result image from: {}", url);
RawType image = HttpUtil.downloadImage(url);
if (image != null) {
resultImage = image;
if (tmpCont.getResult().isPersisted()) {
resultUrl = tmpCont.getResult().getUrl();
String url = String.valueOf(resultUrl) + ".png";
logger.debug("Downloading result image from: {}", url);
RawType image = HttpUtil.downloadImage(url);
if (image != null) {
resultImage = image;
} else {
resultImage = UnDefType.NULL;
}
} else {
logger.debug("Result image not persisted");
resultUrl = "";
resultImage = UnDefType.NULL;
}

View File

@ -263,6 +263,9 @@ public class ResultContainer {
@SerializedName("url")
@Expose
private String url;
@SerializedName("persisted")
@Expose
private boolean persisted;
public String getId() {
return id;
@ -279,6 +282,14 @@ public class ResultContainer {
public void setUrl(String url) {
this.url = url;
}
public boolean isPersisted() {
return persisted;
}
public void setPersisted(boolean persisted) {
this.persisted = persisted;
}
}
public class Server {

View File

@ -96,23 +96,25 @@ org.openhab.homekit:blockUserDeletion=false
org.openhab.homekit:name=openHAB
org.openhab.homekit:instances=1
org.openhab.homekit:useDummyAccessories=false
org.openhab.homekit:listenToNetworkChanges=true
```
Some settings are only visible in UI if the checkbox "Show advanced" is activated.
### Overview of all settings
| Setting | Description | Default value |
|:-------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------|
| networkInterface | IP address or domain name under which the HomeKit bridge can be reached. If no value is configured, the add-on uses the primary IP address configured for openHAB. If unsure, keep it empty | (none) |
| port | Port under which the HomeKit bridge can be reached. | 9123 |
| useOHmDNS | mDNS service is used to advertise openHAB as HomeKit bridge in the network so that HomeKit clients can find it. openHAB has already mDNS service running. This option defines whether the mDNS service of openHAB or a separate service should be used. | false |
| blockUserDeletion | Blocks HomeKit user deletion in openHAB and as result unpairing of devices. If you experience an issue with accessories becoming non-responsive after some time, try to enable this setting. You can also enable this setting if your HomeKit setup is done and you will not re-pair ios devices. | false |
| pin | Pin code used for pairing with iOS devices. Apparently, pin codes are provided by Apple and represent specific device types, so they cannot be chosen freely. The pin code 031-45-154 is used in sample applications and known to work. | 031-45-154 |
| useFahrenheitTemperature | Set to true to use Fahrenheit degrees, or false to use Celsius degrees. Note if an item has a QuantityType as its state, this configuration is ignored and it's always converted properly. | false |
| name | Name under which this HomeKit bridge is announced on the network. This is also the name displayed on the iOS device when searching for available bridges. | openHAB |
| instances | Defines how many bridges to expose. Necessary if you have more than 149 accessories. Accessories must be assigned to additional instances via metadata. Additional bridges will use incrementing port numbers. | 1 |
| useDummyAccessories | When an accessory is missing, substitute a dummy in its place instead of removing it. See [Dummy Accessories](#dummy-accessories). | false |
| Setting | Description | Default value |
|:--------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------|
| networkInterface | IP address or domain name under which the HomeKit bridge can be reached. If no value is configured, the add-on uses the primary IP address configured for openHAB. If unsure, keep it empty | (none) |
| port | Port under which the HomeKit bridge can be reached. | 9123 |
| useOHmDNS | mDNS service is used to advertise openHAB as HomeKit bridge in the network so that HomeKit clients can find it. openHAB has already mDNS service running. This option defines whether the mDNS service of openHAB or a separate service should be used. | false |
| blockUserDeletion | Blocks HomeKit user deletion in openHAB and as result unpairing of devices. If you experience an issue with accessories becoming non-responsive after some time, try to enable this setting. You can also enable this setting if your HomeKit setup is done and you will not re-pair ios devices. | false |
| pin | Pin code used for pairing with iOS devices. Apparently, pin codes are provided by Apple and represent specific device types, so they cannot be chosen freely. The pin code 031-45-154 is used in sample applications and known to work. | 031-45-154 |
| useFahrenheitTemperature | Set to true to use Fahrenheit degrees, or false to use Celsius degrees. Note if an item has a QuantityType as its state, this configuration is ignored and it's always converted properly. | false |
| name | Name under which this HomeKit bridge is announced on the network. This is also the name displayed on the iOS device when searching for available bridges. | openHAB |
| instances | Defines how many bridges to expose. Necessary if you have more than 149 accessories. Accessories must be assigned to additional instances via metadata. Additional bridges will use incrementing port numbers. | 1 |
| useDummyAccessories | When an accessory is missing, substitute a dummy in its place instead of removing it. See [Dummy Accessories](#dummy-accessories). | false |
| listenToNetworkChanges | Listen to network changes, e.g. changes of IP addresses, and restart HomeKit bridge. Disable in case of connectivity issues with HomeKit bridge. | true |
## Item Configuration

View File

@ -412,10 +412,10 @@ public class HomekitImpl implements Homekit, NetworkAddressChangeListener, Ready
@Override
public synchronized void onChanged(final List<CidrAddress> added, final List<CidrAddress> removed) {
logger.trace("HomeKit bridge reacting on network interface changes.");
if (!started) {
if (!started || !settings.listenToNetworkChanges) {
return;
}
logger.trace("HomeKit bridge reacting on network interface changes.");
removed.forEach(i -> {
logger.trace("removed interface {}", i.getAddress().toString());
if (i.getAddress().equals(networkInterface)) {

View File

@ -34,6 +34,7 @@ public class HomekitSettings {
public boolean useFahrenheitTemperature = false;
public boolean useOHmDNS = false;
public boolean blockUserDeletion = false;
public boolean listenToNetworkChanges = true;
public String networkInterface;
@Override
@ -69,6 +70,8 @@ public class HomekitSettings {
return false;
} else if (!blockUserDeletion != other.blockUserDeletion) {
return false;
} else if (!listenToNetworkChanges != other.listenToNetworkChanges) {
return false;
} else if (!pin.equals(other.pin)) {
return false;
} else if (!setupId.equals(other.setupId)) {

View File

@ -81,5 +81,11 @@
<default>false</default>
<advanced>true</advanced>
</parameter>
<parameter name="listenToNetworkChanges" type="boolean" required="false" groupName="core">
<label>Listen to network changes</label>
<description>Listen to changes on the network interface, e.g. changing of IP address, and restart HomeKit bridge.</description>
<default>true</default>
<advanced>true</advanced>
</parameter>
</config-description>
</config-description:config-descriptions>

View File

@ -30,3 +30,5 @@ io.config.homekit.useFahrenheitTemperature.label = Use Fahrenheit Temperature
io.config.homekit.useFahrenheitTemperature.description = Defines whether or not to direct HomeKit clients to use fahrenheit temperatures instead of celsius.
io.config.homekit.useOHmDNS.label = Use openHAB mDNS service
io.config.homekit.useOHmDNS.description = Defines whether mDNS service of openHAB or a separate instance of mDNS should be used.
io.config.homekit.listenToNetworkChanges.label = Listen to network changes
io.config.homekit.listenToNetworkChanges.description = Listen to changes on the network interface, e.g. changing of IP address, and restart HomeKit bridge.

View File

@ -1,6 +1,18 @@
# Basic Profiles
This bundle provides a list of useful Profiles.
This bundle provides a list of useful Profiles:
| Profile | Description |
| --------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| [Generic Command Profile](#generic-command-profile) | Sends a Command towards the Item when an event is triggered |
| [Generic Toggle Switch Profile](#generic-toggle-switch-profile) | Toggles a Switch Item when an event is triggered |
| [Debounce (Counting) Profile](#debounce-counting-profile) | Counts and skip a number of State changes |
| [Debounce (Time) Profile](#debounce-time-profile) | Reduces the frequency of commands/state updates |
| [Invert / Negate Profile](#invert--negate-profile) | Inverts or negate a Command / State |
| [Round Profile](#round-profile) | Reduces the number of decimal places from input data |
| [Threshold Profile](#threshold-profile) | Translates numeric input data to `ON` or `OFF` based on a threshold value |
| [Time Range Command Profile](#time-range-command-profile) | An enhanced implementation of a follow profile which converts `OnOffType` to a `PercentType` |
| [State Filter Profile](#state-filter-profile) | Filters input data using arithmetic comparison conditions |
## Generic Command Profile