### Sample AmbientLight

TinkerForge RED Brick openHAB example AmbientLight.
Brick Setup:
RED Brick > Master Brick > AmbientLight Bricklet.
Example uses the AmbientLight Bricklet with UID mdh.
Sample 1 = Displaying the Luminance value only
Items
//stored in /etc/openhab/configurations/items/weather-station.items
Number TF_AmbientLight "Luminance [%.0f lx]" { tinkerforge="uid=mdh" }
SiteMap
//stored in /etc/openhab/configurations/sitemaps/weather-station.sitemap
sitemap tf_weather_station label="Weather Station"
{
Frame
{
Text item=TF_AmbientLight
}
}
Access a SiteMap
Accessing the SiteMap run http://red-brick-ip-address/openhab.app?sitemap=your-sitemap
Example based on previous configuration files:
http://192.168.0.30:8080/openhab.app?sitemap=weather-station
Sample 2 = Displaying the Luminance value and a Chart (Persistence and rrb4j database)
Embedding a Chart
Example displaying TinkerForge AmbientLight data with the option to select the period Hour, Day or Week.
weather-station.items
Number TF_AmbientLight "Luminance [%.0f lx]" { tinkerforge="uid=mdh" }
Number CHART_PERIOD
weather-station.rules
Not used.
weather-station.sitemap
sitemap tf_weather_station label="Weather Station"
{
Frame
{
Text item=TF_AmbientLight
Switch item=CHART_PERIOD label="Chart Range" mappings=[0="hour", 1="day", 2="week"]
Chart item=TF_AmbientLight period=h refresh=300 visibility=[CHART_PERIOD==0, CHART_PERIOD=="Uninitialized"]
Chart item=TF_AmbientLight period=D refresh=1800 visibility=[CHART_PERIOD==1]
Chart item=TF_AmbientLight period=W refresh=3600 visibility=[CHART_PERIOD==2]
}
}
Access the Chart
http://192.168.0.30:8080/openhab.app?sitemap=weather-station
OR
http://192.168.0.30:8080/chart?items=TF_AmbientLight&period=h&h=800&w=1200

Changed: , Category: TinkerForge openHAB, File: T6C267M1992.htm, ID: 1992