Examples for integrating CUL_V3, FS20, FHT, S300TH in openHAB (1.7.0)

1,063 views
Skip to first unread message

Dirk Clemens

unread,
Aug 4, 2015, 12:50:45 PM8/4/15
to openhab
All,

it took me quite a while and lots of "googleing" as well as try and error to find out how to integrate CUL_V3, FS20, FHT, S300TH in openHAB ( version 1.7.0).
As a backup for me ;-) and to minimize efforts for others I will post my configuration here.

If there still are errors, misunderstandings or if you have other best practices, do not hesitate to post your setup here. 

The starting point is the openhab.cfg with the most critical part for the components mentioned above:

############################# CUL/FS20/FHT Binding ####################################
# using CUL_V3 @/dev/ttyACM0
fht:housecode=DC69 # (or whatever you have, I don't think that this is necessary)
fht:device=serial:/dev/ttyACM0
fs20:device=serial:/dev/ttyACM0
s300th:device=serial:/dev/ttyACM0

############################# CUL Intertechno Binding ################################
# using a hand made "CUL" (http://www.fhemwiki.de/wiki/Selbstbau_CUL, in german only) @/dev/ttyACM0
culintertechno:device=serial:/dev/ttyUSB0

############################## Astro Binding ##############################
astro:latitude=##.###
astro:longitude=##.###
astro:interval=600

################################ Yahoo Weather Binding ################################
weather:location.home.name=home
weather:location.home.latitude=##.###
weather:location.home.longitude=##.###
weather:location.home.provider=Yahoo 
weather:location.home.language=de
weather:location.home.updateInterval=10

################################ MPD Binding ##########################################
mpd:smarthome.host=192.168.2.44
mpd:smarthome.port=6600


default.items


/************************************************************************************/

Group All
Group logger (All)
Group Indoor (All)
Group Outdoor (All)
Group Heating (All)
Group Motion (All)
Group Motion_Chart (All)
Group Weather (All)
Group Weather_Chart (Weather)
Group WeatherB (All)
Group Phone (All)
Group Solar (All)
Group Solar_Chart (All)
Group Audio (All)
Group Presence   <cellular>
Group Settings (All)

/************************************************************************************/
/* Einstellungen */
Switch PresenceSimulation "Abwesenheitsschaltung" <present> (Settings)

/************************************************************************************/
Switch Presence_Ip "iPhone Wifi" <present> (Presence) { nh="192.168.2.57" }
Switch Presence_GPS "iPhone GPS" <iPhone> (Presence) { mqttitude="mosquitto:owntracks/###/iphone6" }

/* Gruppenschalter */
Group:Switch:OR(ON, OFF) Lights "Lampen [%d an]" <hue> (Lights, Indoor)
Group:Switch:OR(ON, OFF) mLights "Lampen [%d an]" <hue> (mLights, Indoor)
Group:Switch:OR(ON, OFF) nLights "Lampen [%d an]" <hue> (nLights, Indoor)
Group:Switch:OR(ON, OFF) Lights_Outdoor "Aussenlampen [%d an]" <light> (Outdoor)
Group:Switch:OR(ON, OFF) Battery "Batterien [%d leer]" <battery>
Group:Contact:OR(OPEN, CLOSED) Windows "Fenster [%d offen]" <contact>

DateTime Date "Datum [%1$tA, %1$td. %1$tB %1$tY - %1$tR]" <calendar>

/************************************************************************************/
/* gpio */
/************************************************************************************/
Switch mpdAMP "MPC Ampifier" <loudspeaker> (Audio) { exec=">[ON:/usr/local/bin/gpio -g mode 5 out ] >[OFF:/usr/local/bin/gpio -g mode 5 in]" }

/************************************************************************************/
/* FHT80B - Funk-Heizkörperthermostate */
/* binding: fht="housecode=<housecode>;address=<optional>;datapoint=<optional>" */
/* items: Switch, Number */
/* datapoint:DESIRED_TEMP, MEASURED_TEMP, VALVE, BATTERY */
/* FHTState: BATTERY_LOW */
/************************************************************************************/
Number HeizungMultiraumDesired "Multiraum Soll-Temp. [%.1f °C]" <temperature> (Heating, logger) { fht="housecode=552D;datapoint=DESIRED_TEMP" }
Number HeizungErdgeschossDesired "Erdgeschoss Soll-Temp. [%.1f °C]" <temperature> (Heating, logger) { fht="housecode=1621;datapoint=DESIRED_TEMP" }
Number HeizungLinaDesired "Lina Soll-Temp. [%.1f °C]" <temperature> (Heating, logger) { fht="housecode=0B48;datapoint=DESIRED_TEMP" }
Number HeizungNicoDesired "Nico Soll-Temp. [%.1f °C]" <temperature> (Heating, logger) { fht="housecode=095C;datapoint=DESIRED_TEMP" }
Number HeizungDachDesired "Heizung Dach  Soll-Temp. [%.1f °C]" <temperature> (Heating, logger) { fht="housecode=5A5B;datapoint=DESIRED_TEMP" }

