My Profile Photo

Bencey's Blog


Informing the world about the application of Technology.
If you are looking for Tier III Technologies click the button below


Home assistant and Discord

Home assistant -> Discord

Welcome to another post. In this post I will be showing you how to create an integration between home assistant and discord so homeassistant can post in your discord channel

The first thing you will need to do is create a bot, if you are unsure on how to do this you can read one of my previous posts Here. Then take note on the bot token as you will need this later.

You will now need to add this to your configuration.yaml file

notify:
- platform: discord
  name: Discord
  token: YOUR_DISCORD_BOT_TOKEN

Once you have added this save the file and restart home assistant, while you are waiting for home assistant to restart you will need to open up discord and obtain the channel ID for the channel you want home assistant to send a message to.

Once home assistant has booted back up you will need to click on the remote icon under developer tools (Should be the first one). The service should be called notify.Discord so select that one and the service data will be the following

{
  "message": "A message from Home Assistant",
  "target": [
    "channelID"
  ],
  "data": {
    "images": [ 
      "/tmp/garage_cam.jpg"
    ]
  }
}

Once you have pasted this click “Call Service” and after a few moments, you should receive a message in your discord channel. So Voila it is now working, if you have any issues with this guide please contact me so I can look into it

So now you will need to set up an automation system which sends out a notify message which I have not done yet so I am unable to make a guide on it at this stage

Thanks for reading

-Bencey