]> git.basschouten.com Git - openhab-addons.git/commitdiff
[openhabcloud] Makes the baseURL and item updates options advanced... (#13078)
authorDan Cunningham <dan@digitaldan.com>
Mon, 4 Jul 2022 21:09:35 +0000 (14:09 -0700)
committerGitHub <noreply@github.com>
Mon, 4 Jul 2022 21:09:35 +0000 (23:09 +0200)
* [openhabcloud] Makes the baseURL and item updates options advanced, cleans up documentation, disabled sending updates to the community myopenHAB.org service.

Fixes #12582

Signed-off-by: Dan Cunningham <dan@digitaldan.com>
bundles/org.openhab.io.openhabcloud/README.md
bundles/org.openhab.io.openhabcloud/doc/configuration.png
bundles/org.openhab.io.openhabcloud/src/main/java/org/openhab/io/openhabcloud/internal/CloudService.java
bundles/org.openhab.io.openhabcloud/src/main/resources/OH-INF/config/config.xml
bundles/org.openhab.io.openhabcloud/src/main/resources/OH-INF/i18n/openhabcloud.properties

index 3d217e2abd78214c6a5dca01e897bc2e1f20549b..d5be02da6895bc82c719d4234cd762ccda5c8755 100644 (file)
@@ -9,7 +9,7 @@ The openHAB Cloud service (and thus the connector to it) is useful for different
 
 * It allows remote access to local openHAB instances without having to expose ports to the Internet or to require a complex VPN setup.
 * It serves as a connector to Google Cloud Messaging (GCM) and Apple Push Notifications (APN) for pushing notifications to mobile phone apps.
-* It brings integration possibilities with services that require an OAuth2 authentication against a web server, such as IFTTT or Amazon Alexa Skills.
+* It provides integrations with 3rd party services that require OAuth2 authentication, such as Amazon Alexa or Google Home applications 
 
 ## Installation via UI
 
@@ -43,10 +43,15 @@ After installing this add-on, you will find configuration options in the openHAB
 
 ![Configuration](doc/configuration.png)
 
-Please note, that you should not expose all your items in this settings dialog.
-Also note that at present this feature is currently turned off.
-You just need to expose those items, which you want to be accessible by IFTTT.
-This setting has no affect on Alexa or Google Assistant functionality.
+By default both remote access and push notifications are enabled.  
+
+### Advanced Configuration
+
+For private hosted myopenHAB installations, the base URL can be changed to point another cloud instance.
+
+Private hosted myopenHAB installations may enable selected items in openHAB to have their state updates pushed to the cloud service for integrations with services like IFTTT.
+Note that this is not supported on the community hosted myopenHAB service due to high load concerns and will have no effect if enabled with the default URL configured.
+This is also not required for remote access through the cloud service to function.
 
 Alternatively, you can configure the settings in the file `conf/services/openhabcloud.cfg`:
 
@@ -72,6 +77,4 @@ Alternatively, you can configure the settings in the file `conf/services/openhab
 #expose=
 ```
 
-Note: The exposed items will show up after they receive an update to their state.
-
-Note: In order to use an openHAB UI via the Cloud Connector exposing items is not neccessary. Administrative actions are limited to creating things, items and rules, deleting them is inhibited via the Cloud Connector.
+Note: The optionally exposed items will show up after they receive an update to their state.
index 961fd58356ddc0bd3acb3fbf344703c031f707d4..ac2bde3794f78edc1ccded8df79e83959e870300 100644 (file)
Binary files a/bundles/org.openhab.io.openhabcloud/doc/configuration.png and b/bundles/org.openhab.io.openhabcloud/doc/configuration.png differ
index 459d42240455f80a484d4397cdcaf278e0c4f3e7..fce8d8ce93bd43ff5cd895cf64045d1768aa1794 100644 (file)
@@ -367,8 +367,12 @@ public class CloudService implements ActionService, CloudClientListener, EventSu
     @Override
     public void receive(Event event) {
         ItemStateEvent ise = (ItemStateEvent) event;
-        if (exposedItems != null && exposedItems.contains(ise.getItemName())) {
+        if (supportsUpdates() && exposedItems != null && exposedItems.contains(ise.getItemName())) {
             cloudClient.sendItemUpdate(ise.getItemName(), ise.getItemState().toString());
         }
     }
+
+    private boolean supportsUpdates() {
+        return cloudBaseUrl.indexOf(CFG_BASE_URL) >= 0;
+    }
 }
index d870ed859e11cd467bb882f1f4d44b5c7a2d8a03..c66dccc92fcaa73b675fc9189d7a7350adcac6a2 100644 (file)
                </parameter>
                <parameter name="expose" type="text" required="false" multiple="true">
                        <label>Items to Expose</label>
-                       <description>List of items that are made accessible to IFTTT and similar services.</description>
+                       <description>List of items that are made accessible to IFTTT and similar services. Only supported on private cloud
+                               installations.</description>
                        <context>item</context>
+                       <advanced>true</advanced>
                </parameter>
                <parameter name="baseURL" type="text" required="false">
                        <label>Base URL</label>
                        <description>Base URL for the openHAB Cloud server.</description>
                        <default>https://myopenhab.org/</default>
+                       <advanced>true</advanced>
                </parameter>
        </config-description>
 </config-description:config-descriptions>
index 8998a3b824fba6abe6eb0c03e50a79867a7fd3f8..45b8e7a42c602f424be5d802924b51644a1cb46e 100644 (file)
@@ -1,7 +1,7 @@
 io.config.openhabcloud.baseURL.label = Base URL
 io.config.openhabcloud.baseURL.description = Base URL for the openHAB Cloud server.
 io.config.openhabcloud.expose.label = Items to Expose
-io.config.openhabcloud.expose.description = List of items that are made accessible to IFTTT and similar services.
+io.config.openhabcloud.expose.description = List of items that are made accessible to IFTTT and similar services. Only supported on private cloud installations.
 io.config.openhabcloud.mode.label = Mode
 io.config.openhabcloud.mode.description = What features of the openHAB Cloud service should be used.
 io.config.openhabcloud.mode.option.notification = Notifications