arnonym / ha-plugins

Home-Assistant SIP Gateway
Apache License 2.0
157 stars 19 forks source link

adding mqtt for stand-alone mode #101

Closed eporsche closed 3 months ago

eporsche commented 3 months ago

This pull request will add the ability to run this addon standalone for Home Assistant Container installations.

eporsche commented 3 months ago

I am not sure about the "addon: 8cd50eef_ha-sip-next" changes in the readme which came from the other pull request.

arnonym commented 3 months ago

This is done automatically by the build.sh build-next script. we need to undo those!

eporsche commented 3 months ago

Looks better now

arnonym commented 3 months ago

Can you rebase a last time?

eporsche commented 3 months ago

Not sure what todo next. What do you mean by rebase?

arnonym commented 3 months ago

Rebase to the next branch, or merge next into your branch. There are some conflicts which don't allow to merge this branch into my.

eporsche commented 3 months ago

not 100% sure - but I hope i did it right

arnonym commented 3 months ago

That does not look too well. If you add me to your fork of the repo, I could try to correct that?

arnonym commented 3 months ago

I merged your contributions to the next branch! If you want, you can re-check if everything is correct. I'll create a release in the next few days! Thanks again for your work!

arnonym commented 3 months ago

I still have a question: is it possible to write the payload to mqtt.publish as yaml also? For the stdin method the yaml is automatically converted to json when sending it. Would be easier to read.

arnonym commented 3 months ago

And would you like to be mentioned in the release notes?

eporsche commented 3 months ago

I still have a question: is it possible to write the payload to mqtt.publish as yaml also? For the stdin method the yaml is automatically converted to json when sending it. Would be easier to read.

Home assistant wants to have a string for the payload, otherwise it will complain: "value should be a string for dictionary value @ data['payload']". The only thing possible right now is to re-format the json part a bit in order to make it more readable:

service: mqtt.publish
metadata: {}
data:
  payload: |-
    {
      "command": "dial",
      "number": "sip:**620@fritz.box",
      "menu": {
          "message": "Hello from ha-sip.",
          "language": "en"
          }
    }
  topic: hasip/execute
eporsche commented 3 months ago

I merged your contributions to the next branch! If you want, you can re-check if everything is correct. I'll create a release in the next few days! Thanks again for your work!

The next branch works great! I tried the run-local and standalone version.

Thank you very much for creating this sip addon and making the standalone addition possible!

Sorry for my bad git skills though. I guess I need to improve those!

And would you like to be mentioned in the release notes?

Sure. :)

arnonym commented 3 months ago

Thanks for testing!

The git situation was not that easy to solve, because i rewrote history to have a nice commit history. My bad!

And I got you covered: https://github.com/arnonym/ha-plugins/blob/next/ha-sip/CHANGELOG.md#37

If you want you can make a post to https://community.home-assistant.io/t/home-assistant-sip-gateway/333694 after the release, because they were a few people asking for running ha-sip outside of home-assistant OS.

arnonym commented 3 months ago

I've just released 3.7! :partying_face:

eporsche commented 3 months ago

Left a quick note in the thread you mentioned! 😉

arnonym commented 3 months ago

Did you really read through all the posts to find the people who mentioned the need for a stand-alone version? That's crazy! Thanks for your support!

eporsche commented 3 months ago

😆 - I used the search function! 😉 But then I also read through the post.. just to find some other use cases!