bookmark_borderUsing Microsoft Flow with Home Assistant

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. 🙂

Settings

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.

  1. Go to https://flow.microsoft.com and login.
  2. Make a new Flow from a blank template
  3. Search for button (you can use other triggers but this is an easy start)
  4. Add a new step of type action.
  5. Select HTTP
  6. Change Method to POST
  7. 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
  8. In headers add the following JSON blob.
    {
    “x-ha-access”: “YOURPASSWORD”,
    “Content-Type”: “application/json”
    }
  9. In Body put the JSON to update the sensor.
    {
    “state”: “25”,
    “attributes”: {
    “unit_of_measurement”: “°C”
    }
    }
  10. 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.

Sytone

I’m a principal engineer working at Microsoft. I have run and supported services for over twenty years and worked in multiple countries. I love working with passionate people and new technology.

bookmark_borderTwo-Factor Authentication and your Microsoft Account

I have just moved to Two-Factor authentication, there was a bit of work to get everything signed in again but the additional security is worth it. I use my Microsoft account as a central hub for everything, it is on all my PCs at home and work, I have a WP8 that I log into with it, I use it to log into Skype. Basically if someone takes it you have access to everything I have.

In addition I have lots of photos and file on SkyDrive now and do not feel like having to deal with the issues if that is compromised. The process is fairly easy and I have the simple steps below so if you have a Microsoft Account I would recommend enabling it.

  1. Install the Authenticator App on your Phone if it is a Windows Phone
    1. http://www.windowsphone.com/en-us/store/app/authenticator/e7994dbc-2336-4950-91ba-ca22d653759b
  2. Got to the account page for your account.
    1. https://account.live.com/proofs/Manage
  3. Click on the link to enable two factor authentication  (two-step)
  4. The page will give you a nice bar code that you can scan using the Authenticator application, this makes setup a breeze.
  5. Not this is done you will need to reset up your devices and accounts on your machines. If you have already trusted your accounts on your desktops you are good to go and only need to deal with things like SkyDrive by providing the Auth from your phone.
  6. Not everything likes the passcodes created so for other apps and devices such as Xbox 360, Windows Phone, or mail apps on your other devices you will need a App Password, you use this instead of your regular password to log into your account. More details can be found at the following link to setup different apps
    1. http://windows.microsoft.com/en-us/windows/app-passwords-two-step-verification

With that you are done, all your apps now have two factor auth, if you choose to trust an account or remember the code then you are back to single access if the device is stolen, if that happens head straight to your manage page and remove the app passwords and un-trust all your devices.

What was on the device my be compromised but any new information will be secured from that point on. Also you do have BitLocker enabled on your desktop hard drives, don’t you?

Sytone

I’m a principal engineer working at Microsoft. I have run and supported services for over twenty years and worked in multiple countries. I love working with passionate people and new technology.