ha-plugins icon indicating copy to clipboard operation
ha-plugins copied to clipboard

Multiple `audio_file` and/or `message`

Open topic2k opened this issue 1 year ago • 6 comments

I would like to have the option to use multiple times the audio_file and/or message config items. Maybe another config item could be used for that, something like 'playlist'.

My usecase is, that i want to use ha-sip to call me in case of an alarm (water, smoke, gas, burglar, etc.). When it does so, it first should play an introducing message ("Attention, automatic message"), then the cause ("smoke detected") and finally an ending message ("please confirm with pin"). Of course i could join the introducing and ending message to every type of alarm, but IMO it would be more flexible with separated files.

In combination with post_action: repeat_message all messages should be repeated. Maybe others then have a need for a post_action type 'repeat_last_message'.

As i saw #33, it seems you're not interested in this feature. So i would like to know, what steps do i need to do, to use my fork in HA? (want to try to code this feature request)

topic2k avatar Mar 20 '23 17:03 topic2k

Are you using audio_file or message for that? If you use TTS you could probably concatenate your messages inside your home-assistant action?

For using a different repo inside home assistant you can check out the build.sh file in the root of the repository. the "build-next" command changes everything to make the add-on available under a different repo. Except the docker image, which you can change in config.json in the ha-sip directory.

arnonym avatar Mar 20 '23 17:03 arnonym

Ok, i will try it next weekend.

EDIT: Currently i use an audio file, but i want to use a mixture of audio files and tts message. My alarm system sends text from where the alarm originates and that i want to add to the audio files.

topic2k avatar Mar 20 '23 18:03 topic2k

Hey topic2k,

I saw your fork, does this work for you so far? Would you be interested to merge that back into origin?

arnonym avatar Mar 30 '23 08:03 arnonym

Hey, it's not working yet. My problem is, that i've never before used docker for coding. So currently i'm playing with docker to find a way to remote debug the script. I also attempted to compile pjsua2 and directly test it with a sample script, but with no luck. Maybe it's because i'm on Windows. Next i will setup a virtualbox and try there.

When i'm succesfull, i will do a pull-request, but this could take some more time. If you want this issue to be closed, it's ok for me.

topic2k avatar Mar 30 '23 17:03 topic2k

I've added a new command in build.sh to create a virtual environment, this should work in your virtual machine. I also added some notes to the end of the docs regarding local development.

arnonym avatar Mar 31 '23 15:03 arnonym

Cool, thank you. That was exactly the tips i needed. Now i'm testing and then will make a pull request.

topic2k avatar Apr 01 '23 13:04 topic2k