Auto turn on amplifier, when using Sonos

I just bought a Sonos system. I ended up with one Play:1, and one Connect.

The Play:1 just turns on, when you start playing music, but my Connect relies on my Pioneer Amplifier, to turn on, and switch to the correct input and volume.

A small task for most, but since my amplifier is hidden away, and i normally control it using a app, then the smart thing with Sonos suddenly wasnt that smart anymore.

Openhab solved that for me ūüôā

First I had to install a couple of bindings :

After configuring both bindings (follow the links, for guide) I made sure that I could control the following on the Pioneer amplifier.

  • Power
  • Volume
  • Input Source

And the following on the Sonos Connect play (I had to select “Show More” in PaperUI to see all options)

  • State

After that i could create the following rule, that monitors the Connect for Playing state, and turns on the amplifier, and select the correct input and volume.

rule “Sonos Stue on”


        Item sonos_stue_state changed to PLAYING


sendCommand(stue_pioneer_zone1_power, ON)

Thread::sleep(5000) //Wait for amp to start

sendCommand(stue_pioneer_zone1_inputsource, 01)

sendCommand(stue_pioneer_zone1_volume, 75)


I have no turn off rule, since my amplifier auto turns off, after 15 minutes, when no input is being received.

Thanks for reading ūüôā

Posted in Teknik Tagged with: , , , ,

Openhab + Sonoff – A match made in heaven

If you followed this blog, or my twitter feed, you know that i love VMware Orchestrator and automation. Imagine finding af product, that does exactly that, just for your home. Openhab is just that. If you don’t know it already, then take a look.

There are tons of blogs out here, describing how to do, what i have done in details. So i will not go there. Instead i will try to describe my little project, for an inspiration in getting started with Openhab and Home automation.

First a problem. I bought a new house, that came with outdoor lamps, that’s hard to replace, and that i can’t du anything smart with.

Solution, Install a hacked Sonoff in each of them, and let Openhab Control them ūüôā

The reason for chosing Sonoff, is that is small, cheap and you can hack in.

Also it comes with everything, and all you have to do, is to connect your 220v wires in one end, and 220v wires in the other.

So let me show you what i did.

The lamp looks like this.


I opened up a Sonoff, and soldered a couple of pins on it (or my friend Henrik did).

And after uploading our custom code (more on that in a later post) i could mount it in the lamp.

And control it using Openhab (And Homekit).

Success ūüôā


Posted in Teknik Tagged with: , , ,

Upgrade homelab to vSphere 6.5

I upgraded my home ESXi to version 6.5 today, and wanted to share how easy it was.

  1. First SSH into the host (ssh needs to be enabled for this to work ūüôā ¬†)
  2. Open firewall by typing

    esxcli network firewall ruleset set -e true -r httpClient

  3. Run

    esxcli software profile update -p ESXi-6.5.0-4564106-standard -d -f –dry-run
    Note the “Dry-Run” part in the end, to test if eveything looks ok.

  4. If yes to nr 3. the run

    esxcli software profile update -p ESXi-6.5.0-4564106-standard -d -f
    I have a couple of things running, that conflicts with my install. That’s why i had to use the force (-f) to install it.

  5. Reboot host
  6. Login to the host client, to check if it’s now running version 6.5 ūüôā



Posted in Teknik Tagged with: , , ,

vSphere Virtual Volumes – First look

I have long been talking about vSphere Virtual Volumes (VVOL’s) in my daily job. But other than a Virtual setup, in VMware Hands on labs, i have not yet had anywhere to try it out – Until now ūüôā

In our demo enviroment, we have been lucky enough, to get a Nimble storage system wich supports VVOL

I thought i would give you a litte taste on how easy it is, to manage your VM’s storage requirements, once you have VVOL in place.

Note features etc, might be different, of other storage systems.

