-
Notifications
You must be signed in to change notification settings - Fork 0
Astro binding
Public 1.6.0 builds
Release Notes
Download
The Astro binding is used for:
- calculating the sunrise, noon and sunset time
- scheduling of events at sunrise, noon and sunset
- calculating the azimuth and elevation (e.g. for auto shading with RollerShutter, ...)
############################## Astro Binding ##############################
#
# Your latitude
astro:latitude=nn.nnnnnn
# Your longitude
astro:longitude=nn.nnnnnn
# Refresh interval for azimuth and elevation calculation in seconds (optional, defaults to disabled)
astro:interval=nnn
Number Azimuth "Azimuth [%.2f]" {astro="type=AZIMUTH"}
Number Elevation "Elevation [%.2f]" {astro="type=ELEVATION"}
DateTime Sunrise_Time "Sunrise [%1$tH:%1$tM]" {astro="type=SUNRISE_TIME"}
DateTime Noon_Time "Noon [%1$tH:%1$tM]" {astro="type=NOON_TIME"}
DateTime Sunset_Time "Sunset [%1$tH:%1$tM]" {astro="type=SUNSET_TIME"}
Switch Sunrise_Event {astro="type=SUNRISE"}
Switch Noon_Event {astro="type=NOON"}
Switch Sunset_Event {astro="type=SUNSET"}
The Azimuth and Elevation items are updated at the configured refresh interval in openhab.cfg.
At midnight, the sunrise, noon and sunset time is calculated, published and the event jobs are scheduled. The sunrise, noon and sunset Switches are updated with ON followed by a OFF at the calculated time.
Rule at sunrise:
rule "Example Rule at sunrise"
when
Item Sunrise_Event received update ON
then
...
end
Rule to close all RollerShutters after sunset and the outside temperature is lower than 5 degrees:
rule "Close RollerShutters if cold after sunset"
when
Item Temp_Outside changed
then
if (now.isAfter((Sunset_Time.state as DateTimeType).calendar.timeInMillis) &&
(Temp_Outside.state as DecimalType).intValue < 5) {
RollerShutters?.members.forEach(r | sendCommand(r, DOWN))
}
end
Let's say, you know that the sun is shining through your livingroom window between Azimuth 100 and 130. If it's summer you want to close the RollerShutter.
rule "Autoshading RollerShutter"
when
Item Azimuth changed
then
var int azimuth = (Azimuth.state as DecimalType).intValue
if (azimuth > 100 && azimuth < 130) {
sendCommand(Rollershutter_Livingroom, DOWN)
}
...
end
All sun calculations are now based on those of http://www.suncalc.net/
New item binding style! The old style is still supported, but a warning is written to the log.
{astro="planet=..., type=..., property=..., offset=..."}
Important: type and property are case sensitive! So enter the values exactly as shown.
planet
currently only sun
ist available, more to come
type: rise, set, noon, night, morningNight, astroDawn, nauticDawn, civilDawn, astroDusk, nauticDusk, civilDusk, eveningNight, daylight
-
property:
start
(DateTime),end
(DateTime),duration
(Number)
type: position
-
property:
azimuth, elevation
(Number)
offset (optional, taken into account for property start
and end
)
offset in minutes to the calculated time
You can bind a property to different item types, which has a special meaning in the binding. If you bind a DateTime property (start, end) to a DateTime Item, the DateTime is simply displayed. If you bind it to a Switch, a event is scheduled and the state of the Switch is updated to ON, followed by a OFF at the calculated time. You can even specify a offset for the event and bind multiple items to the same property.
Examples:
// shows the sunrise
DateTime Sunrise_Time "Sunrise [%1$tH:%1$tM]" {astro="planet=sun, type=rise, property=start"}
// schedules a event which starts at sunrise, updating the Switch with ON, followed by a OFF
Switch Sunrise_Event {astro="planet=sun, type=rise, property=start"}
// schedules a event which starts 10 minutes AFTER sunrise
Switch Sunrise_Event {astro="planet=sun, type=rise, property=start, offset=10"}
// schedules a event which starts 10 minutes BEFORE sunrise
Switch Sunrise_Event {astro="planet=sun, type=rise, property=start, offset=-10"}
// shows the sunset
DateTime Sunset_Time "Sunset [%1$tH:%1$tM]" {astro="planet=sun, type=set, property=end"}
// schedules a event which starts 30 minutes BEFORE sunset:
Switch Sunset_Event {astro="planet=sun, type=set, property=end, offset=-30"}
// displays the start, end and duration of the astroDawn
DateTime Astro_Dawn_Start "Astro Dawn Start [%1$tH:%1$tM]" {astro="planet=sun, type=astroDawn, property=start"}
DateTime Astro_Dawn_End "Astro Dawn End [%1$tH:%1$tM]" {astro="planet=sun, type=astroDawn, property=end"}
// duration in minutes
Number Astro_Dawn_Duration "Astro Dawn Duration [%f]" {astro="planet=sun, type=astroDawn, property=duration"}
// duration formatted to a string, e.g. 02:32 (2 hours, 32 minutes)
String Astro_Dawn_Duration_Str "Astro Dawn Duration [%s]" {astro="planet=sun, type=astroDawn, property=duration"}
// azimuth and elevation
Number Azimuth "Azimuth [%.2f]" {astro="planet=sun, type=position, property=azimuth"}
Number Elevation "Elevation [%.2f]" {astro="planet=sun, type=position, property=elevation"}
22.07.2014 (pb01): download binding
- initial public 1.6.0 build (works in openHab 1.5.x too)
###Linux / OS X
###Windows
- Cosm Persistence
- db4o Persistence
- Exec Persistence
- InfluxDB Persistence
- JDBC Persistence
- JPA Persistence
- Logging Persistence
- mapdb Persistence
- MongoDB Persistence
- MQTT Persistence
- my.openHAB Persistence
- MySQL Persistence
- rrd4j Persistence
- Sen.Se Persistence
- SiteWhere Persistence
- AlarmDecoder Binding
- Anel Binding
- Arduino SmartHome Souliss Binding
- Asterisk Binding
- Astro Binding
- Autelis Pool Control Binding
- BenQ Projector Binding
- Bluetooth Binding
- Bticino Binding
- CalDAV Binding
- Comfo Air Binding
- Config Admin Binding
- CUL Binding
- CUL Intertechno Binding
- CUPS Binding
- DAIKIN Binding
- Davis Binding
- Denon Binding
- digitalSTROM Binding
- DMX512 Binding
- DSC Alarm Binding
- DSMR Binding
- eBUS Binding
- Ecobee Binding
- EDS OWSever Binding
- eKey Binding
- Energenie Binding
- EnOcean Binding
- Enphase Energy Binding
- Epson Projector Binding
- Exec Binding
- Freebox Binding
- Freeswitch Binding
- Frontier Silicon Radio Binding
- Fritz AHA Binding
- Fritz!Box Binding
- FS20 Binding
- Global Cache IR Binding
- GPIO Binding
- HAI/Leviton OmniLink Binding
- HDAnywhere Binding
- Heatmiser Binding
- Homematic / Homegear Binding
- HTTP Binding
- IEC 62056-21 Binding
- IHC / ELKO Binding
- ImperiHome Binding
- Insteon Hub Binding
- Insteon PLM Binding
- IPX800 Binding
- IRtrans Binding
- jointSPACE-Binding
- KNX Binding
- Koubachi Binding
- LCN Binding
- LightwaveRF Binding
- Leviton/HAI Omnilink Binding
- Lg TV Binding
- Logitech Harmony Hub
- MailControl Binding
- MAX!Cube-Binding
- MAX! CUL Binding
- MiLight Binding
- MiOS Binding
- Modbus TCP Binding
- MPD Binding
- MQTT Binding
- MQTTitude binding
- Neohub Binding
- Nest Binding
- Netatmo Binding
- Network Health Binding
- Network UPS Tools Binding
- Nibe Heatpump Binding
- Nikobus Binding
- Novelan/Luxtronic Heatpump Binding
- NTP Binding
- One-Wire Binding
- Onkyo AV Receiver Binding
- Open Energy Monitor Binding
- OpenPaths presence detection binding
- OpenSprinkler Binding
- OSGi Configuration Admin Binding
- Panasonic TV Bindung
- panStamp Binding
- Philips Hue Binding
- Piface Binding
- pilight Binding
- Pioneer-AVR-Binding
- Plex Binding
- Plugwise Binding
- PLCBus Binding
- Primare Binding
- Pulseaudio Binding
- RFXCOM Binding
- RWE Smarthome Binding
- Sager WeatherCaster Binding
- Samsung AC Binding
- Samsung TV Binding
- Serial Binding
- Sallegra Binding
- Satel Alarm Binding
- Sinthesi Sapp Binding
- Snmp Binding
- Somfy URTSI II Binding
- Sonos Binding
- Squeezebox Binding
- Swegon ventilation Binding
- System Info Binding
- TA CMI Binding
- TCP/UDP Binding
- Tellstick Binding
- TinkerForge Binding
- Tivo Binding
- VDR Binding
- Velleman-K8055-Binding
- Wago Binding
- Wake-on-LAN Binding
- Waterkotte EcoTouch Heatpump Binding
- Weather Binding
- Wemo Binding
- Withings Binding
- XBMC Binding
- xPL Binding
- Yamahareceiver Binding
- Zibase Binding
- Z-Wave Binding
- Asterisk
- Google Calendar
- Linux Media Players
- ROS Robot Operating System
- Telldus Tellstick
- Zoneminder
- Wink Hub (rooted)
- Wink Monitoring
- Transformations
- XSLT
- JSON
- REST-API
- Security
- Service Discovery
- Voice Control
- BritishGasHive-Using-Ruby
- Dropbox Bundle
A good source of inspiration and tips from users gathered over the years. Be aware that things may have changed since they were written and some examples might not work correctly.
Please update the wiki if you do come across any out of date information.
- Comfo Air Binding
- Ecobee Examples
- Nest Examples
- Rollershutter Bindings
- Squeezebox
- WAC Binding
- WebSolarLog
- Alarm Clock
- Convert Farenheit to Celcius
- The mother of all lighting rules
- Reusable Rules via Functions
- Combining different Items
- Items, Rules and more Examples of a SmartHome
- Google Map
- Controlling openHAB with Android
- Usecase examples
- B-Control Manager
- Spell checking for foreign languages
- Flic via Tasker
- Chromecast via castnow