[SOLVED] Cloud connector cfg?

Hello everyone,

I’m trying to get my openhab cloud connector running in order to expose some z-wave devices (z-way binding) thourgh it to google home.

I’ve managed to get the z-way side up and running, my issue is in regards to this bit of information:

Alternatively, you can configure the settings in the file
conf/services/openhabcloud.cfg

so, the possibly relevant steps i’ve followed so far:

  • installed openhab through apt-get package installation on a raspbian jessie fresh installation on a Rpi 3, so file locations should be
    image

  • configured the remote access from my android device to openhab connector

  • exposed thorugh paper ui a single z-wave device (fibaro wall switch) which i can command throguh the openhab app also remotely/from outside the same network, in lte- and both my android device and the z-wave device show in myopenhab.org

  • tried connecting google home multiple times (it does show in the logs on the cloud connector), google home lets me authenticate into myopenhab.org, click on allaw, but then… simply nothing happens

  • tried to edit the item in the openhab cloud connector paperui interface multiple times, now i even have doubles … :frowning: and the z-wave device (binary switch) in the dropdown list doesn’t stay checked when i get back to it, so i can’t uncheck it to remove it (as i’ve read in another forum post)

  • looked for the phantomlike openhabcloud.cfg for hours to clean it and edit the tags, no luck.

I’ve begun to theorize i have to generate it myself, but i am confused as to in which directory, considering i haven’t installed the openhabian image but from apt-get (planning on having few more things running on this rpi for which i’d like to keep jessie). tbh i’ve thought of a number of other reaons= i’m pretty lost atm, so …please help…

Thanks!!


edit:
i’ve been reading various other trheads on the matter, and i feel like part of my answer is in this one

i’ve found the file in
var/lib/openhab2/config/org/openhab/openhabcloud.config

it appears as though it is only a copy o what is listed in paper ui according to the thread above. :face_with_monocle: i’m studying

check /etc/openhab2/services/openhabcloud.cfg
($OPENHAB_CONF = /etc/openhab2)

you shouldn’t modify var/lib/openhab2/config/org/openhab/openhabcloud.config
In general: the .config files in $OPENHAB_USERDATA (= /var/lib/openhab2) will contain the parameters that you set in PaperUI (or the cfg files, with cfg files having precedence over PaperUI)

I don’t use (yet) Google Home (and as a result, myopenhab.org) so I can’t help much with the setup.
check the docs and the forum for solutions :slight_smile:

Thanks Dim for the reply,

I’ve been hard at work now for over 12 hours on this. kinda dizzy :crazy_face:so will call it a day.

The results of my research so far (it might be of use to somebody, and/or if anybody more knowlegeable is willing to correct my wrongs - would be much appreciated)

/var/lib/openhab2/config/org/openhab/openhabcloud.config
is indeed a transcript of the settings from
paper ui>configuration>services>ui>openhab cloud (expert mode)
so much so that if something goes wrong you could sudo rm the file, sudo reboot, go into paper ui and start anew with the cloud connector. or at least that’s what it looks like.

etc/openhab2/services/openhabcloud.cfg
is an alternative config, that i’m guessing it’s going to become obsolete in the next few versions of openhab, but it should offer much more detailed control atm. This file, at least in my experience, needs to be generated manually (it wasn’t there :man_shrugging:).

Once you do so, if you go into paperUi>configuration>services>ui>openhab cloud expert settings, it’ll attempt at importing .whatever you’ve written in etc/openhab2/services/openhabcloud.cfg- into the other, including brackets etc, while trying to adapt the data to it’s syntax. The result is pretty much confusing :joy:.

It seems to me the two are mutually exclusive, especially because it’s already hard enough to debug what happens in one or the other, debugging the workings of both becomes a lottery :upside_down_face:. or maybe bits of both are needed?

Anyone who managed to succesfully command
from google home >>the cloud connector
+myopenhab.org>>openhab>> z wave devices commanded through z-way ?
how?
i’ve read a lot, tried about 10 different ways adding and removing itemtype itemname "labeltext [stateformat]" <iconname> (group1, group2, ...) ["tag1", "tag2", ...] {bindingconfig}
time to step away :roll_eyes: :rofl:

You have a correct understanding of the things :slight_smile:

this could be a bug. can you post the contents of the openhabcloud.cfg, openhabcloud.config and a screenshot of PaperUI showing the settings?

Anyway, you don’t need to work with any config files. PaperUI is enough to get myopenhab working.

Did you expose any Item to myopenhab until now? Do they show up? (with or without tags… tags will be used for the next step with Google’s Assistant)

will prepare screenshots by tomorrow :wink:

I’ve exposed a Fibaro plug through paper ui (ah also underscores are important for z-way reference…), it did work and show up yesterday night, than i tried going into google home’s app and connecting openhab, and it doesn’t show since then.
ty

1 Like

by the way, the config file format is similar (but not the same) as the cfg file format.

It is expected behavior to take a parameter from cfg and to store it with double quotes in the config file.
In PaperUI they should appear correctly as well.

example from another binding config (mqtt)

in cfg: HomeR.clientId=openhab2
in config: HomeR.clientId="openhab2"

config files get auto-generated. don’t edit them manually. there is an issue with ghost config parameters that stay in the config files even if they are removed from cfg files… that’s another story :slight_smile:

