From Hentschel
Revision as of 03:01, 9 March 2018 by Thomas (Talk | contribs)

Jump to: navigation, search

Things, Items etc .. http://docs.openhab.org/configuration/things.html

Openhab hacks

  • log files are at ohab: log files
  • karaf console login: By default disabled from anywhere but localhost. Thus ssh into ohab, then ssh from there to
    ssh -p 8101 openhab@localhost
    default pwd is habopen.
  • timeout exception prevents any further updates. This is evidently a eclipse smarthome framework bug
    2017-11-21 16:59:30.517 [WARN ] [org.apache.karaf.services.eventadmin] - EventAdmin: Blacklisting ServiceReference [{org.osgi.service.event.EventHandler, org.eclipse.smarthome.core.events.EventPublisher}={event.topics=smarthome, component.name=org.eclipse.smarthome.core.internal.events.OSGiEventManager, component.id=38, service.id=139, service.bundleid=109, service.scope=bundle} | Bundle(org.eclipse.smarthome.core_0.9.0.201711202142 [109])] due to timeout!
  • on Mac OSX: at some point, the Eclipse Devel setup quit launching the OpenHAB launch - it just hang, when accessing the web gui at port 8080 the browser was just spinning and not moving forward. Reason is that Mac OSX cannot load a graphics library and just blocks in the ClassLoader. Details here: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8019496
    • to fix, add
      -XstartOnFirstThread -Djava.awt.headless=true
      to the VM arguments of the launch
  • to show "configuration->items" in PaperUI, you need to switch from "simple" to "advanced" mode. Go to Configuration->System->Item Linking and deactivate the "Simple Mode". You will then have a new entry Configuration->Items which will show you all your items (also the ones from the files, but note that these are read-only).

5 inch touch screen

  • clone following repo onto pi
 sudo rm -rf LCD-show 
 git clone https://github.com/goodtft/LCD-show.git 
 chmod -R 755 LCD-show 
 cd LCD-show/
  • depending on LCD type, excute:
    • In case of 5" LCD
  sudo ./LCD5-show 
  • If you need to switch back to the traditional HDMI display
 sudo ./LCD-hdmi 

Wait a few minutes,the system will restart automatically

Homekit setup

  • there is a issue with the homekit addon overwriting the generated mac address on exit (I think). See https://github.com/openhab/openhab2-addons/issues/1822
    • for now, after successful pairing, set /var/lib/openhab2/jsondb/homekit.json read only after successful pairing. May have to undo to re-create a new pairing
  • after a reset of the openhab server, it may take quite some time for homekit to attempt a reconnect to the server. You can force a reconnect by putting the iPhone etc temporarily into and out of airplane mode. This forces homekit to reconnect

Alexa setup

  • Install the openhab cloud connector in add-ons -> misc. This will create a UUID and secret that we need for hitching up to the openhab cloud. In the background, it already attempted to log on with the created credentials, but fails (since there is no account on myopenhab yet), and will not attempt to go any further. As we'll see, this creates a bit of a problem later.
  • get the UUID and secret from
    /var/lib/openhab2/uuid
    and
    /var/lib/openhab2/openhabcloud/secret
    and create/sign on at http://myopenhab.org
  • myopenhab needs to verify email address, do so...
  • Tricky: myopenhab will still say that your openhab instance is not connected. This is b/c a earlier attempt by the openhab server failed, and now it has given up. Go back to paper ui, configuration -> services -> openHAB cloud and hit configure. Just hitting "Save" will retrigger the log-on process, which should now be ok.The log files will tell you.
  • Once we have the myopenhab cloud setup working, go to amazon.com, and search for the openhab skill. Install that skill to your amazon alexa skill set. This will ask you to permit the myopenhab cloud to get credentials and permissions from the alexa cloud. Use the defaults, eventually there is a web page that says "close this window" (you'll need pop-ups enabled in your browser, otherwise you'll miss that window).
  • Once the connection between Alexa and Myopenhab is made via the openhab skill. ask alexa to "discover devices". It should announce all devices that have HomeKit tags (both the homekit plugin and the alexa skill use the same tagging system)

MQTT

  • needed to use node-red as flow editor....
  • topics and stuff

create Fireplace binding

  • see also Fireplace controller project
  • follow this -> https://docs.openhab.org/developers/development/bindings.html , look at Creating a Skeleton
  • once the skeleton is in place, we need mqtt
    • add the actual library reference ('org.openhab.io.transport.mqtt') to META-INF/MANIFEST.MF
    • add reference to OSGI Declarative Service (DS)
      • in OSGI-INF/org.openhab.binding.marlinfireplace.internal.MarlinFireplaceHandlerFactory.xml add
          <<reference bind="setMqttService" cardinality="1..1" interface="org.openhab.io.transport.mqtt.MqttService" name="MqttService" policy="static" unbind="unsetMqttService"/>> 
      • implement the methods in the named class (this case org.openhab.binding.marlinfireplace.internal.MarlinFireplaceHandlerFactory)
        public void setMqttService(MqttService mqttService) {}; public void unsetMqttService(MqttService mqttService) 

Node-RED

Zoneminder integration

  • the current binding already has the monitor ID and the session values (user/pass). With that, the URL to get a single snap shot is:
wget "http://zmhost/zm/cgi-bin/nph-zms?mode=single&scale=<scale>&monitor=<monitorid>&user=xxx&pass=yyy" -O foo.jpg
('scale' scales the image, 100 = org size)
  • should be able to integrate this binding into the ZM binding

Options to nph-zms (scraped off the web, not confirmed)

mode=[mpeg|jpeg|raw|zip|single]. defaults to jpeg if nothing is entered, and to mpeg if junk is entered 
format=[asf|swf|flv|mp4|mov|3gp|avi|mpegts|...*] is passed to zm_mpeg. only relevant in mpeg. defaults to mpeg.
seems to accept every format that ffmpeg would accept. 
monitor=n the monitor number as in zm's web interface
source=[event|*] if source =event an event will be replayed, otherwise the live stream
time= ??? replaying can either be startet specifying monitor ID and time
event= or eventID, used if source=event to specify which one is replayed
scale=x picture size scale factor in%, defaults to 100
rate=n the actual frame rate
maxfps=n maximal frame rate
frame= n replaying starts at the nth frame of an event
bitrate=x no detectable influence. only relevant in mpeg
ttl=n don't know
replay=[gapless, all]
connkey=x is used by streams through the web interface, don't know what it is
buffer=n no visible effect.
auth, user, pass used when authentication is used.