Number HeizungMultiraumMeasured "Multiraum Ist-Temp. [%.1f °C]" <temperature> (Heating) { fht="housecode=552D;datapoint=MEASURED_TEMP" }
Number HeizungErdgeschossMeasured "Erggeschoss Ist-Temp. [%.1f °C]" <temperature> (Heating) { fht="housecode=1621;datapoint=MEASURED_TEMP" }
Number HeizungLinaMeasured "Lina Ist-Temp. [%.1f °C]" <temperature> (Heating) { fht="housecode=0B48;datapoint=MEASURED_TEMP" }
Number HeizungNicoMeasured "Nico Ist-Temp. [%.1f °C]" <temperature> (Heating) { fht="housecode=095C;datapoint=MEASURED_TEMP" }
Number HeizungDachMeasured "Heizung Dach Ist-Temp. [%.1f °C]" <temperature> (Heating) { fht="housecode=5A5B;datapoint=MEASURED_TEMP" }

Number HeizungMultiraumValve "Multiraum Ventil [%.1f %%]" <heating> (Heating) { fht="housecode=552D;address=00;datapoint=VALVE" }
Number HeizungErdgeschossValve "Erdgeschoss Ventil [%.1f %%]" <heating> (Heating) { fht="housecode=1621;address=00;datapoint=VALVE" }
Number HeizungLinaValve "Lina Ventil [%.1f %%]" <heating> (Heating) { fht="housecode=0B48;address=00;datapoint=VALVE" }
Number HeizungNicoValve "Nico Ventil [%.1f %%]" <heating> (Heating) { fht="housecode=095C;address=00;datapoint=VALVE" }
Number HeizungDachValve "Dach Ventil [%.1f %%]" <heating> (Heating) { fht="housecode=5A5B;address=00;datapoint=VALVE" }

Switch HeizungMultiraumBattery "Multiraum Heizung Batterie [%s]" <battery> (Heating, Battery) { fht="housecode=552D;datapoint=BATTERY" }
Switch HeizungErdgeschossBattery "Erdgeschoss Heizung Batterie [%s]"<battery> (Heating, Battery) { fht="housecode=1621;datapoint=BATTERY" }
Switch HeizungLinaBattery "Lina Heizung Batterie [%s]" <battery> (Heating, Battery) { fht="housecode=0B48;datapoint=BATTERY" }
Switch HeizungNicoBattery "Nico Heizung Batterie [%s]" <battery> (Heating, Battery) { fht="housecode=095C;datapoint=BATTERY" }
Switch HeizungDachBattery "Dach Heizung Batterie [%s]" <battery> (Heating, Battery) { fht="housecode=5A5B;datapoint=BATTERY" }


/************************************************************************************/
/* FHT 80TF-2 - Funk-Tür-Fenster-Melder */
/* binding: fht="housecode=<housecode>;address=<optional>;datapoint=WINDOW" */
/* items: Contact */
/* datapoint:WINDOW */
/* FHTState: WINDOW_OPEN, WINDOW_CLOSED */
/************************************************************************************/
Contact FenstersensorMultiraum "Multiraum [MAP(de.map):%s]" <contact> (Windows, logger) { fht="housecode=52FB;address=7B;datapoint=WINDOW" }
Contact FenstersensorNico "Nico [MAP(de.map):%s]" <contact> (Windows, logger) { fht="housecode=7D66;address=C0;datapoint=WINDOW" }
Contact FenstersensorLina "Lina [MAP(de.map):%s]" <contact> (Windows, logger) { fht="housecode=AD14;address=1B;datapoint=WINDOW" }
Contact FenstersensorKueche "Küche [MAP(de.map):%s]" <contact> (Windows, logger) { fht="housecode=9F63;address=ED;datapoint=WINDOW" }
Contact FenstersensorKellerbuero "Keller Büro [MAP(de.map):%s]" <contact> (Windows, logger) { fht="housecode=5A33;address=92;datapoint=WINDOW" }
Contact FenstersensorKellertuere "Kellertüre [MAP(de.map):%s]" <door> (Windows, logger) { fht="housecode=005E;address=4F;datapoint=WINDOW" }
Contact FenstersensorHaustuere "Haustüre [MAP(de.map):%s]" <frontdoor> (Windows, logger) { fht="housecode=B79D;address=A0;datapoint=WINDOW" }