It is confusing but it works… and it’s fine :slight_smile:

I though that it didn’t work (that your settings from cfgs generate errors in PaperUI)

can you post (tomorrow :slight_smile:) the items file contents for this?

Soo…
I’ve run a few more tests, kept playing with different paths to get to the desired result and along the way understood few more things, including what had happened during my original attempt to link openhab to google home. |=> The screenshots i was planning on posting make no sense now.

I now have a few z-wave items (connected through the z-waybinding) exposed (in a very basic way) via the openhab cloud connector to outside services.

That was achieved just selecting them in “Paper ui>config>ui>openhab cloud connector”.
As soon as i started fiddling with the expert mode, or tried working on the old cfg file, i was evidently messing things up (after my first unsuccesful attempt to connect google home, i moved from the normal mode to the expert one, as i wasn’t happy with having a long string (read below) as the itemname or item label.

Just selecting them in the dropdown list, they work and stay selected.

The /var/lib/openhab2/config/org/openhab/openhabcloud.config file, at the very least, for those planning on using the z-way binding, works with a syntax like this:

baseURL="https://myopenhab.org/"
expose=( \
  "zway_zwayDevice_192_168_1_32_2_switchPowerOutlet_ZWayVDev_zway_2_0_37", \
  "zway_zwayDevice_192_168_1_32_3_switchPowerOutlet_ZWayVDev_zway_3_1_37", \
  "zway_zwayDevice_192_168_1_32_2_sensorEnergy_ZWayVDev_zway_2_0_49_4", \
  "zway_zwayDevice_192_168_1_32_3_sensorTemperature_ZWayVDev_zway_3_3_49_1", \
  "zway_zwayDevice_192_168_1_32_3_sensorMeterW_ZWayVDev_zway_3_1_50_2", \
)
mode="remote"
service.pid="org.openhab.openhabcloud"

The items’ updates do show up in myopenahb.org, the connection works correctly, their status is correctly transmitted to IFTTT and IFTTT can influence their status as well.

Since Openhab Cloud has been connected, i have received on my mobile openhab app while logging on remotely in LTE a new message “impossible to connect to the remote page while the openhab cloud function is active” => will see if this keeps happening.

My interest stays in managing to connect openhab z-way items and command them via google home. IFTTT could be a nice bonus, but i’ll still use local scripts for most of the reactions of the system.

To that end I still am unahppy with having the actual itemname exposed to ifttt. I’d like to expose a readable label “dehumidifier” for instance and define it as switchable.

Reading this Google Assistant | openHAB makes me think it’s got to be possible, however as i’ve come to understand most of the documentation refers to syntax of what was contained in etc/openhab2 and subfolders( files with *.items, *.cfg, *.things) that are becoming obsolete, so, by intution, i’m guessing their respective younger siblings are contained in var/lib/openhab2/ but i have nothing to understand or construct their correct syntax and formats upon.

I’ve also tried using rest apis to define tags of my zway items, thinking i could circumvent editing the files -sadly to no avail, as i keep gettig a 405 error.

I’ll keep studying :face_with_monocle:
EDIT
i found a post regarding rest apis that might take me a step further.
https://community.openhab.org/t/rest-api-over-http-always-fails-with-405/42753/5
i don’t want to jinx myself bt being too optimistic now. will see.

1 Like

Why do you believe that stuff in /etc/openhab2/ are becoming obsolete? :slight_smile: They are not.

Also: you shouldn’t modify the files in /var/lib/openhab2/. They are autogenerated from different sources (either files in /etc/openhab2/ or PaperUI entries). If you update a *.cfg the *.config will be updated. The opposite is not true. Also if you modify parameters in a *.config they will be overwritten by stuff in a *.cfg.

You should create /etc/openhab2/items/*.items files with proper labels and tags and you will be fine

1 Like

oh wow!
will do that than :star_struck:

1 Like

Update:

Since i am working with the Z-way binding, and i had read that it worked only in simple mode in order for the channels that link things and items to be created correctly - i had that enabled.
That was the cause of all my issues with tagging etc.
I suppose whatever was causing the need for that workaround must have been resolved, as by disabling simple mode i’ve been able to do everything that previously wasn’t working.

As a tiny bit of advice for anybody wating to go the zway (z-wave.me) route on raspberry,
were i starting again, this would be my process:

  • connect tha raZberry shield, assemble the raspi, falsh the latest version of raspbian
  • configure the raspi according toyour network, username and password preferences
  • install z-wave.me
  • include all of your devices, create associations, check network solidity etc
  • install java (zulu)
  • install openhab (2.2 for the binding to work correctly, until new updates happen)
  • install the addons
  • install the openhab bridge in z-wave.me and configure it (localhost)
  • install the z-way binding and configure it (localhost)
  • include once the things in simple mode to figure out which channels you actualy need and write it down
  • delete them all, disable simple mode
  • include them again creating the items + naming them correctly
  • install openhab cloud service and ONLY pick from the dropdown list whatever you NEED to expose
  • go to the rest api page, GET a list of your items, PUT the correct tags (as per homebridge integration)
  • go for the google home discovery

Ofc by that point it’s up to you to decide how deep you wish to go into the rabbithole :wink:, but it starts being enjoyable.
i’ll be installing for sure a sata ssd controller + 2.5ssd to avoid sd wear.:grimacing:

1 Like