Skip to content
adatum
  • Home
  •  About adatum
  •  Learn Azure Bicep
  •  SCOM Web API
Automation

Activate Webasto diesel heater using OMS and Azure functions

  • 03/10/2017
  • by Martin Ehrnst

Looking at the above picture snow and winter is pretty awesome, but when you have to fire up your car outside your cabin in -15c (5f) you wish for summer. Not only is it extremely hard for your engine, but it’s also ridiculously cold to get inside the car! That’s why many cars in Norway are equipped with preheaters. A unit you can activate before starting or entering the car, heating up the engine (and in many cases the interior as well).
Just to put some numbers down, average temperature in Oslo January 2017 was -4.3, and coldest -12.6.

My child carrier, a Range Rover Sport, (one of Britains fines engineering that never fails) is equipped with a Webasto pre heater and controlled remotely by SMS command or an app. Communication is using WBUS, Webasto’s own language.

My goal in this post is to use data from the OMS Weather Data solution and Azure functions to automatically start my Webasto heater based on the observed temperature. I have to say, using the app directly way easier, but this is a very good opportunity to explore and play with cars, azure and automation.

 

Starting the heater

Many of these heaters and apps only communicate using SMS commands, but my heater controller can use internet connection as well, meaning there is an API of some sort it’s communicating with.

Using fiddler I found out how the app was communicating, replicating it using Powershell I ended up with this as a simple function to send commands to my heater. Typical commands are “cmd_heater_status” which asks for current status, and “cmd_time1:30,start” that starts the heater for 30 minutes.


To be honest, I wasn’t very pleased with the security here, but that’s something I will notify the company who make these controllers about.

Below is a typical output after requesting heater status.

heater : 1
gsm : 7
voltage : 12.0
h_temp : 25
flame : 0
date : 2017-10-1 19:13:9
valid : 1
status_date : 01/10
status_fdate : 01.10.2017
status_time : 21:13:09

Creating the Azure Function

After we have the basic functionality in place, we can add some logic to our script and create an Azure Function out of it. I have created a basic Powershell function below that accepts two input parameters. TempLow the temperature you have to be below to fire the heater, and heatingMinutes which is the number of minutes the heater will run.

The rest of the script is using our function above to request statuses and act upon our input and the heater response. I had to add sleep time within the script so that the Webasto controller had time process my commands.
Parameters like email-address and heaterId are defined as function environment variables

 

OMS / Log Analytics setup – query and alert.

Using data from the weather solution I created together with Cameron Fuller i created the following query to alert when observed temperature in Oslo is below a certain degree. This search is based on the new query language, Kusto. I reccommend everyone (including my self) to take a look at this Kusto cheet sheet.

YRno_CL | where LocationName_s == "Oslo" and TimeGenerated > ago(2h) | summarize AggregatedValue = avg(ObservedTemp_d) by bin(TimeGenerated, 15m), LocationName_s

Create an metric based alert based on the above query.

To kick off our Azure Function we set the alert to send a webhook with a custom json payload looking like this: (yes testing values)

{
"tempLow": "59",
"heatingMinutes": "40"
}

The test says webhook is sent successfully, and our function log confirms 🙂

 

Calm down John Snow, let winter come.

 

Share this:

  • LinkedIn
  • Twitter
  • Reddit
Azure

OMS and SCOM announcements from Ignite 2017

  • 26/09/201729/09/2017
  • by Martin Ehrnst

Microsoft Ignite in Orlando has started, already on day one we got a lot of announcements and new features. In this post I will try to keep track of the updates on regarding monitoring and management. SCOM, OMS, Azure monitor etc.

Microsoft Operations Management Suite, Log Analytics, Azure Monitor

  • Azure Security Center for hybrid cloud.
  • Azure Monitor, near real-time alerts
  • New container monitoring solution
  • Using Log Analytics query across multiple workspaces
  • The OMS portal as we know it will be deprecated and everything integrated in to the Azure portal.

