Page 1 of 1

Vera Home Automation Tutorials

Posted: Wed Apr 13, 2016 9:09 pm
by Cheesegeezer
As the title suggests here is the place to post any useful information regarding integration of Vera Home Automation with DemoPad. This first post will be updated with links to guides within this thread.

I have been playing a lot and have quite a lot working now, so will fill these in very shortly, plus i have more to add to the pot. But feel free to add more.

Vera Tutorial Links:
0. Basic Vera Setup as a device
1. Turning on a Binary Light - http://demopad.com/forum/viewtopic.php? ... 9123#p9123
2. Turning on a Dimmable Light - http://demopad.com/forum/viewtopic.php? ... 9122#p9124
3. Setting the dim level - http://demopad.com/forum/viewtopic.php? ... 9122#p9125
4. Running a Vera scene - http://demopad.com/forum/viewtopic.php? ... 9122#p9126
5. Enabling 2 way feedback - http://demopad.com/forum/viewtopic.php? ... 9122#p9127

SETTING UP YOUR VERA CONTROLLER AS A DEVICE IN DEMOPAD

1. Connect the WAN port on your VERA to a spare LAN port on your router. This will put VERA on your home network and assign it an IP address.
2. The MAC address of your VERA unit should be on a sticker on the underside the unit. Note this down.

Note: My Main Router is a TPLink so the following info is for setting up on this type of router. Google is your friend if you have a different router :)

3. Go to your routers Web page and log in, then navigate to your DHCP section and open a list of connected devices or DHCP Client List. This should show you a list of all devices on the network. It should have a Device Name(sometimes this is "unknown") a MAC Address and an IP address in the list. Find the MAC address of your VERA unit and note down the IP Address.

Image

4. Then go to the section where you can make your VERA a permanent address, therefore if there is a power cut, etc when your router boots up it will ensure that your VERA always keeps the same address.

On the TP link it is the "Address Reservation" Tab is directly under the DHCP Client List so click on that. Then click add new and enter the information requested, which is generally MAC address and the IP address you want to assign the VERA unit. Hit save and you will be prompted to reboot the Router before changes take effect.

Image

So that's that for the router side. Setting up the Vera as a new device in DemoPad is easy.

5. Select the Devices Folder and Click on New Device. Once "New Device 01" appears in the drop down. Click on the Name and rename it to something appropriate.

Image

6. Enter the IP address you have assigned on the Router and enter 3480 as the Port Number.

Image

Re: Vera Home Automation Tutorials

Posted: Wed Apr 13, 2016 9:10 pm
by Cheesegeezer
1. Turning on a Binary Light

To add a command we need the following info.

Information needed: IP address of VERA Controller. VERA Device Id of the Binary switch.

1. To find out the Device Id simply go to a web browser and type in the IP address of your VERA Controller, Log in if necessary.
2. Click on Devices and click the arrow you want to find device Id of
Image

3. Select Advanced from the list

Image

4. Bingo there is your device number

Image

Now we have all the information required to enter a command in demopad

5. Select your vera controller in the Device list in DemoPad and the click the View/Edit button in the Pre-defined Commands. A new window will open.
Image

6. Give your Command an Appropriate name and add in the following in the Command Data Window. Where you need to enter the device id and your VERA ip address. If you wish to switch the light on set the 1 colored in red to 1 or to switch off set the 1 in red to 0(zero).

GET /data_request?id=action&DeviceNum=<The DeviceId>&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1 HTTP/1.1
Host: <YourVERA_IP_Address>

7. Once you have filled in the Command Data Window correctly, Click the ADD button to the left, click on the Command and click the Test button.
Your device should switch on or off depending on what the binary command was set to.

Re: Vera Home Automation Tutorials

Posted: Wed Apr 13, 2016 9:10 pm
by Cheesegeezer
Reserved 2 - Turning on a Dimmable light

Re: Vera Home Automation Tutorials

Posted: Wed Apr 13, 2016 9:11 pm
by Cheesegeezer
3 - Setting a dim level

Follow the steps in Number 1 - Turning on a binary light, to get your device id for the dimmer

