Hi there,
even I’ve searched the forum and found a couple of similar questions, none of them works for me. I’m trying to start automate some things by rule scripts. For a very first test and to get familar I just want to switch on my lights if a phone call arrives. I’ve configured FritzboxTR064 Binding (in an .item file) and even have all my hue lights configured in an item file. Here is my simple rule I want to run:
rule "Eingehender Anruf"
when
Item fboxRinging received command ON
then
Licht_Wohnzimmer.sendCommand(ON)
end
The fboxRinging item is defined as:
Switch fboxRinging "Phone ringing [%s]" {fritzboxtr064="callmonitor_ringing" }
The Licht_Wohnzimmer as:
Switch Licht_Wohnzimmer "Wohnzimmerlicht" [ "Lighting" ] { channel="hue:0210:00178861c975:WohnzimmerDecke:color" }
If I set up a similar rule in Paper UI with the ‘Rule Engine (Experimental)’ this rule works well. I’ve even created a sitemap where I have the following configured:
Switch item=fboxRinging label="Eingehender Anruf"
Now, when I access the sitemap and switch on the item manually, the rule works fine, too. For this case, the Event log shows the following:
2018-01-01 23:38:15.805 [ome.event.ItemCommandEvent] - Item 'fboxRinging' received command ON
2018-01-01 23:38:15.854 [vent.ItemStateChangedEvent] - fboxRinging changed from OFF to ON
2018-01-01 23:38:15.896 [vent.ItemStateChangedEvent] - Licht_Wohnzimmer changed from OFF to ON
But if I just upload the rule script above, nothing happens. I think it’s not triggered because what I see in the Event log is, that in the case a call arrives there is no ‘Item’ mentioned. It just says: fboxRinging changed from NULL to ON but above in the log there is the additional line Item ‘fboxRinging’ received command ON
This is all I get in the log if a call arrives when I just use the rule script:
2018-01-02 10:18:26.186 [vent.ItemStateChangedEvent] - fboxRinging changed from NULL to ON
2018-01-02 10:18:26.192 [vent.ItemStateChangedEvent] - fboxIncomingCallResolved changed from NULL to 089123456846
2018-01-02 10:18:36.963 [vent.ItemStateChangedEvent] - fboxOutgoingCall changed from NULL to
2018-01-02 10:18:36.970 [vent.ItemStateChangedEvent] - fboxRinging changed from ON to OFF
I don’t know why the Item is not triggered or at least not mentioned? What is different to the Rule configuration in Paper UI:
Thanks for any help on this.