Uncategorized

Why do I only see OneNote and Skype when setting up assigned access in Windows 10?

edit; this now just works for any application in the latest version of Windows 10. So the manifest is not needed anymore.

If you are trying to setup assigned access in Windows 10, you go to settings, accounts, Other Users and there is a link to ‘set up assigned access’. First you need to create a local account you can use for assigned access. You can do that at this ‘Other users’ dialog as well.

On the Assigned access page you can choose an account and the app you want to run in ‘Kiosk’ mode.

image

The thing is, it only shows 2 apps in my list, OneNote and Skype Video, where are the rest of my apps?

image

We changed this behavior in Windows 10, once I figured that out it’s easy to spot in the documentation as well. You can find the documentation how to build an app which works in assigned access mode here: https://msdn.microsoft.com/en-us/library/mt633799(v=vs.85).aspx

So what’s different in Windows 10 is, once you login with the assigned access account. It starts the app, locks the device and runs the app above lock.  The reason you only will see OneNote and Skype video is because the apps have the ‘abovelock’ extension defined. It’s mentioned in the Appendix

The following is a sample application manifest, you can see the windows.aboveLockScreen uap extension. You must use this extension in your Windows 10 Universal Windows Platform (UWP) app in order for it to display in the Assigned Access app list in Settings.

So once you add this to your app manifest:

It will show up in the list as well.

Screensaver for my app

One of the things my Home Automation app needs to do is run forever. But I don’t want the screen to burn in either. I can allow the phone to lock the screen but at that time my app isn’t running. I could run some background tasks but there is no way to wake up the app and dismiss the lock screen automatically. Therefore I want an app which runs all the time but has some kind of build in screensaver.

First of all I need the app to prevent the lockscreen appearing. I can of course also configure the phone never to show the lockscreen, but I can also solve this in code. It took me some searching and help at twitter (thanks Neil) to figure this out. The useridlemode from Windows Phone isn’t there anymore. You now need to use Windows.System.Display.DisplayRequest().

So when trying to figure out how to determine how long a user is inactive I could only found some win32 API’s. Unfortunately these don’t work on Windows 10 Mobile (the ones I need that is). So I decided I needed to add a timer on every page. Whenever a user does something on the screen I reset the timer. If the timer fires I navigate to the screensaver.xaml page (and do the screensaver magic) and when the users hits the screen the app will return back to the MainPage.xaml.

Since this needs to be done from every page I created a new baseclass every page (except the screensaver page) is going to inherit from. I created a class called DashboardPage.cs

The constructor creates a timer (in this sample set to 5 seconds). Whenever the timer fires I redirect to the Screensaver page. Whenever PointerMoved event is fired the timer is reset. I found out that with the PointerMoved it works on desktop and mobile. You might need to add more events to make it foolproof, but for my scenario on the phone it works.

The only thing you need to change is in your XAML and the code behind. Your page needs to inherit from DashboardPage instead of page like this:

And you need to modify your XAML a bit as well. It needs to look like this:

You can find the complete solution over here.

Of course after I build this Morten Nielsen posted on Twitter he already build a solution. I think his solution is much easier to use.

Create a new project and add a new usercontrol to your project called Screensaver.xaml

The codebehind looks like this:

To get this working you need to add a single line to App.xaml.cs. Add the line after the Windo.Current.Activate()

What happens in the Screensaver code behind is a timer is started. Whenever the timer ‘ticks’ the popup with the screensaver is shown. A tap on the screen removes it again. Every time something happens on the screen the timer is reset. This works really well and you don’t need to modify every single page. So I think I will end up using this solution instead.

You can find a complete working sample here.

List of tasks I need to figure out for my home automation project

As I described before I am working on a little project to use some Lumia 640s in the house to control the home automation. Besides figuring out how to configure and roll out the devices, and figuring out how exactly I am going to put them in the walls, I also have a laundry list of items I need to figure out for the app on the device. Instead of waiting before everything is done I thought it might be useful to take you along the ride. It might even result in some people mentioning to me some of the things I need to figure out are already out there.

