Hello,
I recently updated to OH3 and the rule below stopped working. I updated it to the form shown here now but it seems I am still missing something. The purpose of the rule is to check if the Smart Plug still measures power consumption and if not after 10 Minutes to trigger certain actions.
My I kindly ask for your guidance how I can update this rule to work in OH3?
triggers:
- id: "1"
configuration:
itemName: Verbrauch_Kodi
previousState: ""
type: core.ItemStateChangeTrigger
conditions: []
actions:
- inputs: {}
id: "2"
configuration:
type: application/vnd.openhab.dsl.rule
script: >
if(Verbrauch_Kodi.state < 2){
if (timerKodiabschalten===null) {
timerKodiabschalten = createTimer(now.plusMinutes (10), [ |
if(Verbrauch_Kodi.state < 2){
Kodi_Energiezufuhr.sendCommand(OFF)
Lebensbaum_Licht.sendCommand(OFF)
KrakeImWohnzimmer_Helligkeit.sendCommand(0)
}
timerKodiabschalten = null
])}
}
if(Verbrauch_Kodi.state >= 2){
timerKodiabschalten?.cancel
timerKodiabschalten = null // cancel timer if power consumption raises
}
type: script.ScriptAction
ps: I there a guide on how to change OH2 rules to OH3 rules?