Changes

OpenHAB2

2,982 bytes added, 00:33, 23 April 2019
/* Cameras */
* Things, Items etc .. http://docs.openhab.org/configuration/things.html
* Basics for file locations: [https://docs.openhab.org/installation/linux.html#file-locations at this link]
[[Image:Filelocations.png|thumb|500px800px|left]]<br clear=both>* Good overview of the OpenHAB binding architecture: http://kacangbawang.com/openhab2-binding-architecture/* [http://www.cd-jackson.com/index.php/openhab/5-zwave-debugging-openhab this site] has info on debug settings etc.* Set debug in OHAB console: <pre>log:set debug org.openhab.binding.isy</pre>* WS client for ISY on raspi01: http://192.168.1.27/ws.html* WS client for OHAB: http://ohab:8080/static/ws.html** this needs "org.eclipse.smarthome.cors:enable=true" in ''/usr/share/openhab2/runtime/services.cfg'' (see https://community.openhab.org/t/sse-over-rest-api/19220/7) 
==Openhab hacks ==
** make sure Node version already installed is > 8.0 (update to TLS version)
** upgrade before installing the ''homebridge-openhab2'' node contribution and the stuff required for homebridge
* '''Important: ''' When the OpenHAB server is rebooted - or the OpenHAB server is restarted, the HomeBridge server doesn't reconnect (timing problem). Need to restart HomeBridge too<-- fix me* '''Important:''' After initial start of OHAB, wait until that's settled, then start HomeBridge. It seems that Homebridge/Homekit needs some time to settle for updates from devices to work. Also, always restart the Home.app's on the iOS devices.* fix reboot problems via https://gist.github.com/johannrichard/0ad0de1feb6adb9eb61a/** '''/etc/default/homebridge''' <pre># Defaults / Configuration options for homebridge# The following settings tells homebridge where to find the config.json file and where to persist the data (i.e. pairing and others)# HOMEBRIDGE_OPTS=-U /var/lib/homebridgeHOMEBRIDGE_OPTS=-U /opt/homebridge # If you uncomment the following line, homebridge will log more # You can display this via systemd's journalctl: journalctl -f -u homebridgeDEBUG=*</pre>:* '''/etc/systemd/system/homebridge.service'''<pre>[Unit]Description=Node.js HomeKit Server After=syslog.target network-online.target [Service]Type=simpleUser=homebridgeEnvironmentFile=/etc/default/homebridge# Adapt this to your specific setup (could be /usr/bin/homebridge)# See comments below for more informationExecStart=/usr/bin/homebridge $HOMEBRIDGE_OPTSRestart=on-failureRestartSec=10KillMode=process [Install]WantedBy=multi-user.target</pre> :* then install:<pre>sudo systemctl daemon-reloadsudo systemctl enable homebridgesudo systemctl start homebridge</pre> :* check log file via journalctl -f -u homebridge :* to pipe ''journalctl'' logs into ''frontail'', use journalctl -u homebridge | frontail -p 9002 - :: or a bit more elaborate: /bin/journalctl -u homebridge | /usr/bin/frontail --ui-highlight --ui-highlight-preset /usr/lib/node_modules/frontail/preset/openhab.json -t openhab -l 2000 -n 200 -p 9002 - fix me
== Alexa setup ==
# Amazon Echo voice control
Essential mapping between Apple HomeKIt and OpenHAB2 is done via the Node-RED .js homebridge-openhab2 plugin (https://www.npmjs.com/package/homebridge-openhab2). This will map any OpenHAB2 ''Items'' decorated in the .items files into the HomeKIT space. The HomeBridge setup is essential since HomeKit can only deal with 99 accessories. Since HomeBridge is a bridge, it only counts as one. '''Important:''' The items defined in the items file also need to be in the sitemap file for updates to work. Otherwise, the items will update on restart of Home app, or when operated thru the Home app, but not when the update happens from another client (incl. HW switches)
Additional mappings of devices that have troubles with OpenHAB + HomeKit bridge can be added as separate HomeKit devices in Node-RED and hitched up to OpenHAB via the ''node-red-contrib-homekit'' plugin. To install, first look here: https://www.npmjs.com/package/node-red-contrib-homekit . However, the install needs a small modification, basically run:
=== Cameras ===
* cameras will be tied to openhab2 via the zoneminder binding, which will get them onto BasicUI
* use the zm server to install Node.js + the homebridge camera node server, which gets them onto Apple HomeKit. Link to plugin is [https://www.npmjs.com/package/homebridge-camera-ffmpeg here]
* the node/homebridge/camera server evidently cannot add a camera to an already existing HomeKit key mapping. The camera def's need to be present when the bridge is paired with iOS. However, it is possible to change the cam url in the homebridge config.json.
* create a systemd service for homebridge as per the instructions here: https://gist.github.com/johannrichard/0ad0de1feb6adb9eb61a/ . If the homebridge setup was started and paired by starting manually before, copy the entire ~/.homebridge folder to /var/lib (not just the config.json), otherwise the already existing pairing info is missing. Don't forget to set correct perms/user/group on copied files. Also, make this service depend on "zoneminder.service" as explained here: https://stackoverflow.com/questions/21830670/systemd-start-service-after-specific-service
It's probably best to have the Thermostat control mapped as a OpenHAB node in Node-RED as a separate HomeKit device, since the OpenHAB2 mappings for thermostats don't appear to work correctly. Also, the same is true for other "Thermostat" like devices (hottub, fireplace) - just keep Thermostats separate for now (with their own HomeKit ID). This also requires a separate Node-RED map into Alexa.
 
* link to [http://isy.home.hentschel.net/USER/WEB/ws.htm WS logger]
=== Zoneminder ===
* create items
* create in sitemap
 
=== Weather station ===
* AmbientWeather1400IP binding
* SolarRadiation ~ 30 when Solar panels come on/start producing
* Solar Radiation max ~ 750
 
== Influx / Grafana ==
=== Influx ===
* username openhab
* database openhab_db
Bureaucrat, administrator
963
edits