How to install "myvera" directly on your vera.

Hi all,
MyVera is an interface that allows you to control your home automation from your browser (chrome only) or from your ipad or iphone (or android device).
Here, some screenshots :

And a video : Interface domotique sur iPad - YouTube

You can download it from its author website : http://sbdomotique.wordpress.com/
The official myvera thread (in french) : TouteLaDomotique.com : la maison connectée au meilleur prix

This interface uses PHP, so you will need to have a web server with PHP that can communicate with your vera.

I’ll explain here how to install myvera (and php) directly on the vera. So, no need to have an external computer for our PHP interfaces…

[Color=#FF0000] WARNING: [/color]
I explain here how to install “myvera” on the flash memory but that space is very limited. It turns out that it fits with the version of “myvera” available at the time of writing this tutorial, but there is no guarantee that future versions of myvera can also fit.
If this is the case, there are two possibilities:

  • Install MyVERA in RAM (in “/tmp”). However, at every reboot you will need to reinstall “myvera.”
  • Install on a USB stick. There’s no risk in case of reboot.

I still places available the current “space optimized” version (myveraRC121119) http://www.psykokwak.com/pub/vera/myvera.tgz

PREREQUISITES:
So obviously the first thing to do is to install PHP on your vera. For this, I invite you to visit the following tutorial: [b]http://forum.micasaverde.com/index.php/topic,13126.0.html[/b]

Step 1: Copy “myvera” on vera:

  • With winscp copy “myvera.tgz” folder in the “/tmp” your vera.

Step 2: Install “myvera” (in “/root”, but you are free to install it wherever you want)

  • In SSH (with putty), type the following commands:
cd /tmp
tar xvzf myvera.tgz -C /root/

Step 3: Configure the web server (lighttpd) to access to “myvera”

  • Edit (with “vi”) file “/etc/lighttpd.conf”.
  • At the very end of the file, add the following:
$SERVER["socket"] == ":8080" {
server.document-root = "/root/myvera"
}

The first line indicate the TCP port on which we want to access to myvera (useful for separating “integrated” interface in the case of access from internet)
The second line indicates the location where you installed “myvera.”

Step 4: Test that everything works

  • Restart the web server:
pkill -9 lighttpd
lighttpd-f /etc/lighttpd.conf

If there is no message that appears is that the server is restarted.
Now from your browser, type the following url: http://:8080/

;D ;D

If you have any questions, do not hesitate to post them here :smiley:

I have installed everything according to your description, which by the way is very straight forward, I like it. It is installed on a UBS stick. The interface seems to be running, at least I can access it through my browser. I will do some more extensive testing on the weekend.

However, I already have some questions/remarks:

  1. Do you plan on creating an english version? I do speak french and english quite well, I would offer to do the translations for you. I could also offer german translations since that is my native language.

  2. On http://sbdomotique.wordpress.com/ I was unable to find a download for MyVera. Is http://www.psykokwak.com/pub/vera/myvera.tgz the newest version or is this the special “space optimized” version?

  3. Do you plan on implementing an update routine? Or does this always have to be done manually? I think it would be nice if the version and release date would be listed in “Config.”, then I would at least know which version is running.

  4. The command “lighttpd-f / etc / lighttpd.conf” in the description above is wrong, should be “lighttpd -f /etc/lighttpd.conf”.

  5. I would love to see you implement rights/users. So for example I could say “The user XY has only access to light XY”.

  6. Could you maybe explain how to setup .htaccess when installed locally on the vera?

By the way, I saw on some screenshots that you already support two of my plugins, the VirtualSwitch and the VariableContainer, THANK YOU for this and the plugin, great work!

I’m not the “myvera” developper. I’ll forward your request to him. I think it could be a good idea.

This is the latest version at the time I writing this but I know there is a major update in the next few days.
If you have enough space (because you use an USB stick), you could use the “standard” version.

I don’t know. Like I said, I’m not the developper.

Oups, sorry. Fixed. Thanks.

I think it will be a feature of the next release.

Here an automatic translation that explain it : MyVera – mini tuto htaccess | SB domotique

I’ll forward your thanks to the author :wink:

Thanks for the fast reply!

Concerning point 6:

Which would be the “web” folder on the vera? Is this /www? Do in need to put the .htaccess there?

Not sure that lighttpd supports .htaccess files (which are specific to Apache server).

So does this mean it is not needed when installed locally on the vera itself? Which users/pw would I then need to enter? Or is then no password needed?

By default there is no protection. Just enter what you want as login and password.
Lighttpd provides a different mechanism to do the same as the .htaccess protection (which is a classic http auth).
You have to read the lighttpd documentation if you want to use this feature.
In the next release this mechanism will be replaced by a PHP transparent auth (both auth will always be possible).

This is interesting, looking forward to the english version before I jump in.
I have a question though.

There seems to be a “blueprint” style layout of your home. Where do you set this up at? Do you provide a picture, then place the devices anywhere on a map?

Exactly,
You have to create your plan from any software you want (I used http://floorplanner.com/) then export it as an image and insert the image into the app. Then you just have to place your devices anywhere you want over the image.
MyVera asks the vera for all available devices, so you just have to decide which one you want do display on your map.

So it is up and running for me. But I still have some questions:

In which format and size should the pictures be available? Always when I try adding and image url I get and error that the vue was not updated. Can images also be stored locally ond the vera/usb-stick?

Also for me virtual switches and variable containers are not working, even though it says here (MyVera – Les modules gérés | SB domotique) that they should be working. So I am still wondering if I really have the newest version?

What I also realized that it is very optimzed for the iPad, on which the interface looks very perfect and clear. On the Nexus 10 however the interface does not look nice, no errors, but just not clear.

Your image must be in jpeg and it will be stored in one myvera subdir.
Try with this is newer beta version, there is lot of improvement : http://sb.domo.free.fr/dev/myvera02_nigtlybuild231212.zip
(don’t forget to clear your cache)

[quote=“psykokwak, post:11, topic:173842”]Your image must be in jpeg and it will be stored in one myvera subdir.
Try with this is newer beta version, there is lot of improvement : http://sb.domo.free.fr/dev/myvera02_nigtlybuild231212.zip
(don’t forget to clear your cache)[/quote]

hello

the link is http://sb.domo.free.fr/dev/myvera02_nigtlybuild301212.zip

very good job

Thanks for the link to the homefloorplanner site, I spent a good amount of time yesterday re-creating my home :slight_smile: I plan to use it for this.

I have a question though; Could I install this on another PHP webserver? i’ll admit this is new to me, but I have a QNAP NAS which has a webserver, can I follow your install instructions above? If it’s easy enough, please advise how to install, it will save me a lot of time. Also advise when/where to change the information to suit my system.

2nd question is can this be installed on Vera2?

Thank you,

I don’t know your QNAP NAS. It should have a package installer, so you have to use it to install PHP. My package only works for our Vera.

It should :smiley:

I actually copied it all over to the qnap, it seems to be running, but i’m having a hard time configuring this thing. Are you saying that this “web page” can ONLY be ran from Vera?

In New View, I have Name, Tab, Index, and URL of the Image.
I cannot select anything under tab, URL I’ve tried a remote and local URL, I only get ERROR Updating.

I cannot create a Tab, or Create a View. All errors every time. I can see a list of all my devices and scenes in those tabs, but I cannot create or save anything… please help.

I got it working just fine in a Ubuntu VM running apache. Initially it didn’t work at all, but after checking the apache error logs I found you need to enable curl support in your php.ini file. I also had to make sure that the web user had write access to the folder to create the config files or else nothing would save

MyVera works with any PHP enabled webserver.

[quote=“big517, post:15, topic:173842”]In New View, I have Name, Tab, Index, and URL of the Image.
I cannot select anything under tab, URL I’ve tried a remote and local URL, I only get ERROR Updating.[/quote]
Check that your webserver has rights to write inside your “myvera” directory (and all subfolders).

Once you have uploaded your plan you may place your devices over.

Where do I enable CURL support? Here is the PHP file;

[PHP]
engine = On
short_open_tag = On
asp_tags = Off
precision    =  12
y2k_compliance = On
output_buffering = Off
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func=
serialize_precision = 100
allow_call_time_pass_reference = On
safe_mode = Off
safe_mode_gid = Off
safe_mode_include_dir =								
safe_mode_exec_dir =
safe_mode_allowed_env_vars = PHP_
safe_mode_protected_env_vars = LD_LIBRARY_PATH
disable_functions =
disable_classes =
expose_php = On
max_execution_time = 240     ; Maximum execution time of each script, in seconds
max_input_time = 60	; Maximum amount of time each script may spend parsing request data
memory_limit = 64M      ; Maximum amount of memory a script may consume
error_reporting  =  E_ALL & ~E_NOTICE
display_errors = Off
display_startup_errors = Off
log_errors = Off
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
track_errors = Off
variables_order = "EGPCS"
register_globals = off
register_argc_argv = On
post_max_size = 16M
gpc_order = "GPC"
magic_quotes_gpc = On
magic_quotes_runtime = Off    
magic_quotes_sybase = Off
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
doc_root =
user_dir =
include_path = ".:/etc/config/php"
extension_dir = /usr/local/apache/modules
enable_dl = On
file_uploads = On
upload_max_filesize = 16M
allow_url_fopen = On
default_socket_timeout = 300
upload_tmp_dir = /share/Web
[Syslog]
define_syslog_variables  = Off

[mail function]
SMTP = localhost
smtp_port = 25
sendmail_path = /usr/sbin/sendmail -t -i

[Java]

[Date]
date.timezone = "Asia/Taipei"

[SQL]
sql.safe_mode = Off

[ODBC]
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1  
odbc.defaultlrl = 4096  
odbc.defaultbinmode = 1  

[MySQL]
mysql.allow_persistent = On
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port =
mysql.default_socket = "/tmp/mysql.sock"
mysql.default_host =
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = Off

[mSQL]
msql.allow_persistent = On
msql.max_persistent = -1
msql.max_links = -1

[PostgresSQL]
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off 
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0

[Sybase]
sybase.allow_persistent = On
sybase.max_persistent = -1
sybase.max_links = -1
sybase.min_error_severity = 10
sybase.min_message_severity = 10
sybase.compatability_mode = Off

[Sybase-CT]
sybct.allow_persistent = On
sybct.max_persistent = -1
sybct.max_links = -1
sybct.min_server_severity = 10
sybct.min_client_severity = 10

[dbx]
dbx.colnames_case = "unchanged"

[bcmath]
bcmath.scale = 0

[browscap]

[Informix]
ifx.default_host =
ifx.default_user =
ifx.default_password =
ifx.allow_persistent = On
ifx.max_persistent = -1
ifx.max_links = -1
ifx.textasvarchar = 0
ifx.byteasvarchar = 0
ifx.charasvarchar = 0
ifx.blobinfile = 0
ifx.nullformat = 0

[Session]
session.save_handler = files
session.use_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor     = 100
session.gc_maxlifetime = 1440
session.bug_compat_42 = 1
session.bug_compat_warn = 1
session.referer_check =
session.entropy_length = 0
session.entropy_file =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="

session.save_path = /share/MD0_DATA/.php_session
[MSSQL]
mssql.allow_persistent = On
mssql.max_persistent = -1
mssql.max_links = -1
mssql.min_error_severity = 10
mssql.min_message_severity = 10
mssql.compatability_mode = Off
mssql.secure_connection = Off

[Assertion]

[Ingres II]
ingres.allow_persistent = On
ingres.max_persistent = -1
ingres.max_links = -1
ingres.default_database =
ingres.default_user =
ingres.default_password =

[Verisign Payflow Pro]
pfpro.defaulthost = "test-payflow.verisign.com"
pfpro.defaultport = 443
pfpro.defaulttimeout = 30

[com]

[Printer]

[mbstring]

[FrontBase]

[exif]

[eaccelerator]
extension = eaccelerator.so
eaccelerator.shm_size = 32
eaccelerator.cache_dir = /.eaccelerator.tmp
eaccelerator.enable = 1
eaccelerator.optimizer = 1
eaccelerator.check_mtime = 1
eaccelerator.debug = 0
eaccelerator.filter = 
eaccelerator.shm_max = 1M
eaccelerator.shm_ttl = 0
eaccelerator.shm_prune_period = 3600
eaccelerator.shm_only = 0
eaccelerator.compress = 1
eaccelerator.compress_level = 9  

[Crack]

; End:

I just had to put ’ extension=php_curl.dll ’ at the end of my file as part of this guide: [url=http://saffrongeek.wordpress.com/2009/03/03/curl-enabling-php-ubuntu/]http://saffrongeek.wordpress.com/2009/03/03/curl-enabling-php-ubuntu/[/url]

Have a look here
http://forum.qnap.com/viewtopic.php?f=125&t=65933