{"id":3911,"date":"2023-05-14T17:52:41","date_gmt":"2023-05-14T15:52:41","guid":{"rendered":"https:\/\/www.sigalou-domotique.fr\/?p=3911"},"modified":"2026-01-02T17:02:04","modified_gmt":"2026-01-02T15:02:04","slug":"relier-freepbx-et-home-assistant","status":"publish","type":"post","link":"https:\/\/www.sigalou-domotique.fr\/en\/relier-freepbx-et-home-assistant","title":{"rendered":"Connect FreePBX and Home Assistant"},"content":{"rendered":"<p>Once <a href=\"https:\/\/www.sigalou-domotique.fr\/en\/serveur-sip-local-avec-freepbx-sur-raspberry-pi\/\">FreePBX installed<\/a>, We'll link him to Home Assistant.<\/p>\r\n<p><!--more--><\/p>\r\n<h3>Add a Manager Asterisk<\/h3>\r\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3912\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk1.png\" alt=\"\" width=\"447\" height=\"150\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk1.png 447w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk1-300x101.png 300w\" sizes=\"auto, (max-width: 447px) 100vw, 447px\" \/><\/p>\r\n<h3>Allow Home Assistant IP<\/h3>\r\n<p>192.168.1.200 in my example<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3913\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk2.png\" alt=\"\" width=\"770\" height=\"328\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk2.png 770w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk2-600x256.png 600w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk2-300x128.png 300w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk2-768x327.png 768w\" sizes=\"auto, (max-width: 770px) 100vw, 770px\" \/><\/p>\r\n<h3>Correct bindadrr in \/etc\/asterisk\/manager.conf<\/h3>\r\n<p>Simply edit the \/etc\/asterisk\/manager.conf file from an SSH command line<\/p>\r\n<blockquote>\r\n<p>nano \/etc\/asterisk\/manager.conf<\/p>\r\n<\/blockquote>\r\n<p>replace bindaddr = 127.0.0.1 by bindaddr = 0.0.0.0<\/p>\r\n<p>Optional, if you want, you can check that <strong>Manager (AMI)<\/strong> indicates well <strong>Yes<\/strong> by going to the Asterisk console:<\/p>\r\n<blockquote>\r\n<p>asterisk -r<\/p>\r\n<\/blockquote>\r\n<p>and then by questioning him:<\/p>\r\n<blockquote>\r\n<p>manager show settings<\/p>\r\n<\/blockquote>\r\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3914\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk4.png\" alt=\"\" width=\"352\" height=\"93\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk4.png 352w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk4-300x79.png 300w\" sizes=\"auto, (max-width: 352px) 100vw, 352px\" \/><\/p>\r\n<h3>Install Asterisk-hass-integration<\/h3>\r\n<p>Everything is explained in the extension doc<\/p>\r\n<p><a href=\"https:\/\/github.com\/TECH7Fox\/asterisk-hass-integration\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/TECH7Fox\/asterisk-hass-integration<\/a><\/p>\r\n<h3>Add Asterisk integration<\/h3>\r\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3698\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/04\/ajouterintegration.png\" alt=\"\" width=\"262\" height=\"53\" \/><\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3918\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk5.png\" alt=\"\" width=\"398\" height=\"508\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk5.png 398w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk5-235x300.png 235w\" sizes=\"auto, (max-width: 398px) 100vw, 398px\" \/><\/p>\r\n<h3>Identify your user on the integration<\/h3>\r\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3919\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk6.png\" alt=\"\" width=\"312\" height=\"367\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk6.png 312w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk6-255x300.png 255w\" sizes=\"auto, (max-width: 312px) 100vw, 312px\" \/><\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3917\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk3.png\" alt=\"\" width=\"310\" height=\"127\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk3.png 310w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk3-300x123.png 300w\" sizes=\"auto, (max-width: 310px) 100vw, 310px\" \/><\/p>\r\n<h3>And this is the drama.<\/h3>\r\n<p>For an unknown reason, since version 1.x of the integration, the equipment does not go back:<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3922\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk7.png\" alt=\"\" width=\"215\" height=\"163\" \/><\/p>\r\n<p>So we will change the version and go back to the version <strong>v0.9.8<\/strong><\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3925\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk8.png\" alt=\"\" width=\"513\" height=\"417\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk8.png 513w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk8-300x244.png 300w\" sizes=\"auto, (max-width: 513px) 100vw, 513px\" \/><\/p>\r\n<p>We relaunch Home Assistant<\/p>\r\n<h3>Device and Entity Management<\/h3>\r\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3926\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk9.png\" alt=\"\" width=\"209\" height=\"159\" \/><\/p>\r\n<p>And here, at the relaunch, the devices (1 server + 3 lines) and the corresponding entities appeared.<\/p>\r\n<h3>There is a dedicated Card\u00a0<\/h3>\r\n<p>Go to HACS and then deposit customize, you can find this card (from the same author as the integration)<\/p>\r\n<p>https:\/\/github.com\/TECH7Fox\/sip-hass-card<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3928\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk10.png\" alt=\"\" width=\"436\" height=\"255\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk10.png 436w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk10-300x175.png 300w\" sizes=\"auto, (max-width: 436px) 100vw, 436px\" \/><\/p>\r\n<p>I tested this card but it allows me to make and receive calls, I am not interested, my home automation does not phone. I will use the information provided by the Asterisk-hass-integration integration to detect a call.<\/p>\r\n<h3>What information is retrieved?<\/h3>\r\n<h4>The Asterisk Server<\/h4>\r\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3930\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk11.png\" alt=\"\" width=\"517\" height=\"352\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk11.png 517w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk11-300x204.png 300w\" sizes=\"auto, (max-width: 517px) 100vw, 517px\" \/><\/p>\r\n<p>He gives me two pieces of information, the first is to Success, we are very happy to have succeeded, at this stage I do not know what, but as long as it remains to Success, I imagine it is a good sign. For the second information, Lastest DTMF Signal, I pressed all the keys to try to see what it refers to, we will see in time. I will come to complete this text if I understand.<\/p>\r\n<p>Finally, we see that my three lines 100, 201 and 203 are well connected to the server, very well.<\/p>\r\n<h4>Lines<\/h4>\r\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3931\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk12.png\" alt=\"\" width=\"502\" height=\"242\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk12.png 502w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk12-300x145.png 300w\" sizes=\"auto, (max-width: 502px) 100vw, 502px\" \/><\/p>\r\n<h5>Callee<\/h5>\r\n<p>In this entity, we will find the number of the correspondent.<\/p>\r\n<p>The number of the caller at the addressee and the number of the addressee at the caller.<\/p>\r\n<h5>channel<\/h5>\r\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3933\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk14.png\" alt=\"\" width=\"350\" height=\"68\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk14.png 350w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk14-300x58.png 300w\" sizes=\"auto, (max-width: 350px) 100vw, 350px\" \/><\/p>\r\n<p>This entity provides link information. If 100 phones at 201, both will have the same channel, we know that they are in communication.<\/p>\r\n<h5>Registered<\/h5>\r\n<p>Obviously, this is to check that the extension is well identified and connected to the server.<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3932\" src=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk13.png\" alt=\"\" width=\"351\" height=\"32\" srcset=\"https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk13.png 351w, https:\/\/www.sigalou-domotique.fr\/wp-content\/uploads\/2023\/05\/asterisk13-300x27.png 300w\" sizes=\"auto, (max-width: 351px) 100vw, 351px\" \/><\/p>\r\n<p>It is interesting to have this in order to be able to signal a disconnection. When the extension is no longer registered, the value \u2018Disabled\u2019 appears. I have noted that switching off is quite fast if you disconnect equipment.<\/p>\r\n<h5>State\u00a0<\/h5>\r\n<p>Can take values:<\/p>\r\n<p>UNKNOWN | NOT_INUSE | INUSE | BUSY | INVALID | UNAVAILABLE | RINGING | RINGINUSE | ONHOLD<\/p>\r\n<p>But overall, I used:<\/p>\r\n<ul>\r\n<li><strong>RINGING<\/strong> when it rings<\/li>\r\n<li><strong>INUSE<\/strong> when I am in communication (or when the caller rings)<\/li>\r\n<li><strong>NOT_INUSE<\/strong> the rest of the time<\/li>\r\n<\/ul>\r\n<h3>What concrete applications now?<\/h3>\r\n<p>If, as in my case, one of the lines is the doorman, one can imagine:<\/p>\r\n<ul>\r\n<li>Relay the doorbell on the doorman with music, an Alexa message or any sound or light information.<\/li>\r\n<li>To support the doorbell, turn on the external lights<\/li>\r\n<li>If there is no one in the house, receive a notification on the phone with a photo of the entrance camera<\/li>\r\n<\/ul>\r\n<p>&nbsp;<\/p>\r\n<p>&nbsp;<\/p>\r\n<p>&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>Once FreePBX is installed, we'll link it to Home Assistant.<\/p>","protected":false},"author":1,"featured_media":3926,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[14,53,166],"tags":[93],"class_list":["post-3911","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-domotique","category-home-assistant","category-retex","tag-telephone"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/posts\/3911","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/comments?post=3911"}],"version-history":[{"count":0,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/posts\/3911\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/media\/3926"}],"wp:attachment":[{"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/media?parent=3911"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/categories?post=3911"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sigalou-domotique.fr\/en\/wp-json\/wp\/v2\/tags?post=3911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}