Anwendungsvirtualisierung, Internet der Dinge und Cloud Computing, Blog von Sacha Thomet

Monats-Archive: Dezember 2015

Happy New Script – PVS 7.7 HealthCheck

Bald ist Neujahr und ich möchte euch fürs 2016 nur das Beste wünschen! Etwas ganz gutes habe ich euch schon vor dem neuen Jahr, nur einige Stunden nach dem Release vom Citrix Provisioning Server 7.7 kann ich euch auch das neue Health Check Script dazu übergeben. 

Heute hat Citrix die Produkte XenApp/XenDesktop 7.7 und Citrix Provisioning Services 7.7 herausgegeben, mit dabei sind eine Menge von neuen Features aber das wichtigste dabei neben dem Support für Windows 10 ist … Trommelwirbel …. die neue Power Shell APO für Citrix Provisioning Services. PVS mit PoSh bei 7.6 und früher war ein Sch….
Was sonst noch neu ist im PVS 7.7 hier: PVS 7.7 New in this release

Jetzt kommt PVS endlich mit einer echte PoSh API welche mehr zurück gibt als nur einen Haufen Strings. Ich konnte mit dem PVS 7.7 Tech Preview rumspielen und bin desshalb auch bereits ready mit dem komplett neuen Script. Achtung, für Versionen 7.6 und tiefer muss immer noch das alter Script verwendet werden. Diese Neue Version ist gültig ab 7.7 und wir dann für die Nachfolgenden Versionen gepflegt.

pvs77

Wenn ihr neue Funktionen möchtet oder einen Fehler melden wollt, so tut dies bitte direkt auf GitHub.

Wie bereits geschrieben, diese Version geht nicht mit 7.6 und früheren Versionen, wenn ihr dazu ein HealthCheck braucht, gibt es hier das alte Script:  Citrix PVS HealthCheck 

Das Script findet ihr hier auf GitHub:

https://github.com/sacha81/citrix-pvs-healthcheck

Steure ein MyStrom Wifi Switch mit einem Schalter (und ifttt oder octoblu)

mystromSome weeks ago I bought my first smart plug from MyStrom. If you are living  in Switzerland you have only a limited choice of smart plugs because of the non EU standard plug (T13).

MyStrom is pretty cool because it mets almost all my requirement, there is a possibility to measure to power consumption within two rates (day and night), it’s controllable with the mobile phone app and there is a nice web interface.

But one thing I miss, I cannot react to triggers and power of the smart plug on a defined event. Like already in an earlier post mentioned there is a REST API which allows to control the plug from the internal network. (See Another LaMetric IoT script – power control)

Last day’s I just found the API documentation which allows to control the MyStrom out of the cloud:
https://mystrom.ch/mobile/ 

So I have now all to connect this Thing to the Internet and react on a trigger.

Possibility 1: The everything imaginable way,
MyStrom and Octoblu

mystromlogo      +      ocoblu

If you are using Octoblu beta, which is currently available for everyone for free you can create very intelligent workflows to control your smart plug. You can react to twitter and power of or on depending what is twittered, you can power off your heater as soon a temperature is reached, you can stop charge as soon your device have a defined state of charge.

The Things you connect use with Octoblu are nearly infinite.

mystrom-octoblu

Octoblu is for advanced use, and to be honest I’m also on the learning phase! I do not describe here more details for this case. There are a lot of sample blueprints on https://www.octoblu.com .  Octoblu was acquired by Citrix in 2015.

Possibility 2: The easy way,
MyStrom and IFTTT

 mystromlogo      +      iftttlogo

This way is suitable for „Home use“ and for people who only want to create a simple workflow where a trigger initiate for example a Power On or Power Of of the smart plug.

All what you need is a Control-Script on a Webserver with PHP on the Internet, and a IFTTT account.

How it works: The script is very simple, it just handle the  authentication process on the API, read the AuthToken out of the JSON answer and Push out the payload with the AuthToken. IFTTT just take the trigger and call the script with the username, passwort and the payload which you can build from the API

Example: I want to control my smart plug by twitter, if I twitter #lightsoff

Step 1:

Take this script and put it on your webserver:


Step 2:

Create a recipe on IFTTT, use Twitter as Trigger and Maker as Action. In maker you create your request:

[yourwebserver]myStromAuthenticator.php?email=[youraccountemail]&password[yourpassword]&payload=[yourpayload]

e.g. the payload to turn of the device with Mac 64002D012325 is: https://mystrom.ch/mobile/device/switch?on=false%id=64002D012325

The result should be that:

mystrom-ifttt-572x1024

You create 2 of those recipies, one to Power On and one to Power Off

Now you can twitter you defined hashtags to control your smart plug.