/************************************************************************************/
/* FS20 Licht/Schalter     */
/************************************************************************************/
Switch LichtDachHinten "Licht Dach hinten" <hue> (Lights, Indoor, logger) { fs20="DC69B0" }
Switch LichtDachMitte "Licht Dach mitte" <hue> (Lights, Indoor, logger) { fs20="DC69B1" }
Switch LichtDachTreppe "Licht Dach Treppe" <hue> (Lights, Indoor, logger) { fs20="DC69B2" }
Switch LichtKueche "Licht Küche" <hue> (Lights, Indoor, logger) { fs20="DC6900" }
Switch LichtAussenwand "Licht Aussenwand" <hue> (Lights, Outdoor, logger) { fs20="DC6901" }
Switch LichtKellerflur "Licht Kellerflur" <hue> (Lights, Indoor, logger) { fs20="DC6902" }
Switch LichtGartentor "Licht Gartentor" <hue> (Lights, Outdoor, logger) { fs20="DC6903" }

Switch Klingel "Klingel [%s]" <hue> (Outdoor, logger) { fs20="536200" }
Switch Klingel2 "Klingel2 [%s]" <hue> (Outdoor) { fs20="536201" }
Switch PirAussenwand "Bewegung Aussenwand [%s]" <motion> (Outdoor, Motion, logger) { fs20="A7A300" }
Switch PirGartentor "Bewegung Gartentor [%s]" <motion> (Outdoor, Motion, logger) { fs20="557A00" }
Number Motion_Chart_Period "Chart Zeitraum" <motion>
String Motion_Panel "Bewegungsmelder [%s]" <motion>

/************************************************************************************/
/* Intertechno Licht/Schalter     */
/************************************************************************************/
Switch LichtA "Licht A" <hue> (nLights) {culintertechno="type=raw;address=0FFF0F0F;commandOn=FF;commandOff=F0"}
Switch LichtB "Licht B" <hue> (nLights) {culintertechno="type=raw;address=0FFF0FF0;commandOn=FF;commandOff=F0"}
Switch LichtC "Licht C" <hue> (nLights) {culintertechno="type=raw;address=0FFF0FFF;commandOn=FF;commandOff=F0"}
Switch LichtD "Licht D" <hue> (nLights) {culintertechno="type=raw;address=0FFF00FF;commandOn=FF;commandOff=F0"}

/************************************************************************************/
/* S 300 TH - Funk-Temperatur-/ Luftfeuchte-Sensor     */
/************************************************************************************/
Number S300TerrasseTemp "Terrasse Temperatur [%.1f C]" <s300th> (Outdoor, Weather, Weather_Chart, logger) {s300th="address=1;datapoint=TEMPERATURE"} 
Number S300TerrasseHumi "Terrasse Luftfeuchtigkeit [%.1f %%]" <s300th> (Outdoor, Weather, logger) {s300th="address=1;datapoint=HUMIDITY"}
Number S300GartenTemp "Garten Temperatur [%.1f C]" <s300th> (Outdoor, Weather, Weather_Chart, logger) {s300th="address=5;datapoint=TEMPERATURE"} 
Number S300GartenHumi "Garten Luftfeuchtigkeit [%.1f %%]" <s300th> (Outdoor, Weather, logger) {s300th="address=5;datapoint=HUMIDITY"}