Lets try it out ūüôā¬†I assume you have connected the storage system, and set it up for VVOL.
For Nimble, this was quite easy. Connect to vCenter using the management interface, and select configure VVOL.
If you are in doubt, RTFM ūüôā

  1. Log into the vSphere Web client, and select Storage Policies.
    Select Create new storage policy
    Skærmbillede 2016-08-03 kl. 09.28.16
  2. Give it a name, and a description.
    As you can see in the description, we will create a policy, that snapshots every 5 minute, and keeps that snapshot for 60 minutes.
    Skærmbillede 2016-08-03 kl. 09.30.37
  3. Select next until you reach Rule-Set-1.
    Select Nimblestorage (or whatever your storage provider is called) from the drop down menu, and select Protection schedule (minutely) from the new drop down, that appears below.
    Skærmbillede 2016-08-03 kl. 09.34.45
  4. Change the following values :
    Start Time : 0:00
    End time : 23:00
    Snapshot frequency : Every 5 minute
    Snapshots to retain locally : 12
    This should create a snapshot every 5 minute, for the entire day, 7 days a week, and keep the last 12.
    Skærmbillede 2016-08-03 kl. 09.37.12
  5. Select Next, and see that the VVOL datastore, is compatible with your new storage profile.
    Skærmbillede 2016-08-03 kl. 09.39.03
  6. Select next and finish.
  7. To test it, i clone a VM, and give it the new storage profile.
    I’m guessing that you know how to clone a VM. So the only thing i will show you, is the page, where you select the storage profile.
    It should look something like this, with compatible storage, when you select the newly created storage profile.
    Skærmbillede 2016-08-03 kl. 09.41.28
  8. In the Nimble system, it now looks like this under Volumes.
    It creates a “Lun” for each file, the VM consists of. And each of these, can have a different storage profile.
    So you could easily have Snapshot protection for the Base OS, and another application specific for the VMDK files, that contain the application.
    Skærmbillede 2016-08-03 kl. 09.45.01
  9. If i select one of the files (after the first 5 minute) i can see, that a snapshot has already been taken.
    So this i an easy way, of making sure that the VM disks, get the right features.
    Skærmbillede 2016-08-03 kl. 09.49.52

I hope you found this useful.


Posted in Teknik Tagged with: , ,

Using VRA to deploy Active Directory as a Service

In our demo environment, i wanted to create Active Directory as a service.

A lot of customers i talk to, often talk about having to create isolated demo environments, where they can test stuff. In a lot of these demo environments, they need AD, DNS etc. So why not create an application blueprint, where you can install a fresh AD, with all the custom properties you would like.

Prereq : Full working VRA environment with application services configured and agent installed in templates.

Here is how i did it.

  1. Create a software component.
    Make sure Container is Machine.
    Screen Shot 2016-04-14 at 12.37.01
  2. Create all the properties needed.
    Screen Shot 2016-04-14 at 12.38.22
  3. Configure the install as CMD and edit the script.
    Screen Shot 2016-04-14 at 12.39.36
  4. The following script, creates a ad.txt file in the %tmp% directory.
    It then runs a dcpromo command, that point to the ad.txt file.Note that the script ends with a exit /b 0
    The reason for this, is that dcpromo ends with a error (See more here)
    The error is ok, and not important, but the VRA agent, thinks the job ends in error, if you do not set the last line.

    If you want to know more, about all the settings you can use in the Unattend file, look at this article.

    Below is the code to copy/paste.

    echo [DCINSTALL] > %tmp%\ad.txt
    echo InstallDNS=%InstallDNS% >> %tmp%\ad.txt
    echo NewDomain=%NewDomain% >> %tmp%\ad.txt
    echo NewDomainDNSName=%NewDomainDNSName% >> %tmp%\ad.txt
    echo DomainNetBiosName=%DomainNetBiosName% >> %tmp%\ad.txt
    echo SiteName=%SiteName% >> %tmp%\ad.txt
    echo ReplicaOrNewDomain=%ReplicaOrNewDomain% >> %tmp%\ad.txt
    echo ForestLevel=%ForestLevel% >> %tmp%\ad.txt
    echo DomainLevel=%DomainLevel% >> %tmp%\ad.txt
    echo DatabasePath=%DatabasePath% >> %tmp%\ad.txt
    echo LogPath=%LogPath% >> %tmp%\ad.txt
    echo RebootOnCompletion=%RebootOnCompletion% >> %tmp%\ad.txt
    echo SYSVOLPath=%SYSVOLPath% >> %tmp%\ad.txt
    echo SafeModeAdminPassword=%SafeModeAdminPassword% >> %tmp%\ad.txt
    dcpromo /unattend:%tmp%\ad.txt
    exit /b 0Screen Shot 2016-04-14 at 12.41.15

  5. After this, you are ready to publish the Software Component, and use it in your blueprints.If you want to expose the properties, in the blueprint request, it might be a good idea to update the descriptions, so the values make more sense.
    Screen Shot 2016-04-14 at 12.49.25

I hope you found this useful.


Posted in Teknik Tagged with: , , , ,

Goodbye Tacx – Hello Bkool

So the day finally came, where i replaced my Tacx Bushido, with a new Bkool hometrainer.

I have written earlier posts, about how much i hated Tacx way of treating their old customers, and after a new iPad app update, where it again failed to work, i was quick to order a Bkool.

First impressions :

It’s really quiet compared to the Tacx. I don’t have any data on the DB of the Bkool, but when my girlfriend rode the Tacx, i had to go into the other room in our apartment. Yesterday, when she tried it, i went back into the livingroom, because i thought she had stopped the ¬†ride. So there is a¬†difference in the volume of noise¬†it generates.

The software is a lot better, even thou there still seems to be big room for improvement. The first thing you notice, is that everything is online meaning it syncs with your online profile, and you can compete with other users (if you pay for it).