This will set dim level to 10%, where device number is your dimming unit as found in Vera Device settings. The newLoadlevelTarget is the dimming value. between 0 and 100.

But in the demopad Command Data add this information instead:

GET /data_request?id=action&DeviceNum=7&serviceId=urn:upnp-org:serviceId:Dimming1&action=SetLoadLevelTarget&newLoadlevelTarget=10 HTTP/1.1
Host: 192.168.0.106
Connection: keep-alive

Re: Vera Home Automation Tutorials

Posted: Wed Apr 13, 2016 9:11 pm
by Cheesegeezer
4. Running a Scene

First you will need to create a scene in your Vera controller. If you are unsure how to do this follow the link below.

https://support.getvera.com/customer/po ... own-scenes

Once you have done this you will have created a scene id number (highlighted in picture below). This is what you will need to let demopad know how to run a vera scene.

Image

Create a new command and name it appropriately

Image

Add the following command in the Command Data window, ensuring that your Scene Id number from Vera is entered after the RunScene&SceneNum

GET /data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum=3 HTTP/1.1
Host: 192.168.0.106
Connection: keep-alive

Dead Easy

Re: Vera Home Automation Tutorials

Posted: Wed Apr 13, 2016 9:12 pm
by Cheesegeezer
5 - Setting up 2 way feedback

First off you need to know a few things from Vera. You need to know your device names as labelled in the Vera dashboard and more importantly what variables are returned after requesting the status of your devices. You will also need your ip and port for your vera controller.

You will also need to set up in DemoPad some Numbers and Labels, or flags if you so wish. I am currently just using Labels and Numbers.

We will go thru a few scenarios with vera.
1. getting the status of a bulb (on/off)
2. getting the dimming level of a bulb (percentage)
3. getting the power consumption of a device
4. getting the temperature of a room
5. getting the humidity of a room.

Lets set up the numbers first. These numbers are what will be populated on the status request sent by demopad to the vera controller.

In demopad go to Project menu and click on numbers. Create a folder for a room. i.e Kitchen and then add the numbers for devices you have.
Pay attention to the minimum and maximum values. These can be used for guages also. In the images below you will get the idea of what values to put in here.

For example. Dimming and Humidity will be from 0% to 100%. Status is either on or off, so binary is used. 0 for off and 1 for on. for temperature, think realistically. I have a gauge set from 10 to 30 degrees. so my min and max numbers are 10 and 30, with a default of 18 (default value is the value given if no information is returned when the request is sent). And finally Power consumption - i have 10 leds in the ceiling of my kitchen and never go above 36Watts. However if you are using halogen or incandescent bulbs, then the power consumption will be much higher. A value of 0 and 1000 would probably be sufficient. However it's important to note that these min and max values only relate to gauges and not labels.

Image

Image

Image

Image

Image

Now we need to set some labels so we can display the number values. Close the numbers window and open the Labels window (still under Demopad Project settings tab)

Image

Ok good!!! so now we need to interogate Vera to find out exactly what status' are returned.

For this, You will need to download hercules TCP client software


You need to be connected to the same network, thru LAN or WiFi.
Once downloaded open Hercules. Allow access thru windows firewall if prompted. Then click on the TCP client Tab.
Enter the IP address and port of your Vera Controller.

Image

Click on the Ping button under the IP address and you should get a green reply saying "REPLY". If you get a red ping timeout, check your IP and Port numbers are correct.

Now we need to send the Vera Status Request. You will need to edit this line below for your ip address and port number of the Vera Controller
Its important to note that Hercules requires different carriage return than Demopad.

GET /data_request?id=sdata&output_format=xml HTTP/1.1$0D$0AHost: 192.168.0.106$0D$0A$0D$0A

Add the above request into Hercules (highlighted below), click on the connect button under the Port Entry box. Then Click on the send button

Image

You should get a return like this.

Image

We are only interested in the devices here. So lets take the Ceiling lights and break it down. In that one line, we get all the information we need for the Kitchen Ceiling Lights. We get the Device Name, the status, the dimming level and the power consumption.

