I want to play the “doorbell” sound by a self-defined rule (created with the Eclipse Smart Home IDE). I want to play the sound when an Item receives a command.
When I use the Rules Engine via the Paper UI everything works fine, see the screenshots of my rule:
Everytime I send a MQTT message to the specified topic, the sound is played in my browser tab with the OpenHAB UI opened.
However, I tried to “code” this rule also by the Eclipse Smart Home IDE, I used the following code:
rule "TestA" when Item TestStringItem received command then playSound("doorbell.mp3") end
This seems not to work, the “playSound” command is not known - I get the following error on the code:
The method playSound(String) is undefined
How can I use the Audio functions in my rules code?