/************************************************************************************/
/* Solar */
/************************************************************************************/
String Solar_Panel "[%s]" <piko42>
Number Solar_Aktuell            "aktuelle Leistung [%.0f W]" <piko42> (Solar, Solar_Chart, logger) { http="<[piko42cache:30000:REGEX(.*aktuell</td>.*?([0-9]*)</td>.*)]" }
Number Solar_Gesamt             "Ertrag (gesamt) [%.0f kWh]" <piko42> (Solar) { http="<[piko42cache:30000:REGEX(.*Gesamtenergie</td>.*?(\\d*)</td>.*)]" }
Number Solar_Tagesenergie       "Ertrag (heute) [%.2f kWh]" <piko42> (Solar, Solar_Chart, logger) { http="<[piko42cache:30000:REGEX(.*Tagesenergie</td>.*?([0-9\\.]*)</td>.*)]" }
Number Solar_PVG_Str2_Spannung  "String2 Spannung [%d V]" <piko42> (Solar, logger) { http="<[piko42cache:30000:REGEX(.*?String 2.*?Spannung</td>.*?(\\d*)</td>.*)]" }
Number Solar_PVG_Str2_Strom     "String2 Strom [%.2f A]" <piko42> (Solar, logger) { http="<[piko42cache:30000:REGEX(.*?String 2.*?Strom</td>.*?([0-9.]*)</td>.*)]" }
Number Solar_AL_L1_Spannung     "L1 Spannung [%d V]" <piko42> (Solar) { http="<[piko42cache:30000:REGEX(.*?String 1.*?Spannung</td>.*?Spannung</td>.*?(\\d*)</td>.*)]" }
Number Solar_AL_L1_Leistung     "L1 Leistung [%d W]" <piko42> (Solar) { http="<[piko42cache:30000:REGEX(.*?String 1.*?Leistung</td>.*?(\\d*)</td>.*)]" }
Number Solar_AL_L2_Spannung     "L2 Spannung [%d V]" <piko42> (Solar) { http="<[piko42cache:30000:REGEX(.*?L2</u></td>.*?Spannung</td>.*?Spannung</td>.*?(\\d*)</td>.*)]" }
Number Solar_AL_L2_Leistung     "L2 Leistung [%d W]" <piko42> (Solar) { http="<[piko42cache:30000:REGEX(.*?L2</u></td>.*?Leistung</td>.*?(\\d*)</td>.*)]" }
Number Solar_AL_L3_Spannung     "L3 Spannung [%d V]" <piko42> (Solar) { http="<[piko42cache:30000:REGEX(.*?L3</u></td>.*?Spannung</td>.*?(\\d*)</td>.*)]" }
Number Solar_AL_L3_Leistung     "L3 Leistung [%d W]" <piko42> (Solar) { http="<[piko42cache:30000:REGEX(.*?L3</u></td>.*?Leistung</td>.*?(\\d*)</td>.*)]" }
Number Solar_Chart_Period "Chart Zeitraum" <piko42>
Number Azimuth "Azimuth [%.2f]" <sun> (Solar,Weather) { astro="planet=sun,type=position,property=azimuth" }
Number Elevation "Elevation [%.2f]" <sun> (Solar,Weather) { astro="planet=sun,type=position,property=elevation" }


/************************************************************************************/
/* Yahoo Wetter */
/************************************************************************************/
Number Weather_Temperature "Temperatur heute [%.1f °C]" <temperature> (Weather_Chart, logger) { http="<[http://weather.yahooapis.com/forecastrss?w=224466&u=c:60000:XSLT(yahoo_weather_temperature.xsl)]" }
String Weather_Temp_MinMax "Temperaturen heute min/max [%s]" <temperature> (Weather)
Number Weather_Temp_Max "Temperatur heute max [%.1f °C]" <temperature> (Weather_Chart)
Number Weather_Temp_Min "Temperatur heute min [%.1f °C]" <temperature> (Weather_Chart)
Number Weather_Humidity "Luftfeuchtigkeit heute [%.1f %%]" <water> (Weather, logger) { http="<[http://weather.yahooapis.com/forecastrss?w=224466&u=c:60000:XSLT(yahoo_weather_humidity.xsl)]" }
Number Weather_Humidex "Humidex [SCALE(humidex.scale):%s]" (Weather)
Number Weather_Chart_Period "Chart Zeitraum"
DateTime Weather_LastUpdate "Letzte Aktualisierung [%1$ta %1$tR]" <clock>
Number YahooWeatherCode "Heute ist es [MAP(yahoo_weather_code_de.map):%s]" (Weather) { http="<[http://weather.yahooapis.com/forecastrss?w=224466&u=c:60000:XSLT(yahoo_weather_code.xsl)]" }