So this is the current list of ‘issues’ or tasks I want to figure out before bringing everything together in an app.

  1. App needs to Run forever (embedded mode in mobile like on RPI2)
  2. Dim screen when not used for x minutes (Windows.System.Display.DisplayRequest() helps preventing the lock, need a screensaver to prevent burn in)
  3. Resume app or display screen when movement is detected by using the camera as sensor
  4. Hey Cortana/speech integration in app (dim the lights, goodnight, increase temperature etc)
  5. Walkyie-Talkie or intercom functionality between rooms and broadcast (alljoyn?)
  6. Other device discovery to connect to for the walkie-talkie functionality etc.
  7. App is a Bluetooth beacon in every room (http://www.shenchauhan.com/blog/2015/10/28/bluetooth-le-beacons-in-a-uwp)
  8. Self-updating via update app
  9. IP Camera integration so I can watch the cameras from every room
  10. Alljoyn temp control for my Nest and perhaps per room when I add that future system as well
  11. Goodnight command to smartthings so i can turn off all lights in the entire house
  12. Alljoyn light control
  13. Motion sensor in garage and at frontdoor switches on security view on phone
  14. Wakeup time
  15. Radio/music/speaker in room control

Fixed my Bryant two stage furnace with my NEST

When we bought the house we learned it had a fairly new Bryant furnace installed. The previous owner upgraded from an electric furnace a few years ago. When we had an HVAC guy over for an AC quote he mentioned it was a good two stage furnace, better than the one we had in Bothell. Ok, I didn’ really think about until a recent discussion with some colleagues at Microsoft.

When inspecting my connections of my NEST, I assumed the R, G, C and W1 wires needed to be connected. C is for power, the other ones for the fan and heater. In my previous home the Y was used for the airconditioning. I don’t have one in this house yet. Although if you connect the wire to the Y on the backplate of the NEST, the nest assumes you have a AC connected.

Since you need to hook up the W2 on your thermostat to work with a two stage furnace to make it work. I connected the spare wire to the W2 on the backplate. The NEST gives you a message the wiring is changed and now a two stage heating system is connected. That looked promising. One of my colleagues mentioned it might not be smart to just randomly connect wires and he was correct of course. So disconnected the W2 wire from the NEST and took a better look at my furnace. (In the picture below the W2 connector is lefr from the blue wire)

WP_20160129_18_24_25_Rich

Great thing about internet is you can find all kinds of information. I happen to have a Bryant 355MAV042080F model. Some googling on Bing pointed me to the user manual and the installation instructions. Cool.

Also on the inside there are some schematics of the furnace.

WP_20160128_19_56_35_Rich

After some reading and inspecting the furnace after opening it up I saw the yellow wire wasn’t connected at all. So i hooked it up to the W2 connector, checked if the SW2 switch was on (which was). Hooked the wire up on my NEST and voila, two stage furnace worked. Yellow light came on when HIGH HEAT was switched on (just cranked the NEST up to 90) and the green light came on when in LOW HEAT mode (when I switched the NEST to 1 degree more than the current temperature).

WP_20160130_14_23_01_RichWP_20160130_14_29_34_Rich

No idea why the W2 wire wasn’t hooked up. The original Honeywell thermostat supports this system as well. I took some pictures before I installed the NEST and it wasn’t connected when I removed the old thermostat.

So I am kinda proud of myself I increased the efficiency of our thermostat.

How to disable the SIM error message on your Windows Mobile device

wp_ss_20160124_0001Some people use Windows Mobile devices without a SIM. I use it to test different things during my job and also on my developer devices at home. I just started a little project where I want to use the Lumia 640 as a control device and these devices will never get a SIM. So this pesky little warning prevents the device from automatically starting up and run my control software.

Fortunately this is easy to fix. If you install the Imaging and Configuration Designer (ICD) you can set a configuration setting and provision your devices to this setting. Installing the ICD is easy. Instructions can be found here. The cool thing about provisioning package is you can mimic a lot of the more fancy Mobile Device Management features. So if you need to test deployment, settings like WiFi and email you can do that without any MDM server and just use provisioning packages. These packages are just a bunch of zipped up XML like any MDM syncml is as well. So easy to test your things without needing to go to the IT guy and ask him to setup some policies and you enrolling the devices in a work account.

The setting you are looking for is called AllowSIMErrorDialogPromptWhenNoSim under the experience group.

Since this is the first time I will show a step by step guide. Future posts will just mention the settings involved.

First you create a new project (File New Project). Enter the name RemoveSIMErrorDialogPromptWhenNoSim
image

Hit next and choose Provisioning package and hit next again
image

On the next screen choose ‘Common to all Windows mobile editions’ this will give us all the options available for mobile and not just a subset.
image

You can skip the page to import a provisioning package (or import my package linked to this blogpost to see what I did) and click Finish

In the search box type SIMerror and click on the AllowSIMErrorDIalogPromptWhenNoSIM and configure it to No.
image

Save your project and choose Export – Provisioning package. Leave the defaults and click Next (if you want to change your package the next time make sure you increment the version, otherwise your device won’t take the changes.
image

I leave the encrypt package and sign package checkboxes unchecked and click next.
image

Select the location where you want to store the provisioning package and click next.
image

On the final ‘build the provisioning package’ you click the build button.
image

And you are done. If you navigate to the directory you will find the RemoveSIMErrorDialogPromptWhenNoSim.ppkg file.

You can drag and drop the file to your connected phone in file explorer.
image

On your device you will see a message popup asking you if you trust the package which is trying to be installed.
wp_ss_20160124_0002

If you click Yes, add it your device will be provisioned. If you reboot your device now you will not see the annoying screen anymore. Mission accomplished.

If you decide you want to remove the setting you can do that by going to the settings screen. Accounts, provisioning.
wp_ss_20160124_0003

You can find this provisioingpackage over here. Make sure you check it before you install it since these packages are really powerful and can totally mess up your device settings.

New project: Lumia 640 as touch control device for my home automation

The other day I was chatting with Morten Nielsen on twitter about some ideas for home automation. I want to be able to control lights, temperature etc in some rooms in my home. Ideally that would be done with some kind of easy to use touch screen device. The Raspberry Pi came to mind. There are some screens you can attach to it. It’s low power and pretty easy to put inside the drywall and make the screen look nice on top of that.

14528240889_5d4fde6341_k-728x420Morten mentioned he used a Dell Venue Pro 8 is also a nice and affordable device. But when I found out you can switch your Windows 10 Mobile device to embedded mode it sounded that a really affordable Lumia 640 (last one I bought was just $60 on AT&T and I got a free unlock code as well) would be a perfect fit too. It has al kind of sensors, so you can undim the screen when somebody is in front of it. Cortana should work for voicecommands. It runs any Windows 10 Universal App (Morten is working on an AllJoyn solution).

We have provisioning tools to configure the devices, heck, i could use my intune test account to maintain the devices as well.

Plenty of ideas to look into and so I will try to post some of my findings during the way about what I want to do and what the results of these investigations are. Some of the things which needs to be solved are:

  • I need an app which is a dashboard which can control my z-wave lights, temperature, perhaps music and intergrate with security cameras
  • It need to be easy to configure the devices in every room and easy to update the software as well. So i am looking into writing my own updater app (packagemanager) and provisioning of the devices by using our provisioning tools
  • Cortana integration would be cool
  • Device could be a bluetooth token which opens some possibilities
  • Device could be a IP camera for security purposes
  • AllPlay music services, control music playing in the entire home, although i need to hook up some good speakers instead of just the device

Plenty of stuff to figure out and probably never a project which will be completely done.

Posting blog posts through OneNote

Microsoft introduced a new plugin for WordPress. This plugin lets you use OneNote pages as input for your posts. That’s pretty convenient. You can write and scribble in OneNote every time you want and once you’re finished you can just move that page over to WordPress with a single click.

To make this work you need to install the OneNote published plugin in your WordPress blog. After you have installed it you need to configure the plugin according the instructions (you need to create an application so WordPress can access your OneNote files which are stored in your OneDrive)

After this you can add a post in WordPress and select one of the pages from OneNote. Pretty cool. This pages was written in OneNote as an example.


And of course a screen clip can be inserted in OneNote as well 🙂

SmartThings, how to handle guests and nanny’s in your house

Using SmartThings lets you automate most of the stuff in your house. Leaving the house automatically turns of all the lights and heating, but only when all of us leave the house. When one of us returns in the house, the lights go back on and the heating is on as well.
The last few weeks my mom was visiting and when both me and my wife left the house she got stuck in the dark because both presence sensors connected to our keys were gone and the rule in SmartThings is when everybody leaves the house switch everything off. Not a huge problem to switch back on the lights and heating but not something you would expect from your home automation system.
There are several ways to solve this. I could buy another presence sensor and give that to our guests. Only when the guests leave you have to switch it off. This might work for a nanny who gets out the house with the kids for example. The one thing which is missing in SmartThings is the ability to easily switch off the presence sensor. You either remove it from the system or remove the batteries when not used. I saw a suggestion creating a new device type with a enable/disable capability so you can switch off the presence sensor when it’s not used.
The other way is to create new ‘modes’ for your home and switch to these when you have a babysitter staying for example.
The 3rd one is what i used now. You can create a new device type which is called Virtual Presence Sensor. That’s a presence sensor you can create to develop your apps and test somebody leaving your house for example, but in my case it would work as well. Whenever my mom or the nanny stays home, I just enable the presence sensor and everything keeps working how it’s suppose to work. Lights will automatically switch on around sunset, or off around sunrise etc.
So how do you create one? Go to the web IDE login and go the My Devices at https://graph.api.smartthings.com/device/list and click on +New Device
Capture1

Select as Type the Simulated Presence Sensor
Capture2
Give it a name (in my case Presence Sensor Guest). The Network Device Id can be anything. Select a location or your hub and finally click create.

Now you only have to change your different modes. For example the ‘I’m back’ responds to anybody arriving and you have to add this virtual presence sensor to the list of sensors you want to use (already mine and my wife’s sensor are in that list). Also ‘Goodbye’ needs changing when you want to lights to switch off when everybody is gone.

I thought this was a simple but neat trick.

My new Intel NUC desktop computer

A while ago my desktop at home started to acting up. So I decided I wanted it to replace it with something new. I was looking for something small yet powerful and it needs to be silent!. My colleague Galileo recommended the Intel NUC.
So after some searching and reading reviews I decided it looked good and would fulfill my requirements. It needs to be silent, powerful enough to use Visual Studio, enough memory, enough disk space. And it needs to be able to hook up different screens. (At least 3).

So i ordered the following parts at Amazon:

Enough memory, 512GB disk, a USB to VGA cable to hook up a 3rd screen. 2 short cables to hook up the mini display and mini HDMI connectors at the back to 2 other DVI screens I have.

So far I really like the device. It’s fast, quiet (you can hear it, and when the blower starts you can hear that too, but it’s not annoying, it’s a soft sound). I use a BT keyboard and Mouse. It’s fast enough to use Visual Studio. I can even build my own Windows enlistment which is a pretty heavy task. Happily running Windows 10 at the moment.
The NUC has a I5 processor. The case can hold a small notebook SSD drive (there is also an option to use M2 storage for future expansion).
Here are some pictures of the device. It is really small:WP_20150302_004

The package also contains a little Vesa mount so you can screw the device to the back of your monitorWP_20150302_005 WP_20150302_006 Enough USB3 connectors on the back and the fronts, 1 USB connector at the front you can use for charging (will have power when the device is shut down)WP_20150302_007

2 memory modules for 16GB total memory. Works great for running multiple emulators and hyper-v images.WP_20150302_008  WP_20150302_010 WP_20150302_011

The hard drive fits in neatly too (512GB SSD)

WP_20150302_009 WP_20150302_012

USB to VGA dongle for my 3rd screen. After installing the display adapter drivers it works great.WP_20150303_006

So all in all I am happy with the device. 1 wish would have been a TPM chip. That would made it easier for me to authenticate for work stuff with a virtual smartcard instead of my real smart card (and perhaps forget it to bring to the office because it’s still in my smartcard reader at the home office)

How to use a video as your account picture in Windows

I just found out you can use a video instead of an image as your account picture in Windows (works with Windows 8.1 and up). Pretty neat effect.

 

So this is how you set it up. Go to your start screen, click on your name, choose ‘change account picture’

Capture1

Instead of browsing for a picture you click on camera. In the camera screen make sure you switch to vide mode.

Capture2

That’s it. Pretty cool he?

Oh if you want to build your own app to do this, there is an API for that too: https://code.msdn.microsoft.com/windowsapps/Account-picture-name-sample-912baff1