The best thing about it, is probably¬†that if you don’t like their software, you can just change it to something else, and it will work with the Bkool platform. That’s kinda cool. Wish that was possible on the Tacx ūüôĀ


My first ride on the Bkool

You can also have multiple users, on the same iPad app. This was not possible on the Tacx.
The software also works on Mac, Pc etc.


The last thing, is that i seems that it’s¬†possible to do climbs, of a higher grade, than it was on the Bushido. I don’t know why that is, but it seams more realistic. Again not a scientific test, just a feeling ūüôā

There is a ton of things, to tell about the Bkool, but a quick google, should direct you to better reviews. One i would recommend reading is

This was just my though’s on my new HomeTrainer.

If you are using Bkool, and want to join, the connect to me on

Posted in Træning Tagged with: , ,

When disaster strike – how to protect your mac

Last week i got a call, from one of my friends. His sister just spilled a glass of water, into her Macbook, and he was looking for help.

With no backup, and no insurance, this was an expensive lesson.

So i thought i would write a small post, about how i backup my Mac etc.


I use Google Photos for all my pictures. If you get past the fact, that it’s free, and you are¬†the product, then it’s a great product, that allows me to backup all my pictures, in an ok quality for free.

On top of that, they have really great apps for IOS etc. which allows me to have all my pictures with me all the time.

You can install a small agent on you Mac, that allows you to automatic upload all your photos, from you mac, to google Photos.

Documents etc.

I use Crash Plan for everything else.

I have Crash Plan installed on my Nas, which backups everything there to Crash Plan’s cloud service.

All my computers have also Crash Plan installed, but backups to the agent on my Nas.

It’s not a perfect solution,¬†but it works ok for me, knowing that i have to place my data on my NAS, to be sure that it’s backed up to the cloud.

If you think this is to complex, just buy the Crash Plan family plan. It allows you to backup 10 computers to Crash Plans cloud. It’s just an install and forget.

There are lots of other solutions out there. This is what works for me. The point of this blog, is that it’s not hard to setup, so there is really no excuse on why you should lose data, if you lose your computer.

Photo Credit :


Posted in Teknik Tagged with: , , ,

Monitor VRA Appliance using VROPS EP OPS Agent

I thought i would share a little fun thing, that we did in our demo environment yesterday.

We wanted to monitor the VRA appliance, and what is better that using VROPS and the EP OPS agent for the job.

Note that this is probably not supported, so use this at your own risk.

What i did.

  1. Download the EP Ops agent from VMware’s website.
    Skærmbillede 2016-02-09 kl. 13.07.51.png
  2. Transfer the file vRealize-Endpoint-Operations-Management-Agent-x86-64-linux-6.2.0-3404388.rpm to /tmp
    I used WinSCP for the job.
  3. Make the file executable by typing
    chmod +x vRealize-Endpoint-Operations-Management-Agent-x86-64-linux-6.2.0-3404388.rpm
    Skærmbillede 2016-02-09 kl. 13.17.26.png
  4. Install the Agent by typing
    rpm -i chmod +x vRealize-Endpoint-Operations-Management-Agent-x86-64-linux-6.2.0-3404388.rpmSkærmbillede 2016-02-09 kl. 12.52.30.png
  5. When done, you should see the following text.
    Skærmbillede 2016-02-09 kl. 12.52.58.png
  6. To configure the agent, type the following
    Service epops-agent start
    Skærmbillede 2016-02-09 kl. 12.53.59.png
  7. Enter the FQDN of the VROPS server
    Select port
    And accept certificate
    Skærmbillede 2016-02-09 kl. 12.54.38.png
  8. Type username
    And password
    Skærmbillede 2016-02-09 kl. 12.54.56.png
  9. And then you should be done.
    Skærmbillede 2016-02-09 kl. 12.55.11.png
  10. In your VROPS inventory, you should now be able to see the VRA appliance, and the services running.
    Skærmbillede 2016-02-09 kl. 12.59.44.png
Posted in Teknik Tagged with: , ,

Danish vExperts 2016

After being away, for the last couple of years, i was yesterday honored, by again being awarded the vExpert title for 2016.

A big congratulation to everyone who got awarded as well.

I thought i would try to list all the Danish vExperts, for 2016.

Since it’s not listed by country, i might miss someone. So please let me know, if you think somebody needs to be on the following list.

You can see all the vExperts here :

Brian KnutssonAteaBrianKnutsson
Frank BrixPernix
Jonas Groth JakobsenAalborg
Kenneth G√ľntherNovozymes
Kenneth HansenIT ForumVirtualizeDK
Liselotte FoverskovArrow ECSLFoverskov
Mads Fog
Mikael KorsgaardHerning Kommunejekomi
Nicolai SandagerProactNSA42
S√łren ReinertsenSiemens Wind Power
Terkel Olsen
Theis SamsigComit A/Ssamsig_dk
Posted in Teknik Tagged with: , ,