/************************************************************************************/
/* Universal Weather Binding */
/************************************************************************************/
// temperature
Number   Temperature      "Temperature [%.2f °C]"      <temperature> (WeatherB, logger) {weather="locationId=home, type=temperature, property=current, scale=1"}
Number   Temp_Feel        "Temperature feel [%.2f °C]" <temperature> (WeatherB) {weather="locationId=home, type=temperature, property=feel"}
Number   Temp_Dewpoint    "Dewpoint [%.2f °C]"         <temperature> (WeatherB) {weather="locationId=home, type=temperature, property=dewpoint"}
// min and max values only available in forecasts
Number   Temp_Min         "Temperature min [%.2f °C]"  <temperature> (WeatherB) {weather="locationId=home, type=temperature, property=min"}
Number   Temp_Max         "Temperature max [%.2f °C]"  <temperature> (WeatherB) {weather="locationId=home, type=temperature, property=max"}
String   Temp_MinMax      "Min/Max [%s °C]"            <temperature> (WeatherB) {weather="locationId=home, type=temperature, property=minMax"}
// Forecast
Number   Temp_Min_0 "Temperature min [%.2f °C]"  <temperature> (WeatherB) {weather="locationId=home, forecast=0, type=temperature, property=min"}
Number   Temp_Max_0 "Temperature max [%.2f °C]"  <temperature> (WeatherB) {weather="locationId=home, forecast=0, type=temperature, property=max"}
Number   Temp_Min_1 "Temperature min 1[%.2f °C]"  <temperature> (WeatherB) {weather="locationId=home, forecast=1, type=temperature, property=min"}
Number   Temp_Max_1 "Temperature max 1[%.2f °C]"  <temperature> (WeatherB) {weather="locationId=home, forecast=1, type=temperature, property=max"}
Number   Temp_Min_2 "Temperature min 2[%.2f °C]"  <temperature> (WeatherB) {weather="locationId=home, forecast=2, type=temperature, property=min"}
Number   Temp_Max_2 "Temperature max 2[%.2f °C]"  <temperature> (WeatherB) {weather="locationId=home, forecast=2, type=temperature, property=max"}
Number   Temp_Min_3 "Temperature min 3[%.2f °C]"  <temperature> (WeatherB) {weather="locationId=home, forecast=3, type=temperature, property=min"}
Number   Temp_Max_3 "Temperature max 3[%.2f °C]"  <temperature> (WeatherB) {weather="locationId=home, forecast=3, type=temperature, property=max"}
Number   Temp_Min_4 "Temperature min 4[%.2f °C]"  <temperature> (WeatherB) {weather="locationId=home, forecast=4, type=temperature, property=min"}
Number   Temp_Max_4 "Temperature max 4[%.2f °C]"  <temperature> (WeatherB) {weather="locationId=home, forecast=4, type=temperature, property=max"}
DateTime Forecast_Day_1  "[%1$tA]" {weather="locationId=home, forecast=1, type=condition, property=observationTime"}
DateTime Forecast_Day_2  "[%1$tA]" {weather="locationId=home, forecast=2, type=condition, property=observationTime"}
DateTime Forecast_Day_3  "[%1$tA]" {weather="locationId=home, forecast=3, type=condition, property=observationTime"}
DateTime Forecast_Day_4  "[%1$tA]" {weather="locationId=home, forecast=4, type=condition, property=observationTime"}


// atmosphere
Number   Humidity         "Humidity [%d %%]"     <temperature> (WeatherB, logger) {weather="locationId=home, type=atmosphere, property=humidity"}
Number   Visibility       "Visibility [%.2f km]" <temperature> (WeatherB) {weather="locationId=home, type=atmosphere, property=visibility"}
Number   Pressure         "Pressure [%.2f mb]"   <temperature> (WeatherB, logger) {weather="locationId=home, type=atmosphere, property=pressure, scale=1"}
String   Pressure_Trend   "Pressuretrend [%s]"   <temperature> (WeatherB) {weather="locationId=home, type=atmosphere, property=pressureTrend"}
Number   Ozone            "Ozone [%d ppm]"       <temperature> (WeatherB) {weather="locationId=home, type=atmosphere, property=ozone"}
Number   UV_Index         "UV Index"             <temperature> (WeatherB) {weather="locationId=home, type=atmosphere, property=uvIndex, scale=0"}

// clouds
Number   Clouds   "Clouds [%.0f %%]"  <temperature> (WeatherB) {weather="locationId=home, type=clouds, property=percent"}

// condition
String   Condition        "Condition [%s]"     <temperature> (WeatherB) {weather="locationId=home, type=condition, property=text"}
String   CommonCondition   "[MAP(weather_de.map):%s]"   {weather="locationId=home, type=condition, property=commonId"}
String   Condition_ID     "Condition id [%s]"  <temperature> (WeatherB) {weather="locationId=home, type=condition, property=id"}
DateTime ObservationTime  "Observation time [%1$td.%1$tm.%1$tY %1$tH:%1$tM]"  <temperature> (WeatherB) {weather="locationId=home, type=condition, property=observationTime"}
DateTime LastUpdate       "Last update [%1$td.%1$tm.%1$tY %1$tH:%1$tM]"       <temperature> (WeatherB) {weather="locationId=home, type=condition, property=lastUpdate"}
String   CommonId         "Common id [%s]"     <temperature> (WeatherB) {weather="locationId=home, type=condition, property=commonId"}

