Language:

Weather Plugin – How to activate it and use it in your scripts

It is possible to integrate a weather plugin in your Z-Wave network. This allows you to use weather conditions as rules for your scripts. Z-Wave certified devices in your network can then, for instance, be shut on or off when it starts to rain or when the temperature reaches a certain level. Follow these steps to integrate a weather plugin in you Z-Wave network:

1. APIkey parameter is required for plugin configuration so the plugin is allowed to access the OpenWeather service. To get it, you have to create an account at openweathermap.org: http://openweathermap.org/appid

2. Create a virtual “binaryLevel” Code Device

3. In “Code to get value”, enter: controller.devices.get(“OpenWeather_10”).get(“metrics:level”) > 10 “on” : “off”

In this case the device will go ON when the temperature is over 10 degrees, you can replace the 10 in the command line with every temperature you want. In this example, (“OpenWeather”) is the Element ID. To check yours, go to the configuration of your weather device.

The BinaryLevel device should work now and can be used in If-Then scripts and Logical Rules scripts.
To use the OpenWeather values for more extensive scripts you can follow these steps:

1. APIkey parameter is required for plugin configuration so the plugin is allowed to access OpenWeather service. To get it, you have to create an account at openweathermap.org: http://openweathermap.org/appid

2. Create a virtual “sensorMultiLevel” Code Device

3. In “Code to get value”, enter: controller.devices.get(“OpenWeather_10”).get(“metrics:level”)

In this example, (“OpenWeather”) is the Element ID. To check yours, go to the configuration of your weather device.

4. Set “Interval in seconds between polling requests” to 60 (The weather app updates once every few minutes)

The sensorMultiLevel device can now be used in Logical Rules scripts to trigger actions based on temperature values.

If you want to use, for example, humidity levels you should use the following parameters instead of (“metrics:level”):

(“metrics:zwaveOpenWeather:main:humidity”) For diagnostics and coding it might be convenient to have a list of all your devices and their properties. Open http://[YOUR-ZWAY-IP]:8083/ZAutomation/api/v1/devices to get a list in JSON structure.
Copyright 2011 - 2016 © DuneHD-Europe.com, Design by IBDL BV