At work we use Microsoft Teams for calls, chat etc and I wanted a way to get alerts in a system I use regularly. Mobile is great, but some alerts could be urgent, or some could be just informational I don’t need to alert my phone.
It was surprisingly easy to configure (2 steps)
Inside of teams set up a connector either within the specific team, or search for the app (and then add it to a team) - i’d recommend creating a private team that isnt searchable for this The connector/App is called ‘Incoming Webhook’…
Complete the name of the webhook (HomeAssistant in my case), and upload an image of the HomeAssistant Logo. Copy the Webhook URL, and store it somewhere as you’ll need it later.
DONE - I know, crazy right?!
However now we have to send content to the webhook URL, and actually this is really easy too.
In Node-Red create an inject node -> template node -> http request node
{
"@context": "https://schema.org/extensions",
"@type": "MessageCard",
"themeColor": "0072C6",
"title": "HomeAssistant is now connected to Teams",
"text": "Actionable Messages possible as well"
}
In the http request node configure:
Method: POST
URL: <Webhook_URL_from_Teams>
Deploy, and inject. you should see this in your Teams Channel now:
I’m not really using this with HA, but I am using the node-red to teams webhook connector.
Here are some observations:
it’s effective and does what you’d expect.
You create a template, shove it through the webhook URL as a POST (leave the rest of the node boxes unchecked) and voila, Teams will spit out your card.
It’s limited to Legacy Cards formatting.
See Office 365 connector card for details. You don’t get to do much with them. In fact the original link to the message card playground is really the best place to fiddle. If you use the adaptive card playground, you’ll end up with a card that doesn’t work.
I want more.
I use this feature to send out coffee maker notifications. They are pretty simple. They use the node-red simpletime node to pass the time the coffee is ready to the card, but they don’t do much else. I’d like some more flexibility.
I have since expanded the system to detect the size of pot made (cup, half pot, full pot) but they’ll just have to be 3 different templates rather than something smarter.
this is great, can you suggest or supply the export of the flow. I am keen to explore the teams connector but unsure what node red package you are using.