Skip to content
Snippets Groups Projects
Commit d7b4c529 authored by void's avatar void
Browse files

Zonenstatus über Openhab setzen

parent 4d1b7746
No related branches found
No related tags found
No related merge requests found
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
- conf/items/wled.items - conf/items/wled.items
- conf/persistence/influxdb.persist - conf/persistence/influxdb.persist
- conf/persistence/rrd4j.persist - conf/persistence/rrd4j.persist
- conf/rules/zonestatus.rules
- conf/services/addons.cfg - conf/services/addons.cfg
- conf/services/influxdb.cfg - conf/services/influxdb.cfg
- conf/services/mqtt.cfg - conf/services/mqtt.cfg
......
rule "Zonestatus"
when
Item Switch02 received update
then
val topic = "warpzone/door/status"
val message = if (Switch02.state == ON) "OPEN" else "CLOSED"
logInfo("default.rules","Switch02 updated to: " + Switch02.state + " sending: " + message + " to " + topic)
val mqttActions = getActions("mqtt", "mqtt:broker:mosquitto")
mqttActions.publishMQTT(topic, message)
end
// Netzwerk Geräte // Netzwerk Geräte
network:pingdevice:switch01 [ hostname="192.168.0.100", retry=1, timeout=5000, refreshInterval=10000, uses_arp_ping="yes" ] network:pingdevice:switch01 [ hostname="192.168.0.100", retry=1, timeout=5000, refreshInterval=10000, uses_arp_ping="no" ]
network:pingdevice:switch02 [ hostname="192.168.0.101", retry=1, timeout=5000, refreshInterval=10000, uses_arp_ping="yes" ] network:pingdevice:switch02 [ hostname="192.168.0.101", retry=1, timeout=5000, refreshInterval=10000, uses_arp_ping="no" ]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment