Openhab> smarthome:audio play doorbell.mp3

OK I’m failing at a simple instruction…

My aim is to make a door bell, I have looked though the forum and have a plan on how to achieve it and my first plan was to make sure I could play the doorbell file…
Using the MultiMedia Guide I thought it should be easy.

  1. Set Audio Source using paperUI

OK so I did this and set Default Sink to my device.

I then checked the configfile and under audio:
AUDIO #######################

This parameter defines the default audio source to use (if not set, the first available one will be used.

#org.eclipse.smarthome.audio:defaultSource=

This parameter defines the default audio sink to use (if not set, the first available one will be used.

#org.eclipse.smarthome.audio:defaultSink=

#####################

Which leads me to think it’s not saving. (Dir of file I checked; \OPENHABIANPI\openHAB-conf\services\runtime.cfg)?

I could edit the file but I’m unsure on the format to enter into the config file…

So I moved on and wanted to check:

  1. Using the console I then tried the command:
    smarthome:audio play doorbell.mp3 :

[19:41:27] openhabian@openHABianPi:~$ smarthome:audio play doorbell.mp3
-bash: smarthome:audio: command not found

So from this I figured that I am missing some configurations. If anyone have a guide or a few pointers I’d like to knew what I’m missing.

Thanks in advance

You have to run this command from the Karaf Shell, not the bash.

You seem to use openHABian. Just type the alias “karafshell” into your bash prompt, press enter and you will be connected to you karaf shell.

OK please excuse my ignorance.

I logged into openHabian via putty. Entered “karafshell” and get:
-bash: Karafshell: command not found

I’ve had a look over the forum and found the guidance to shh via:

ssh karaf@localhost - 8101

so I tried this via putty and no connection.

Do I need to enable the karafshell?

Thanks

You need to use openhab as user for karaf.

And you cannot do this via putty, because karaf is only open for localhost (from your bash running on your openhabian).

This is the part in the official docs: http://docs.openhab.org/administration/console.html#connecting-via-ssh

Are you sure you typed karafshell in lowercase? The above seems to indicate that you typed Karafshell (with a capital K) instead of karafshell.

Many thanks SiLeX the documentation, I can now send the smarthome:audio play doorbell.mp3 command as I am logging into the Karafshell.

I can now look into making a suitable trigger.

I know you got it working but while trying I was wondering how to add my own sounds or where to location for the files is actually.

I may state the obvious (it is not mentioned on the multimedia guide or I have overlooked it) and I could have easily spotted it but … I didn’t find itat first :wink:: So for those who are as blind as I am…

The location is under “/etc/openhab2/sound”

Just add your sound file there and play it.