Notification if ITEM stays OPEN

@Simon_B Your rule rewritten in JRuby Scripting

require 'openhab'

rule "Briefkasten" do
  changed Briefkasten, to: "OPEN", for: 30.seconds, attach: "Briefkasten ist noch offen!" 
  changed Briefkasten, to: "CLOSED", attach: "Ich glaube Du hast Post!"
  run do |event|
    Echo_Kueche.command(event.attachment)
    things["telegram:telegramBot:b99"].sendTelegram(event.attachment)
  end
end

The only caveat is the command to Echo_Kueche is the same as telegram. It can be made different of course but the rule will be a bit less compact.

EDITED because Briefkasten is a string item, not a Contact

1 Like