// precipitation
Number   Rain          "Rain [%.2f mm/h]"  <temperature> (WeatherB, logger) {weather="locationId=home, type=precipitation, property=rain"}
Number   Rain_Inches   "Rain [%.2f in/h]"  <temperature> (WeatherB) {weather="locationId=home, type=precipitation, property=rain, unit=inches"}
Number   Snow          "Snow [%.2f mm/h]"  <temperature> (WeatherB) {weather="locationId=home, type=precipitation, property=snow"}
Number   Snow_Inches   "Snow [%.2f in/h]"  <temperature> (WeatherB) {weather="locationId=home, type=precipitation, property=snow, unit=inches"}
Number   Precip_Probability   "Precip probability [%d %%]"  <temperature> (WeatherB) {weather="locationId=home, type=precipitation, property=probability"}

// wind
Number   Wind_Speed           "Windspeed [%.2f km/h]"   <temperature> (WeatherB, logger) {weather="locationId=home, type=wind, property=speed"}
Number   Wind_Speed_Beaufort  "Windspeed Beaufort [%d]" <temperature> (WeatherB) {weather="locationId=home, type=wind, property=speed, unit=beaufort"}
Number   Wind_Speed_Knots     "Windspeed [%.2f kn]"     <temperature> (WeatherB) {weather="locationId=home, type=wind, property=speed, unit=knots"}
Number   Wind_Speed_Mps       "Windspeed [%.2f mps]"    <temperature> (WeatherB) {weather="locationId=home, type=wind, property=speed, unit=mps"}
Number   Wind_Speed_Mph       "Windspeed [%.2f mph]"    <temperature> (WeatherB) {weather="locationId=home, type=wind, property=speed, unit=mph"}
String   Wind_Direction       "Wind direction [%s]"     <temperature> (WeatherB) {weather="locationId=home, type=wind, property=direction"}
Number   Wind_Degree          "Wind degree [%.0f °]"    <temperature> (WeatherB) {weather="locationId=home, type=wind, property=degree"}
Number   Wind_Gust            "Wind gust [%.2f km/h]"   <temperature> (WeatherB) {weather="locationId=home, type=wind, property=gust"}
Number   Wind_Gust_Beaufort   "Wind gust Beaufort [%d]" <temperature> (WeatherB) {weather="locationId=home, type=wind, property=gust, unit=beaufort"}
Number   Wind_Gust_Knots      "Wind gust [%.2f kn]"     <temperature> (WeatherB) {weather="locationId=home, type=wind, property=gust, unit=knots"}
Number   Wind_Gust_Mps        "Wind gust [%.2f mps]"    <temperature> (WeatherB) {weather="locationId=home, type=wind, property=gust, unit=mps"}
Number   Wind_Gust_Mph        "Wind gust [%.2f mph]"    <temperature> (WeatherB) {weather="locationId=home, type=wind, property=gust, unit=mph"}
Number   Wind_Chill           "Wind chill [%.2f °C]"    <temperature> (WeatherB) {weather="locationId=home, type=wind, property=chill"}


/************************************************************************************/
/* ASTRO Binding */
/************************************************************************************/
DateTime Sunrise_Time  "Sonnenaufgang [%1$tH:%1$tM]" <sun> (Weather) { astro="planet=sun,type=rise,property=start" }
Switch Sunrise_Event   { astro="planet=sun,type=rise,property=start,offset=20" }
DateTime Sunset_Time   "Sonnenuntergang [%1$tH:%1$tM]" <sun> (Weather) { astro="planet=sun,type=set,property=end" }
Switch Sunset_Event    { astro="planet=sun,type=set,property=end"}
String Season_Name_Ger "Jahreszeit [MAP(season.map):%s]" <sun> (Weather) { astro="planet=sun,type=season,property=name" }
String Moon_Phase_Ger "Mondphase [MAP(moon.map):%s]" <moon> (Weather) { astro="planet=moon,type=phase,property=name" }
DateTime dawnStart "dawn start [%1$tH:%1$tM]" {astro="planet=sun,type=civilDawn,property=start"}
DateTime duskEnd   "dusk end [%1$tH:%1$tM]"   {astro="planet=sun,type=civilDusk,property=end"}

/************************************************************************************/
/* MPD */
/************************************************************************************/
String CurrentTrack "aktueller Titel [%s]" <loudspeaker> (Audio) { mpd="TITLE:smarthome:tracktitle" }
String CurrentArtist "Aktueller Künstler [%s]" <loudspeaker> (Audio) { mpd="ARTIST:smarthome:trackartist" }
String ConcatInfo "aktueller Titel [%s]" <loudspeaker> (Audio)
Switch Mpd_StartStop       "Start/Stop" <loudspeaker> (Audio) { mpd="ON:smarthome:play, OFF:smarthome:stop" }
Switch Mpd_NextPrev        "Steuerung" <loudspeaker> (Audio) { mpd="ON:smarthome:next, OFF:smarthome:prev" } 
Dimmer Mpd_VolumeControl   "Lautstärke [%d%%]" <loudspeaker> (Audio) { mpd="INCREASE:smarthome:volume_increase, DECREASE:smarthome:volume_decrease, PERCENT:smarthome:volume" }


