Skip to content

Instantly share code, notes, and snippets.

@semaf
Last active December 25, 2017 12:21
Show Gist options
  • Save semaf/fe9814d4bf07d035a755198d99e16f5f to your computer and use it in GitHub Desktop.
Save semaf/fe9814d4bf07d035a755198d99e16f5f to your computer and use it in GitHub Desktop.
MQTTWarn INI File for OpenHAB item and rule - XIAOMI - Philips HUE
Switch Wohnzimmerlicht { channel="hue:0100:xxxxxxxxxxx:1:brightness" }
Contact Fensterstatus "Fenster Status" { channel = "mihome:sensor_magnet:158d00019f51cb:isOpen"}
String VT_Notify_Trace { mqtt=">[broker:/openhab/notification/trace:state:*:default]" }
String VT_Notify_Info { mqtt=">[broker:/openhab/notification/info:state:*:default]" }
String VT_Notify_Alert { mqtt=">[broker:/openhab/notification/alert:state:*:default]" }
String VT_Notify_Warn { mqtt=">[broker:/openhab/notification/warn:state:*:default]" }
String VT_Notify_Alarm { mqtt=">[broker:/openhab/notification/alarm:state:*:default]" }
// PHILIPS HUE WHITE BULB
rule "WohnzimmerLichtAn"
when
Item Wohnzimmerlicht changed from OFF to ON
then
VT_Notify_Alarm.postUpdate("Wohnzimmer Licht EIN")
end
rule "WohnzimmerLichtAus"
when
Item Wohnzimmerlicht changed from ON to OFF
then
VT_Notify_Alarm.postUpdate("Wohnzimmer Licht AUS")
end
// XIAOMI DOOR MAGNET
rule "Fensterstatus"
when
Item Fensterstatus changed
then
if (Fensterstatus.state == OPEN) {
VT_Notify_Alarm.postUpdate("Fenster offen")
sendCommand(Wohnzimmerlicht, ON)
} else {
VT_Notify_Alarm.postUpdate("Fenster geschlossen")
sendCommand(Wohnzimmerlicht, OFF)
}
end
[config:slack]
token = 'xoxb-xxxxxxxxxxxx-xxxxxxxxxxxx'
targets = {
# #channel/@user username, icon
'mqtt-client' : [ '#allgemein', "openhab", ':hankey:' ]
}
[/openhab/notification/]
targets = file:mylog, log:info
[#]
targets = slack:mqtt-client
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment