Homeseer to Azure IoT interface script

I have created a script that enables HomeSeer users to post device values to a Microsoft Azure IoT hub.




Here’s the resulting report in Power BI.  

Homeseer VB script

You can download the VB script from here - you need to save this in your homeseer scripts directory or just paste it into the code window in an event.

You must update the script with the name of your IOT hub, the device name and the SAS token (using IOT explorer above).

You then supply it with parameters which defines a catergory (note the spelling mistake) which is any free text field you with, it just allows you to create filters in your reports, followed by the homeseer device name that you wish to monitor. I have several events configured - here’s the example of the parameters I pass:

catergory=Water|Hot Water pressure|Water pressure|WaterLToday

catergory=Temperature|Outside Temp|New Kitchen|Midon Onboard|Master Bedroom|Living Room|Kitchen Floor|Hot Water|Guest Room|Garage|Day Room|Croyde|Hot Tub|

catergory=Humidity|Lodge Temperature 1|Lodge Relative Humidity 2|Loft Temperature 1

Continue to Page 2

Create the IOT device and SAS token:

You need to download and compile Azuro IOT device explorer from here, which allows you to create devices, create SAS tokens, monitor traffic coming in and generate messages back to your device.This is mainly because I was too lazy to create the code to generate and renew the token on a regular basis (which is how you are supposed to do this).  As you can see, having a 365 day expiry is very bad.