default.sitemap

/************************************************************************************/
/* */
/************************************************************************************/

sitemap default label="home" 
{
Frame {
Text item=Date
}
Frame {
Text item=ConcatInfo {
Switch item=mpdAMP
Text item=CurrentArtist
Text item=CurrentTrack
Switch item=Mpd_StartStop mappings=[OFF="Pause", ON="Play"]
Switch item=Mpd_NextPrev  mappings=[OFF="Previous", ON="Next"]
Slider item=Mpd_VolumeControl
}
}
Frame {
Text item=S300TerrasseTemp label="Wetter [%.1f °C]" icon="sun" valuecolor=[Weather_LastUpdate=="Uninitialized"="lightgray",Weather_LastUpdate>90="lightgray",>25="orange",>15="green",>5="orange",<=5="blue"] {
Frame {
Webview url="/weather?locationId=home&layout=example&iconset=colorful" height=10
}
Frame {
Text item=YahooWeatherCode icon="yahoo_weather"
Text item=Weather_Humidex
Text item=S300TerrasseTemp valuecolor=[>25="orange",>15="green",>5="orange",<=5="blue"]
Text item=S300TerrasseHumi
Text item=S300GartenTemp valuecolor=[>25="orange",>15="green",>5="orange",<=5="blue"]
Text item=S300GartenHumi
Text item=Weather_Temperature valuecolor=[>25="orange",>15="green",>5="orange",<=5="blue"]
Text item=Weather_Humidity
Text item=Weather_LastUpdate visibility=[Weather_LastUpdate>30] valuecolor=[Weather_LastUpdate>120="orange", Weather_LastUpdate>300="red"]
Text item=Sunrise_Time
Text item=Sunset_Time
Text item=Season_Name_Ger
Text item=Moon_Phase_Ger
}
Frame {
Group item=WeatherB label="vollständige Daten" icon="sun" 
}
Frame {
Switch item=Weather_Chart_Period label="Chart Period" mappings=[0="Stunde", 1="Tag", 2="Woche"]
Chart item=Weather_Chart period=h refresh=6000 visibility=[Weather_Chart_Period==0, Weather_Chart_Period=="Uninitialized"]
Chart item=Weather_Chart period=D refresh=30000 visibility=[Weather_Chart_Period==1]
Chart item=Weather_Chart period=W refresh=30000 visibility=[Weather_Chart_Period==2]
}
}
}
Frame  {
Text item=Solar_Panel label="PV Anlage [%s]" {
Frame {
Text item=Solar_Aktuell
Text item=Solar_Tagesenergie
Text item=Solar_Gesamt
Group item=Solar label="alle Daten" icon="piko42"
Switch item=Solar_Chart_Period label="Chart Period" mappings=[0="Stunde", 1="Tag", 2="Woche"]
Chart item=Solar_Chart period=h refresh=6000 visibility=[Solar_Chart_Period==0, Solar_Chart_Period=="Uninitialized"]
Chart item=Solar_Chart period=D refresh=30000 visibility=[Solar_Chart_Period==1]
Chart item=Solar_Chart period=W refresh=30000 visibility=[Solar_Chart_Period==2]
}
}
}
Frame {
Group item=Windows
}
Frame {
Group item=Lights
}
Frame {
Text label="Erdgeschoss [%.1f °C]" item=HeizungErdgeschossMeasured icon="heating" {
Setpoint item=HeizungErdgeschossDesired minValue=6 maxValue=30 step=0.5 
Text item=HeizungErdgeschossMeasured
Text item=HeizungErdgeschossValve
Text item=HeizungErdgeschossBattery
Text item=FenstersensorKueche
}
Text label="Multiraum [%.1f °C]" item=HeizungMultiraumMeasured icon="heating" {
Setpoint item=HeizungMultiraumDesired minValue=6 maxValue=30 step=0.5 
Text item=HeizungMultiraumMeasured
Text item=HeizungMultiraumValve
Text item=HeizungMultiraumBattery
Text item=FenstersensorMultiraum
}
Text label="Nico [%.1f °C]" item=HeizungNicoMeasured icon="heating" {
Setpoint item=HeizungNicoDesired minValue=6 maxValue=30 step=0.5
Text item=HeizungNicoMeasured
Text item=HeizungNicoValve
Text item=HeizungNicoBattery
Text item=FenstersensorNico
}
Text label="Lina [%.1f °C]" item=HeizungLinaMeasured icon="heating" {
Setpoint item=HeizungLinaDesired minValue=6 maxValue=30 step=0.5
Text item=HeizungLinaMeasured
Text item=HeizungLinaValve
Text item=HeizungLinaBattery
Text item=FenstersensorLina
}
Text label="Dach [%.1f °C]" item=HeizungDachMeasured icon="heating" {
Setpoint item=HeizungDachDesired minValue=6 maxValue=30 step=0.5
Text item=HeizungDachMeasured
Text item=HeizungDachValve
Text item=HeizungDachBattery
}
}
Frame  {
Group item=Motion label="Bewegungsmelder [%s]" icon="motion" { 
Frame {
Switch item=Motion_Chart_Period label="Chart Period" mappings=[0="Stunde", 1="Tag", 2="Woche"]
Chart item=Motion_Chart period=h refresh=6000 visibility=[Motion_Chart_Period==0, Motion_Chart_Period=="Uninitialized"]
Chart item=Motion_Chart period=D refresh=30000 visibility=[Motion_Chart_Period==1]
Chart item=Motion_Chart period=W refresh=30000 visibility=[Motion_Chart_Period==2]
}
}
}
Frame {
Group item=Battery
}
}