this is what is returned for the ceiling lights:
<device name="Ceiling Lights" altid="5" id="7" category="2" subcategory="0" room="1" parent="1" status="1" level="100" watts="30.2" kwh="151.6800" state="-1" comment=""></device>
Device name is important.
status gives us the on/off state, either a 0 or 1
level is the dimming level, a number between 0 and 100
watts is the current power consumption, and can be any value.

So in DemoPad we just set up a Regex expression to pick out the information we need.
Click on the Zwave controller and then click on "Configure 2-Way "

In the image below you can see a lot of feedback is required to get specific information.
In the Window. you need to
1. Give the feedback a unique name.
2. Ensure that it matches a pattern (this is for REGEX)
3. Ensure that "send captured data" is sent to a number and select the number you entered before for the desired state.
4. Enter the regex pattern.

We need the Device Name and the item you want returned. For example ask the Controller if the ceiling lights are on.
In the Data Input box we will specify the device name and ask it to return a 1 for the status.
Note, quotation marks need to be escaped with a \
Note: everything is case sensitive, so pay attention to Upper and lower case!!
input this....
Ceiling Lights \".*status=\"(1).*
Then click add
For off
Ceiling Lights \".*status=\"(0).*
Then click add

To return an unknown value (number) (i.e. a dimming level, temperature, humidity, power consumption) in the value brackets we must use (.+?)
like this for ceiling dimming level and send captured data to "Ceiling dimming level" Number we created earlier.
Ceiling Lights\".*level=\"(.+?)\"
So for power consumption of the Ceiling lights
Ceiling Lights\".*watts=\"(.+?)\"

Image

For Scenes you just need to look for the Scene name and if it's active or not. If you wish to set a flag to show a scene is selected or not.

Once you have entered all of your request data you need to create an action ( in this case to set a label)
Double click on the the desired action condition.

This is for Kitchen Room Temp.
First set a label
Select the label you created.
then from the drop down menu in Data, select the Number for the captured data under Number Variables.

Image

Now that is set up all we need to do now is add a label to our UI and set a dynamic label with the label we just set.

Image

And finally we need to send the request for all pages that use the information.

Under the Zwave controller setup a new command
Call it Request_Status or something similar

Add this code into the data section, but change the IP address to match your controller like we did in hercules.

GET /data_request?id=sdata&output_format=xml HTTP/1.1
Host: 192.168.0.106\x0D\x0A

Add it and close.

Image


In demopad Click on the page in the Project navigation pane (left)
Under the Page Settings tab, click "Edit" and select "Edit page Load Actions"

No select the request command and you just created
We need to "send a command"
to the Zwave Controller
and the command we need to send is the "Request Status" command. which you need to select from the dropdown in "Select Command"

Image

Image

for lights i would repeat every 3 to 5 seconds, you can do 1 if you want.
for heating page i just use the maximum repeat which is every 2mins, 120secs

That should be you all sorted. Good Luck!!!!

Re: Vera Home Automation Tutorials

Posted: Sun Mar 04, 2018 7:13 pm
by dari
Is it possible to set a dim level ?
Can someone tell me how to set a dim level for vera zwave

Re: Vera Home Automation Tutorials

Posted: Wed Nov 21, 2018 12:21 pm
by Cheesegeezer
dari wrote:
Sun Mar 04, 2018 7:13 pm
Is it possible to set a dim level ?
Can someone tell me how to set a dim level for vera zwave
Hi there.

This is what i have to set dim levels, where device number is your dimming unit as found in Vera Device settings. The newLoadlevelTarget is the dimming value. between 0 and 100.

GET /data_request?id=action&DeviceNum=7&serviceId=urn:upnp-org:serviceId:Dimming1&action=SetLoadLevelTarget&newLoadlevelTarget=10 HTTP/1.1
Host: 192.168.0.106
Connection: keep-alive

Re: Vera Home Automation Tutorials

Posted: Thu Dec 06, 2018 12:05 pm
by Cheesegeezer
All sections are now populated!! Enjoy