Facebook Messenger Support


I’d love to be able to use a Facebook Messenger bot to receive notifications from and maybe even interact with HA.
Maybe something similar to notify.telegram ?

There are several python libraries for Messenger (pymessenger and PyMessager come to mind).


Here is some inspiration. :slight_smile:


1 Like

It would be awesome to have HA tie into FB Messenger like Jarvis does.

Just an FYI this is in now implemented, although there is a bug which has had a fix put in place.

I’ve tested and it is working great. I can finally move away from having other apps on my phone just so I can receive notifications from HomeAssistant.

I only wish (greedily) that it had support for attachments (images/videos etc). It looks like this could be done via curl and the shell command in the meantime.


i am trying install facebook component but i have this error on my log:
17-01-23 12:08:19 homeassistant.util.yaml: Unable to read file /home/homeassistant/.homeassistant/includes/automation/face.yaml: ‘utf-8’ codec can’t decode byte 0xe9 in position 170: invalid continuation byte

how i can fix this?
@pschmitt @CCOSTAN @Pawny

Hmmm, sounds like a problem with the yaml file? Maybe try create a new yaml file and copy the contents across. If still no luck, check the syntax in the file.

@Pawny i creat a new yaml file and the same:

17-01-24 02:27:58 homeassistant.bootstrap: Setting up notify
17-01-24 02:27:58 homeassistant.bootstrap: Error during setup of component notify
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/bootstrap.py", line 151, in _async_setup_component
None, component.setup, hass, config)
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/notify/__init__.py", line 143, in setup
if not setup_notify_platform(platform, p_config):
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/notify/__init__.py", line 89, in setup_notify_platform
hass, p_config, discovery_info)
TypeError: get_service() takes 2 positional arguments but 3 were given
17-01-24 02:27:58 homeassistant.loader: Loaded sensor.google_travel_time from homeassistant.components.sensor.google_travel_time
17-01-24 02:27:58 homeassistant.core: Bus:Handling <Event call_service[L]: domain=persistent_notification, service_call_id=3051989136-1, service_data=title=Invalid config, message=The following components and platforms could not be set up:
* [notify](https://home-assistant.io/components/notify/)
Please check your config, notification_id=invalid_config, service=create>
17-01-24 02:27:58 homeassistant.core: Bus:Handling <Event state_changed[L]: new_state=<state persistent_notification.invalid_config=The following components and platforms could not be set up:
* [notify](https://home-assistant.io/components/notify/)
Please check your config; title=Invalid config @ 2017-01-24T02:27:58.879317+00:00>, entity_id=persistent_notification.invalid_config, old_state=None>

@fabaff @balloob

I think you should stop pinging people in every post. You have also posted the same problem at least three different places.

1 Like

Refer to the bug and fix I posted above, that is what would be causing your error “get_service() takes 2 positional arguments but 3 were given

Either update your facebook.py file or wait for the next release.

1 Like

I got error

2017-07-17 21:07:21 ERROR (Thread-5) [homeassistant.components.notify.facebook] Error 400 : Unsupported post request. Object with ID ‘me’ does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api (Code 100)

Please help!

Hi, sorry for waking up this old thread, but i did not get if you can just push information from HA to your phone, or can you actually “chat” with your HA? Give commands via messenger, like “heat-up home”?

1 Like

I would like to know too. I got it working and can receive notifications from HA to FB Messenger.

But I can’t understand how you made FB Messenger bot to send commands back without using MQTT component for example.That would require coding the bot to send messages to MQTT serve and have HA to subscribe to topics there.

The question is: Did you do it that way or you found a way to use FB component with built in features to do this somehow.

Did you solve this? I just started to get the same error for some reason. After I was logged out from facebook and had to re-login. I got a new page token… But the FB component that was working before, no longer works.