Rules (at least some of them): 

rule AussenlichtZeitschalter  
when 
Item PirAussenwand received update
then
logInfo("RULES", "Aussenlicht-Zeitschalter: an für 10 Minuten") 
pushover("Aussenlicht-Zeitschalter an für 10 Minuten")
sendCommand(LichtAussenwand, ON)
createTimer(now.plusMinutes(10)) [|
sendCommand(LichtAussenwand, OFF)
]
end

rule "HaustuereAuf"
when
Item FenstersensorHaustuere changed from CLOSED to OPEN
then
logInfo("RULES", "Haustüre (" + FenstersensorHaustuere.state + ")") 
pushover("Die Haustüre wurde geöffnet (" + FenstersensorHaustuere.state + ")") 
end
rule "HaustüreZu"
when
Item FenstersensorHaustuere changed from OPEN to CLOSE
then
logInfo("RULES", "Haustüre: " + FenstersensorHaustuere.state.toString())
pushover("Die Haustüre wurde geschlossen  (" + FenstersensorHaustuere.state.toString() + ")")
end
rule "TerrassentüreAuf"
when
Item FenstersensorKueche changed from CLOSED to OPEN
then
var DateTime daystart = new DateTime((dawnStart.state as DateTimeType).calendar.timeInMillis)
        var DateTime dayend = new DateTime((duskEnd.state as DateTimeType).calendar.timeInMillis)
        val boolean isdark = now.isBefore(daystart) || now.isAfter(dayend)

logInfo("RULES", "Terrassentüre: " + FenstersensorKueche.state.toString() + ", isAfterSunset: " + isdark.toString())
pushover("Die Terrassentüre wurde geöffnet")
if ( isdark )
{
pushover("Terrassentüre nach Sonnenuntergang: Küchenlicht an für 10 Minuten")
sendCommand(LichtKueche, ON)
tenMinTimerState = true
tenMinTimer = createTimer(now.plusMinutes(10))[|
tenMinTimerState = false
sendCommand(LichtKueche, OFF)
pushover("Terrassentüre: Küchenlicht wieder aus nach 10 Minuten.")
]
}
end
rule "TerrassentüreZu"
when
Item FenstersensorKueche changed from OPEN to CLOSE
then
logInfo("RULES", "Terrassentüre: " + FenstersensorKueche.state.toString())
pushover("Die Terrassentüre wurde geschlossen  (" + FenstersensorKueche.state.toString() + ")")
end

//*****************************************************************************
rule KellerlichtZeitschalter
when 
Item LichtKellerflur received update ON
then
logInfo("RULES", "LichtKellerflur-Zeitschalter: an für 5 Minuten")  
createTimer(now.plusMinutes(5)) [|
sendCommand(LichtKellerflur, OFF)
]
end

//*****************************************************************************
//Rule at sunrise, Sonnenaufgang:
// ok, funktioniert
rule "Rule at sunrise"
when
Item Sunrise_Event received update ON
then
logInfo("RULES","Sunrise_Event received command ON") 
pushover("Sonnenaufgang: alle Aussenlampen ausgeschaltet.")
sendCommand(LichtAussenwand, OFF)
sendCommand(LichtGartentor, OFF)
end


Reply all
Reply to author
Forward
0 new messages