System Center Operations Manager

From the session “System Center : First look at advancements coming this year” held 26.09 we got the following annoucements regarding SCOM.

  • New release cadence.
    • System Center 1801 prieview early November. Release Q1 2018
  • Service Map integration
  • Windows Server 2016 SDDC monitoring
  • Improved Unix/Linux support
    • “setup improvements” hopefully a better way to deploy “manually”
    • Kerberos support
    • Log file monitoring with FluentD. Essentially this enables us to create monitors etc. based on logfiles as we can with Windows
  • SCOM 2016 HTML5 console
    • Improved diagnostics and drill down – this is huge for those who haven’t invested in third-party software
    • Custom widget support. Display other charts on your dashboard.
  • MP updates and recommendations (introduced in 2016) now supports 3rd party MPs. 56 partners with certified MPs are available.
  • Visual Studio Authoring Extension for VS 2017

Other interesting stuff

  • Planned Maintenance for Azure VM
  • Teams primary communication client for Office 365 (Not Skype)
  • Updates to cognitive services api
  • Azure Cost Management from Clouddyn
  • Azure Stack is shipping

Share this:

  • LinkedIn
  • Twitter
  • Reddit
LEARN Community

EBOOK: Inside MSOMS v2

  • 29/08/2017
  • by Martin Ehrnst

 

Version 2 of the Inside Operations Management Suite e-book is available for download here

A year has passed since the authors Pete Zerger, Tao Yang and Stanislav Zhelyazkov released their first version of “Inside OMS” book. I read the first version cover to cover and learned a lot about OMS when first adopted the service. A lot has changed to the platform over the last year and the new ebook covers all new features, except the new query language recently introduced.
If you are like me, passionate about monitoring, analytics and general Microsoft technology, i strongly recommend this e-book.

This is the updated release (v2.0) of “Inside the Microsoft Operations Management Suite”, an end-to-end deep dive into the full range of Microsoft Operations Management Suite (OMS) features and functionality, complete with downloadable sample scripts.

The chapter list in this edition is shown below:

  • Chapter 1: Introduction and Onboarding
  • Chapter 2: Searching and Presenting OMS Data
  • Chapter 3: Process Automation
  • Chapter 4: Configuration Management
  • Chapter 5: Change & Update Management
  • Chapter 6: Extending OMS Using Log Search
  • Chapter 7: Alert Management
  • Chapter 8: Log Management & Performance Data
  • Chapter 9: Azure & Office 365 Solutions
  • Chapter 10: Service Map & Wire Data
  • Chapter 11: Network Performance Monitor
  • Chapter 12: Other OMS Solutions
  • Chapter 13: Assessment Solutions
  • Chapter 14: Security & Compliance
  • Chapter 15: Protection & Recovery
  • Chapter 16: ITSM Integration
  • Chapter 17: Custom OMS Solutions

Share this:

  • LinkedIn
  • Twitter
  • Reddit

Posts navigation

1 2 3

Popular blog posts

  • Azure Application registrations, Enterprise Apps, and managed identities
  • SCOM 1801 REST API Interfaces
  • Creating Azure AD Application using Powershell
  • Automate Azure DevOps like a boss
  • Access to Blob storage using Managed Identity in Logic Apps - by Nadeem Ahamed

Categories

Automation Azure Azure Active Directory Azure Bicep Azure DevOps Azure Functions Azure Lighthouse Azure Logic Apps Azure Monitor Azure Policy Community Conferences CSP Monitoring DevOps Guest blogs Infrastructure As Code Microsoft CSP MPAuthoring OMS Operations Manager Podcast Powershell Uncategorised Windows Admin Center Windows Server

Follow Martin Ehrnst

  • Twitter
  • LinkedIn

RSS feed RSS - Posts

RSS feed RSS - Comments

Microsoft Azure MVP

Martin Ehrnst Microsoft Azure MVP
Adatum.no use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it. Cookie Policy
Theme by Colorlib Powered by WordPress