Introduction: Connect a Light to the Weather Forecast

Picture of Connect a Light to the Weather Forecast

Use the weather to change the color of your lamp, to create your personnal ambiance !

Step 1: Get a Z-wave Key and the Bulb:

The key:

https://www.amazon.fr/Aeotec-Z-Stick-Manette-Adaptateur-ZW090-C/dp/B00YETCNOE?ie=UTF8&creative=22722&creativeASIN=B00YETCNOE&hvdev=c&hvnetw=g&hvqmt=&linkCo de=df0&ref_=asc_df_B00YETCNOE34044884&tag=googshopfr-21

The bulb:

https://www.amazon.fr/Aeotec-LED-RGBW-lampoule-ZW098-
C55/dp/B0117ZX936/ref=pd_sim_60_11? ie=UTF8&dpID=31FhkNgq7DL&dpSrc=sims&preST=_AC_UL160_SR115%2C160_&refRID=T3T9 BWX3A8KWRP371MCW

TimeSquAir :

https://www.amazon.fr/Digital-Airways-TimeSquAir-connect%C3%A9-
%C3%A9ducatif/dp/B014D0RBWC

Step 2: Download Z-Wave Node on TimeSquAir

Picture of Download Z-Wave Node on TimeSquAir

Go on the menu → import → node then type «ttb-zwave», wait for the install then reboot.

Step 3: Connect Your Key and Your Bulb to TimeSquAir

I let you refer at those tutorials, I can't explain better:

Connect your key:

http://thethingbox.io/docs/ZwaveUI.html

Connect your Bulb:
http://thethingbox.io/docs/ZWaveAeotecBulb.html

Step 4: Create the Flow

Picture of Create the Flow

In the workspace «Z-wave» copie the node «Aeotec, LED Bulb» in a new workspace.

Then add the node «zwave» in the Automation section and activate the workspace. You can now interact with the Bulb.

Step 5: Get the Weather

Picture of Get the Weather

Add the node «inject» and set it like on the first pitcure, you can set the interval as you want of course.

After that, link the nodes «meteo», «function», «switch» and finally two «Color» like on the second picture.

Let the node «meteo» as it is.

Open the node «function» and write this code inside:

"msg.payload = msg.payload.split(":");

msg.payload = msg.payload[1].split("°");

msg.payload = msg.payload[0];

msg.payload= parseInt(msg.payload, 10);

return msg;"

This code will get just the number of the temperature. At the beginning the node «meteo» display something like: «Paris:13°C». So what I've seperate this sentence with the method split(), first I'll seperate {Paris} and {13°C} with the caractere «:». Then I seperate {13} and {C} with the caracter «°». Finally I convert the string we have into an integer with the method parseInt().

Step 6: Configure the Color of the Bulb

Picture of Configure the Color of the Bulb

Now you must configure the switch ( example on the fisrt picture). Then link it to the nodes color and set it like you want. Activate the work space and it's done !

Comments

lee_lvd (author)2016-06-03

You lost me when the fist link is not in English

I am not able to read that

ArthurD27 (author)lee_lvd2016-06-04

Ho yes sorry I haven't realise this haha, I'll translate this part soon.

lee_lvd (author)ArthurD272016-06-04

thank you
later

About This Instructable

469views

11favorites

License:

More by ArthurD27:Connect a light to the weather forecastMake a connected dice with TimeSquAirHack a wireless keyboard into a remote sound box, thanks to TimeSquAir !
Add instructable to: