Now that Microsoft Flow is out of Beta I thought I would play with it and integrate it with Home Assistant running my house. The Microsoft Flow is fairly flexible and has more flow options than IFTTT to make choices.
To use this with Home Assistant I am going to use the REST API to make and set a sensor value, you can then take this and make it as complicated as you want. 🙂
You need to ensure you have this information at hand.
* Home Assistant Endpoint – https://publicdomin:optionalPort/api
* Your password for the http component. If you public expose HA without a password, stop and fix it now!
* The name of the sensor you want to update. sensor.kitchen_temperature in this case.
- Go to https://flow.microsoft.com and login.
- Make a new Flow from a blank template
- Search for button (you can use other triggers but this is an easy start)
- Add a new step of type action.
- Select HTTP
- Change Method to POST
- In URI put the full URI of the sensor you want to change. Using the data above this is https://publicdomin:optionalPort/api/states/sensor.kitchen_temperature
- In headers add the following JSON blob.
- In Body put the JSON to update the sensor.
- Save the Flow!
Now open up Flow on your phone and log in with the same account, you will see a nice big button with manual -> HTTP on it. Click that button and look at the state of the sensor in Home Assistant. You will see it with the value you set in the body.
To trouble shoot, in the web UI click on the i with a circle around it. It will show a log of successes and failures. If you click on that you can drill into the details of the flow and the responses from Home Assistant.