INFO
Naar aanleiding van het bekijken van verschillende filmpjes en het lezen van de wiki, hoopte[*] ik een kleine leidraad te kunnen bijdragen.
Weet dat de vele links misschien voor verwarring kunnen veroorzaken, maar is enkel bedoeld voor meer en extra informatie (dus negeer de links tot je meer informatie er over wilt bekomen).
[*] Helaas zijn er ook verschillende naslagwerken; WIKI, (video) tutorials [oa https://www.parleys.com/author/kai-kreuzer] van slechte kwaliteit of niet langer beschikbaar. Alsook door de vele veranderingen op het web, zo is de WIKI van OpenHAB verhuist naar https://github.com/openhab/openhab/wiki/ .
Niet om verwarring te stichten, maar voor de volledigheid heb ik 'OSGi', 'OpenHAB and ECLIPSE SMART HOME' en 'tekencodering' hernomen.
Echter het is raadzaam om dit te skippen, tot je er meer over wilt weten en nu gewoon naar het punt 'INFO - via video' te gaan.
INFO - via video
Home Automation for Geeks
2012 - DEVOXX - "home automation for geeks"
http://www.devoxx.com/display/DV12/Home+Automation+for+Geeks - no longer available | niet langer beschikbaar
The magic happens with autoupdate="false" which keeps the state even an ON command has been received. This way, it's always off unless you explicitly post an update to this item.
https://code.google.com/p/openhab-samples/wiki/ItemDef
https://github.com/openhab/openhab/wiki/Explanation-of-Sitemaps#syntax
Home Automation at Your Fingertips with Eclipse SmartHome and openHAB
10:30 – Domain Model
ipv devices wordt bij openHAB gewerkt met “items”, of de functionaliteit, model de functionaliteiten van een device.
Radio bestaat uit de functionaliteit :
EVENTS : aanspreken / luisteren van veranderingen van een item zijn/haar status (openHAB Event Bus)
CONCEPT
16:45 – BINDING
I18n - internalization
###.items (binding)
meer informatie :
https://code.google.com/p/openhab-samples/wiki/BindingConfig
https://code.google.com/p/openhab-samples/wiki/ItemDef - is replaced by
https://github.com/openhab/openhab/wiki/Bindings - OK
https://github.com/openhab/openhab/wiki/Samples-Item-Definitions - OK
The magic happens with autoupdate="false" which keeps the state even an ON command has been received. This way, it's always off unless you explicitly post an update to this item.
http://openhabdoc.readthedocs.io/de/latest/Beispiel/ - Duits : meer informatie
FUNCTION/TYPE : https://github.com/openhab/openhab/wiki/Explanation-of-items#item-type
REF_NAME : een beduiding gevende naam
" TEXT SYNTAX " : https://github.com/openhab/openhab/wiki/Explanation-of-items#label-text
en check TRANSFORMATTING
< ICON > * : zie verder het gedeelte over icons / dynamische icons
( GROUP ) * : https://github.com/openhab/openhab/wiki/Explanation-of-items#group
{ BINDING } * : https://github.com/openhab/openhab/wiki/Explanation-of-items#binding-config
https://github.com/openhab/openhab/wiki/Explanation-of-Sitemaps#syntax
https://github.com/openhab/openhab/wiki/Bindings
https://github.com/openhab/openhab/wiki/Samples-Item-Definitions
https://github.com/openhab/openhab/wiki/Explanation-of-Sitemaps#mappings
meer info : - http://openhabdoc.readthedocs.org/de/latest/Beispiel/ - German | Duits
- https://github.com/openhab/openhab/wiki/Explanation-of-items - icons in openHAB
* : aanwezigheid simuleren; licht, verwarming minder
https://github.com/openhab/openhab/wiki/Explanation-of-items#icon-name
http://www.intranet-of-things.com/software/downloads - OpenHAB icons
https://github.com/OpenAutomationProject/knx-uf-iconset - KNX icons
32 x 32 pixel and store them in the following directory:
%openHAB-HOME%/webapps/images/
${openHAB-HOME)/webapps/images/
/* Groups */
/*FUNCTION NAME "REF" <ICON> (GROUP1, GROUP2) */
Group gFF "First Floor" <firstfloor>
Group gGF "Ground Floor" <groundfloor>
Group gC "Cellar" <cellar>
Group Garden "Garden" <garden>
Group Weather "Weather" <sun>
Group Status
Group Shutters
Group Windows
/* NAME -------------------- is lid van --------------------> (GROUP1, GROUP2) */
Group GF_Living "Living Room" <video> (gGF)
Group GF_Kitchen "Kitchen" <kitchen> (gGF)
Group GF_Toilet "Toilet" <bath> (gGF)
Group GF_Corridor "Corridor" <corridor> (gGF)
Group FF_Bath "Bathroom" <bath> (gFF)
Group FF_Office "Office" <office> (gFF)
Group FF_Child "Child's Room" <boy_1> (gFF)
Group FF_Bed "Bedroom" <bedroom> (gFF)
Group FF_Corridor "Corridor" <corridor> (gFF)
/* Indoor Temperatures */
/*FUNCTION NAME "REF [%.1f - STATUS °C ]" <ICON> (GROUP1, GROUP2) */
Number Temperature_GF_Corridor "Temperature [%.1f °C]" <temperature> (Temperature, GF_Corridor)
Number Temperature_GF_Toilet "Temperature [%.1f °C]" <temperature> (Temperature, GF_Toilet)
Number Temperature_GF_Living "Temperature [%.1f °C]" <temperature> (Temperature, GF_Living)
/* active groups */
/*FUNCTION:TYPE:LOGIC(ENUM) NAME "INFO [(%d )- STATUS]" <ICON> (GROUP1, GROUP2) */
/* GROUP : ITEMTYPE LOGIC : https://github.com/openhab/openhab/wiki/Explanation-of-items#group */
Group:Switch:OR(ON, OFF) Lights "All Lights [(%d)]"
Group:Switch:OR(ON, OFF) Heating "No. of Active Heatings [(%d)]" <heating>
Group:Number:AVG Temperature "Avg. Room Temperature [%.1f °C]" <temperature> (Status)
Group:Contact:OR(OPEN, CLOSED) Windows "Open windows [(%d)]" <contact>
/* Windows */
/*FUNCTION NAME "REF [MAP(I18N.map):%s - STATUS]" <ICON> (GROUP1, GROUP2) */
Contact Window_GF_Frontdoor "Frontdoor [MAP(en.map):%s]" (GF_Corridor, Windows)
Contact Window_GF_Kitchen "Kitchen [MAP(en.map):%s]" (GF_Kitchen, Windows)
DateTime Weather_LastUpdate "Last Update [%1$ta %1$tR]" <clock>
/* Demo items */
/*FUNCTION NAME "REF" <ICON> (GROUP) { binding } */
DateTime Weather_LastUpdate "Last Update [%1$ta %1$tR]" <clock>
DateTime CurrentDate "Date [%1$tA, %1$td.%1$tm.%1$tY]" <calendar> { channel="ntp:ntp:demo:dateTime" }
Switch DemoSwitch "Switch"
Dimmer DimmedLight "Dimmer [%d %%]" <slider>
Color RGBLight "RGB Light" <slider>
Hint: for dynamic icons see the section on icons on the items page.
https://github.com/openhab/openhab/wiki/Explanation-of-items#icon-name
Group items can also be used to easily determine one or more items with a defined value or can be used to calculate a value depending on all values within the group. Please note that this can only be used if all items in the group have the same type.
https://github.com/openhab/openhab/wiki/Explanation-of-items#group - GROUP : ITEMTYPE LOGIC <INFO>
EX
https://github.com/openhab/openhab/wiki/Heatmiser-Binding - setpoint | . | shedule
https://github.com/openhab/openhab/wiki/Explanation-of-Sitemaps#element-sitemap - setpoint | slider | shedule
https://github.com/openhab/openhab/wiki/Explanation-of-Sitemaps#syntax
https://github.com/openhab/openhab/wiki/Rollershutter-Bindings#sitemap - mapping | shedule
INFO : https://github.com/openhab/openhab/wiki/Explanation-of-Sitemaps#dynamic-sitemaps - dynamic mapping informatie
https://github.com/openhab/openhab/wiki/Samples-Rules
TRANSFROM (I18N) : en.map
/src/main/resources/transform/en.map
https://github.com/openhab/openhab-distro/blob/master/features/openhab-demo-resources/src/main/resources/transform/en.map
sitemap demo label="Main Menu"
{
Frame {
Group item=gFF label="First Floor" icon="firstfloor"
Group item=gGF label="Ground Floor" icon="groundfloor"
Group item=gC label="Cellar" icon="cellar"
Group item=Garden icon="garden"
}
...
/* REF : https://community.openhab.org/t/how-to-return-current-temp-from-my-thermostat/3141/8 */
Frame item=SF_HVAC_Temp label="Thermostats" {
Text item=SF_HVAC_Temp label="Upstairs [%.1f F]" {
Text item=SF_HVAC_State
Text item=SF_HVAC_Humidity
Setpoint item=SF_HVAC_Cool_SP label="Cool Set Point [%d F]" icon="temperature" step=1
Switch item=SF_HVAC_Mode mappings=[0="Off", 1="Heat", 2="Cool", 3="Auto"]
Text label="More Settings" icon="settings" {
Text item=SF_HVAC_Fan
Switch item=SF_HVAC_FanMode label="Fan" icon="settings" mappings=[0="Auto", 1="Circulate", 2="On"]
}
}
}
###.rules (functies -behoeftes- toevoegen)
elke 30 sec : 'cron 0/30' , alle leden van de group Windows checken naar de status en update de GUI
meer info :
https://github.com/openhab/openhab/wiki/Reusable-Rules-via-Functions
Er is nog een andere mogelijkheid, namelijk werken met 'scripts', is vergelijkbaar als de 'rules', maar de code is hergebruikbaar.
In future, there might also be the possibility to use scripts for transformations (e.g. for defining label texts) or in command mappings.
https://github.com/openhab/openhab/wiki/Scripts
Een andere aspect is natuurlijk de 'ations'
https://github.com/openhab/openhab/wiki/Actions
###.items (binding)
uitlezen in XML formaat
Een application programming interface (API) is een set aan definities waarmee softwareprogramma's onderling kunnen communiceren. Het dient als een interface tussen verschillende softwareapplicaties waardoor de gebruikte code automatisch elkaar toegang tot informatie en/of functionaliteit geeft, zonder dat ontwikkelaars hoeven te weten hoe het andere programma exact werkt. API's bestaan voor (web)applicaties, softwarebibiliotheken en besturingssystemen en kunnen voor allerlei doeleinden worden ingezet. Zo gebruikt een besturingssysteem een API om softwareprogramma's in de gelegenheid te stellen om bijvoorbeeld te kunnen printen en kun je via een API van een internetapplicatie bijvoorbeeld teksten, foto's en video over de hele wereld binnenhalen en/of versturen.
Bron : https://www.youtube.com/channel/UC7OK88DW0La_BJlcXZg8ydQ