Automation with vRO and vCenter – Getting started guide

When i talk to people about automation, most¬†think it’s a good idea, but have a hard time getting started.

So this post, is all about getting started with vRO and vCenter, so you can begin to use all the build in workflows, and maybe start creating your own.

Prerequisite : a vCenter and a newly installed vRO appliance,
DNS, time etc. already setup.
Working Active directory authentication setup, for vCenter.

The vRO version i’m using, is the following.Sk√¶rmbillede 2016-02-05 kl. 10.35.23.png

  1. After deployment, connect to the vRO appliance on : http://fqdn
    and accept the self signed certificate warning.Skærmbillede 2016-02-05 kl. 12.28.56.png
  2. Click on Orchestrator Control Center and accept the self signet certificate warning again.
    Login with root and the password you set, when you deployed the appliance.Skærmbillede 2016-02-05 kl. 12.31.36.png
  3. Select Certificates
    Skærmbillede 2016-02-05 kl. 12.56.30.png
  4. Select Import
    Skærmbillede 2016-02-05 kl. 13.06.39.png
  5. Type the URL of your vCenter and select import again.
    Skærmbillede 2016-02-05 kl. 13.08.34.png
  6. Select Import again, to accept the certificate.
    Skærmbillede 2016-02-05 kl. 13.08.48.png
  7. Click Home and Select Configure Autentifikation provider.
    Select vSphere and type the FQDN of your vCenter server, and click Connect.
    Skærmbillede 2016-02-05 kl. 13.10.58.png
  8. Fill out the Identity service questions :
    User name : AD administrator account on VC
    Password : the users password
    Configure License : check, to adopt the vCenter license.
    Default tenant : The SSO tenant you want to be use.
    Click register
    Skærmbillede 2016-02-05 kl. 13.13.19.png
  9. Type the administrator group, you want to be using, and click search to find it.
    Click save changes when done.
    Skærmbillede 2016-02-05 kl. 13.28.27.png
  10. You must restart the vRO server, to use the changes.
    Click the Startup options link.
    Skærmbillede 2016-02-05 kl. 13.26.20.png
  11. Click restart.
    Skærmbillede 2016-02-05 kl. 13.20.58.png
  12. Go back to the management website, from step 1, and select start Orchestrator client
    Skærmbillede 2016-02-05 kl. 13.29.15.png
  13. Run the Java program, and accept all the certificate warnings.
    Login using a username / password, that exist in the group, you selected in step 9.Skærmbillede 2016-02-05 kl. 13.32.10.png
  14. Select Design from the top drop down menu, and go to
    Library -> vCenter -> Configuration
    and select and run Add a vCenter instance
    Skærmbillede 2016-02-05 kl. 13.33.56.png
  15. Type the FQDN of the vCenter server and select yes to ignore all certificate warnings.Skærmbillede 2016-02-05 kl. 13.35.58.png
  16. I chose to run all tasks as one user. If you want the same, select no, and type a user with administrator access to vCenterSkærmbillede 2016-02-05 kl. 13.37.29.png
  17. If you did everything correct, you get a little green check mark, next to the workflow you just ran.
    Skærmbillede 2016-02-05 kl. 13.39.46.png
  18. Select and run Register vCenter Orchestrator as a vCenter server extension.Skærmbillede 2016-02-05 kl. 13.41.07.png
  19. Select the vCenter server you just registered.Skærmbillede 2016-02-05 kl. 13.42.19.png
  20. Again if everything went well, you should see a green check mark next to your workflow.Skærmbillede 2016-02-05 kl. 13.43.23.png
  21. Login to vCenter with a user, that belongs to the user group from step 9, and select the vRealize Orchestrator icon.Skærmbillede 2016-02-05 kl. 13.45.36.png
  22. If you select vRO home, and click the summary tab, you should see the vRO server, you just connected.Skærmbillede 2016-02-05 kl. 13.47.38.png
  23. Select vRO home -> Manage -> Context Action to see all the workflows currently enabled.
    You can see under Associated types, witch object, the workflow are enabled on.
    For example Rescan Datacenter HBAs, is enabled on the Datacenter object, as a right-click action.Skærmbillede 2016-02-05 kl. 13.50.33.png
  24. To enable you own, simply click the + button, and select the workflow, and which object, you want it to be enabled on.
    A good place to start, is under Library -> vCenter.
    Here you can find a lot of workflows, that work with vCenter.
    Skærmbillede 2016-02-05 kl. 13.55.26.png

I will write another post, on how to build you own workflow, and enable it in vCenter. But for now, you can use all the build in workflows, and start automating you vCenter tasks.

I hope this was useful. Drop me comment, if you have questions etc.

Posted in Teknik Tagged with: , ,