MiCasaVerde Vera UI5, UI6, UI7 Plugin

Questions and comments specific to a particular plugin should go here.

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Postby loveleejohn » Tue Apr 04, 2017 2:13 pm

So far so good kgschlosser! I commented out every line for wattage and the problem seems to have vanished for the moment. Thanks so much!

One small note, in your post you said to change the respective code block to:

Code: Select all
'2':  { 'name'         : ['Name'],
        'room'         : ['Room'],
        'level'        : ['Level'],
        'status'       : [['Off', 'On']]},
        # 'watts'        : ['Watts Used']},


This resulted in errors in eventghosts and since I had no idea what I was doing, I decided to dive into the fire to try to figure out what could be wrong even though I had no idea what I was doing. :lol: Turns out this version without an ending curly bracket worked.

Code: Select all
'2':  { 'name'         : ['Name'],
        'room'         : ['Room'],
        'level'        : ['Level'],
        'status'       : [['Off', 'On']]},
        # 'watts'        : ['Watts Used'],


Parentheses and brackets are the main reasons I keep running away from learning coding. :? At any rate, you're coding in this plugin is amazing especially considering the equipment you created it for.. Thanks kgschlosser.
loveleejohn
Experienced User
 
Posts: 124
Joined: Thu Dec 10, 2015 12:09 am

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Postby loveleejohn » Tue Apr 04, 2017 2:23 pm

mhendu wrote:...I've got about 50 plugins on my Vera Lite and sometimes it doesn't trigger events like it's configured to (I use PLEG for most of the automation). That's why I started looking into Eventghost...I also never really liked the idea of having all my plugins accessible to the MiCasaVerde folks, who theoretically can access your unit at any point. Preferable to paying a monthly subscription fee to use my home automation controller, as is the case for some other solutions, but I'd prefer a closed system where I control access.


Hi mhendu. I completely agree with you on the backdoor access to our Veraboxes. It really does creep me out and I think it's a horrible idea for companies to do that. If I don't abandon Vera first I'm gonna at least try to set it up for local access only but I'll have to research more on how to do that. That said, I don't have any issues with Vera Lite missing any events though. I'm running UI7.
loveleejohn
Experienced User
 
Posts: 124
Joined: Thu Dec 10, 2015 12:09 am

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Postby kgschlosser » Tue Apr 04, 2017 2:33 pm

do you happen to have GE or Jasco Dimmers???? those are the ones that I have and they have this problem. They are also supposed to have 2 different ramp cycles one for when you manually use the rocker and one for when a zwave command is sent. the rocker one works fine.. the one where you set the rate for the lights turning on from a zwave command does not.. and it's the same deal with the support. Micasaverde Vera says it's the switches. GE/Jasco says it's the controller. and when i use that wall controller the ramp works as it should. so it's the controller. and I have told them this. and they still argue the fact that it's the switches. and that it's specific to a firmware version. and I went and bought 2 new switches with different firmware.. and same problems. they don't want to listen they don't care. and I now hate the fact that when i originally purchased the controller this was because of the ability to use it without a subscription.. and now that is not the case. because the unit is useless without an internet connection because it has to authenticate with their servers and you have to pay a bill for your internet then you are in essence paying for a subscription. I said that to them and they stated well.. you can still use the unit.. and my reply was yeah. until you need to do something on it that requires you to login.

The thing i like about the Domoticz is that it is open source. and is still being developed. is PC based. and the zWave dongles are only 60.00 USD Because of the open source making a full blown connection with EG will be very easy to do. hell you could go and buy a nanoPC for 35-60.00 USD and end up with a dual or quad core 1.0ghz+ couple gigs of memory and possibly a HDD in it. No ram issues. No processing issues.

mhendu wrote:That's why I started looking into Eventghost, to hopefully take some of the processing off of the Vera so it could be used as a dumb controller, but might make more sense to explore a PC-based solution where memory / processing power won't be an issue. I also never really liked the idea of having all my plugins accessible to the MiCasaVerde folks, who theoretically can access your unit at any point. Preferable to paying a monthly subscription fee to use my home automation controller, as is the case for some other solutions, but I'd prefer a closed system where I control access.


This is exactly what I have done with my setup.. if you do this. it's really funny. but you will see changes in EventGhost before the UI on the Vera sees them. that is how terrible the UI is on their own controller. And any plugin that is available for the Vera probably already exists for EventGhost or can be made very easily. Like the vera can do security cameras right??.. yeah.. add more then one or 2 to the things and see what happens. And the funny thing is they keep on making new hardware. but hardware that has almost no improvement over the old, a 35 dollar Raspberry Pi has more cahonies (http://www.urbandictionary.com/define.php?term=cahonies) then any Vera made. making it Wifi and Z-Wave is another 70 USD. so for 100 USD you end up with one hell of a controller. and on top of it i would be willing to bet that since the Vera is openWRT based it can be ported very easily to run on a Raspberry Pi. their cost would be so low it would probably give them a bigger profit margin. I know it would because they would be able to kick their whole engineering team to the curb and only have to develop the software to run on it. and have someone make a pretty little box for it
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2702
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Postby kgschlosser » Tue Apr 04, 2017 2:39 pm

loveleejohn wrote:I don't have any issues with Vera Lite missing any events though. I'm running UI7.


I am running UI7 also.. mine doesn't miss running a scene.. But it will run it long after it is supposed to. And I only have 5 plugins on mine. But if i set up a scene for something like if this, light turns on then turn that light on.. this will actually run 5 minutes after i turn the light on.. That's not useful
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2702
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Postby kgschlosser » Tue Apr 04, 2017 2:51 pm

loveleejohn wrote: I commented out every line for wattage and the problem seems to have vanished for the moment. Thanks so much!

No worries m8, I will still help with it where i can. But not being able to really test it is not going to allow me to make any real changes.


loveleejohn wrote:Parentheses and brackets are the main reasons I keep running away from learning coding.


Don't be scared. I only started using EventGhost 2 years ago..And i did not know how to write code at all. I am 100% self taught. But i will always answer any questions to help out if you want to learn

loveleejohn wrote:At any rate, you're coding in this plugin is amazing especially considering the equipment you created it for.. Thanks kgschlosser.


Not really. this plugin is a sloppy mess. And I now have the knowledge to make it much better and I had started to do so in yet another complete rewrite of the thing. But alas i am finally to my limit with the Vera. But if you are interested I would help you to develop for it if you want to learn. Ya gotta start somewhere. and i found that reading the code. and googling (ya gotta know the google syntax) is what got me through.. well that and a lot of trial and error.

The biggest thing i have a problem with is MicasaVerdeVera changing the API for things and not letting anyone know they did. and not having any real good documentation for their API. And the damned Vera being so temperamental I am afraid to try things on it in fear that it will stop working and cost me the time and aggravation of setting the thing back up again.
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2702
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Postby kgschlosser » Tue Apr 04, 2017 3:03 pm

@ loveleejohn


also.. I wanted to let you know.. if there is a specific event your would like to see take place for a change on the Vera that does not currently happen in Eventghost.. the same process of removing an event can be used to add an event.

here is what you would have to do. go into the vera and in the configuration for the device you will be able to list all of the different variables for the device. I do not remember exactly what you have to click on to see this but you will know it when you see it. and I am sure you have seen it already. But in their is going to be the variable name you want to watch for a change. take not of that variable name. but for the sake of this instruction i am going to call it testvariable.

You will then go to the same spot where you comment out the wattage line. find the device type for that device and do this basically

Code: Select all
'2':  { 'name'         : ['Name'],
        'room'         : ['Room'],
        'level'        : ['Level'],
        'status'       : [['Off', 'On']],
        'watts'        : ['Watts Used'],
        'testvariable'      :['Test Variable']},


if it is something that is a state change. like an on or off
Code: Select all
'2':  { 'name'         : ['Name'],
        'room'         : ['Room'],
        'level'        : ['Level'],
        'status'       : [['Off', 'On']],
        'watts'        : ['Watts Used'],
        'testvariable'      :['Test Variable On', 'Test Variable Off']},


Now i know for 100% certainty that the adding of a single type of event will work and allow for the data from that change to be included in the event. I am not 100% certain if i set the thing up to allow for the state change. but i believe i did. This you would have to test out to see

This was one of the things i wanted to add into the plugin was a means of turning on and off specific events for specific devices/device types. so I had started coding the thing to do this.
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2702
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Postby loveleejohn » Tue Apr 04, 2017 4:39 pm

Thanks for the tips on how to add additional vera events kgschlosser. That will be very helpful if I decide to hang in there with Vera. +1 on buying the Vera because of it's not having a monthly subscription. smh... The micasaverde forums are only partly helpful and that is probably because of the limitations of the device. I almost fell into the trap of buying the V3, then the Edge, and then the PLUS. Luckily I noticed the pattern of excessive complaints with all of the new hardware releases and just hung on to my lite. Lol. I burst out laughing at your comment about the security cameras with VERA. I spent almost a week playing with configuration files, submitting support tickets, and calling customer service only to have the vera crash and burn every time the camera detected motion! That said, it is really really weird that their hardware rollouts seem to be so much faster than their software. :lol:

The device that was giving me an issue is actually one of the older fat ugly aeon smart energy plugs like this https://www.walmart.com/ip/Aeon-Labs-Smart-Energy-Switch-DSC06106/49032006. My excuse for getting them was that they were on a ridiculous sale a few years back. That said, they are very very evil and mischievous little things that remind me daily of my "great deal"?! I looked at the USB solution and became concerned about the range and potential speed issues. Seemed that the dedicated box might be faster but I am not sure. If a USB zwave controller can work reliably to replace VERA, I am definitely ready to make the switch!

In regards to coding for this plugin, I'll be glad to help when possible but If it took you 2 years to learn, it'll probably take me 19 or so. :oops: Lol. Seriously though, I have way too many interests and eventghosts is becoming way too addicting! lol. I simply love this program and the help from community people like you, pako, krambiw, and others I've seen on this forum.
loveleejohn
Experienced User
 
Posts: 124
Joined: Thu Dec 10, 2015 12:09 am

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Postby kgschlosser » Tue Apr 04, 2017 5:32 pm

Well i look at it this way. a lot of the home automation things i have in my home do not exist or are to damned expensive to buy. so i made them. and without EG as the backbone of my system I don't think I would have done what I have.


And EG is addicting. but not EG in it's self. It's the creating things and making things run and work that is addicting. and reaping the rewards (like a happy wife) is what make me do it.. I like to create things and I like seeing them work.

I had bought a bunch of cheap 7" touch pads which i have since removed because they would not power on because of batteries in them that were no good, even if they were plugged in. but they lasted 2 years and were 20 USD each. But none the less... I had everything set up with the lights so that a single press of a button would turn on all of my outside lights. Now. if you were to do this by going to each switch you would have to go to 3 locations and on 2 floors. so the touchpad made it so that everything turned on with the press of one button. my wife said.. why do we need that?!?!.. and now that she doesn't have it any more she complains. LOL. But i have been renovating my whole house so alot of my gadgets are not working at the moment and she complains. like EG using the GPS on a cell phone to get location relative to the house to turn on lights and turn up the heat. that's not running at the moment and she is quite annoyed to have to pick up the phone to manually do it through the vera app. but now since that isn't working I will see what happens when she gets home.. LOL


and as far as the sensors you have. I am willing to bet that the problem with them isn't the sensors. it's the Vera. all the sensors do is report information using the Z Wave Protocol. there is nothing mystical about it. now what the vera does with that information is what is mystical.

And i want to educate you on how ZWave works.

The Zwave network is a mesh topology. what this means is that the controller does not talk directly to every single device. all it has to do is talk to 1. and that 1 will repeat the message to the next.. and so on and so forth until it gets to it's destination. so it's the first hop that you need to have no farther then I think 60 feet (line of sight) each device (not including battery operated devices) are repeaters so the hop from that to the next has to be no more then 60 feet. that being said.. you don't want a daisy chain of these things as it does take time for the message to bounce from one device to the next so at 2:00 AM the vera rebuilds the zwave network and learns the best route through the devices to get to a specific device.

so as long as you have at least one device within the 60 foot range of the PC you should be good to go. in the event you don't they do make range extenders (waste of money) or you can simply put a plugin module somewhere in the middle

and it would take you a hell of alot less then 19 years.. it would take you alot less then 2. because I would help. I didn't have the help. and I refuse to let that happen to someone else. I did lose a lot of hair because of it. LOL
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2702
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Postby loveleejohn » Tue Apr 04, 2017 7:41 pm

Hahaha. Wait until your newly built coffee serving robot loses it's signal from VERA! We might never hear from you again! You better be careful what inventions you get her addicted to.. LOL.

I appreciate the offer for help by the way. Here's another question. I am having a really tough time finding out how to capture a temperature reading from this or any other plugin for that matter. I have read so many forum posts on the question that my eyes are about to bleed.

From this...
http://www.eventghost.org/forum/viewtopic.php?f=2&t=5363
to this...
http://www.eventghost.de/forum/viewtopic.php?f=2&t=5311
and this...
http://www.eventghost.org/docs/scripting.html
and of course this...
http://www.eventghost.net/forum/viewtopic.php?f=2&t=5937
and this too...
http://www.eventghost.org/forum/viewtopic.php?f=2&t=2462
and even this...
http://www.eventghost.net/forum/viewtopic.php?f=2&t=7815&p=38190&hilit=payload#p38190

I could go on, but I'm sure you get the picture. :cry:
Here's what I'm trying to do. I want to capture the temperature reading that I am getting from the plugin and print it in the log.

Here's what the log entry for the event looks like when I copy and paste it in notepad. I'm assuming this is the event payload?

Code: Select all
VERA.TestRoom.SpecialSection.Main-Motion-Sensor.Sensor.Temperature.66 {'category': '4', 'comment': '', 'subcategory': '3', 'parent': '1', 'altid': '15', 'lasttrip': '1491259756', 'state': '-1', 'armedtripped': '0', 'room': '26', 'temperature': '66', 'batterylevel': '100', 'armed': '1', 'id': '136', 'tripped': '0', 'name': Main-Motion-Sensor'}


What I need is to print just the temperature value to the log from this if that's possible. I also read your post here http://www.eventghost.net/forum/viewtopic.php?f=9&t=8090&start=60 but I can't understand if this decimal issue has been resolved or if it is what is really causing the problem since I really do not understand how to capture a value from a payload in the firstplace.
loveleejohn
Experienced User
 
Posts: 124
Joined: Thu Dec 10, 2015 12:09 am

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Postby kgschlosser » Tue Apr 04, 2017 8:07 pm

there really is no decimal issue. LOL

because the data you are looking for is in the payload.


Code: Select all
print eg.event.payload['temperature']
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2702
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Postby kgschlosser » Tue Apr 04, 2017 8:21 pm

so here goes on an explanation

the data after the event.. the stuff between those curly brackets { } that is the payload. now a payload can have { } or this [ ] or ' ' or " " or nothing at all to define the beginning and end of it


if there is nothing to define it then it is usually a number or a float (number with a decimal)
if you see the single or double quotes then it is a string (literal text)
if you square brackets then it is a list
and the curly brackets are a dictionary


so as an example if your payload is
Code: Select all
"this is a sample string"


and you want to pick out a specific character in that string you would do
Code: Select all
print eg.event.payload[2]


this will print a d into the log. this is because the index begins with 0. so if you wanted to print the p in sample you would use 13 in place of the 2

now this is going to spin ya about a little but a string is technically a list it is a list of single characters where as a list can have strings, numbers floats dictionaries, basically any python object. but the information is accessed the same way

now a dictionary which is what i used as the container for the payload data is the exact same as a real dictionary. with words and definitions. in python the word is called a key and the definition is called a value. but when you look in a dictionary you look it up by the word. so we are going to do the same we want the definition/value for the word/key temperature. now we know this word is in there because we can see it when it is printed. but you may not always be able to print it or see everything contained in it when it is printed. or it may be there one time and not another

so what we would do for that is
Code: Select all
if 'temperature' in eg.event.payload:
    print eg.event.payload['temperature']


this check to see if it is in there and if so then to print the value for it. this stops all that ugly red from appearing.

the things you edited in the TextControl.py file are dictionaries. the : separates the key from the value
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2702
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Postby kgschlosser » Tue Apr 04, 2017 8:24 pm

so in your example
Code: Select all
{'category': '4', 'comment': '', 'subcategory': '3', 'parent': '1', 'altid': '15', 'lasttrip': '1491259756', 'state': '-1', 'armedtripped': '0', 'room': '26', 'temperature': '66', 'batterylevel': '100', 'armed': '1', 'id': '136', 'tripped': '0', 'name': Main-Motion-Sensor'}



is better viewed like so

Code: Select all
{
     'category': '4',
     'comment': '',
     'subcategory': '3',
     'parent': '1',
     'altid': '15',
     'lasttrip': '1491259756',
     'state': '-1',
     'armedtripped': '0',
     'room': '26',
     'temperature': '66',
     'batterylevel': '100',
     'armed': '1',
     'id': '136',
     'tripped': '0',
     'name': Main-Motion-Sensor'
}


now we can better understand and see the word/key to definition/value relationship

and from the payload data i can tell that the Main-Motion-Sensor has 100% battery life is Armed is not Tripped it is device number 136 on your vera is reading a Temperature of 66 degrees and it last tripped on Mon, 03 Apr 2017 22:49:16 (less your time zone) and the room is number 26 on your vera
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2702
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Postby loveleejohn » Tue Apr 04, 2017 8:35 pm

That moment when the lightbulb turns on is awesome! I need more lightbulbs! Lol. Thanks Kg. I was finally able to capture the value from the log after reading your detailed description! I would suggest you copy and paste this into the tutorials forum so that others can learn this very helpful part of event ghost. It really is gonna take my scrpting to another level! Until I break something else anyway. Lol. Luckily I save my xml file several times a day.

I like the if statement since that makes the script respond instantly everytime a matching event occurs. I can now combine this greater than or less than conditions to completely remove vera scenes from my automation solutions! 1 step closer to the Vera elimination! :lol:
loveleejohn
Experienced User
 
Posts: 124
Joined: Thu Dec 10, 2015 12:09 am

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Postby kgschlosser » Tue Apr 04, 2017 8:40 pm

you could also do this

Code: Select all
print eg.event.string.split('Temperature.')[-1]


because the event has the actual temperature in it we can cut the event into pieces using split() and the separator for the pieces is "Temperature." Now if Temperature is used more then once you will end up with more pieces. but since we always know that the information we are looking for is always after "Temperature." and it always at the end of the event we will use a [-1] to grab the last item only
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2702
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Postby kgschlosser » Tue Apr 04, 2017 8:44 pm

any time you have a question ask in coding corner or just send me a PM, i usually answer the same day. but most times within a few hours. I like having it in coding corner so others can also post about it. as there are better ways to do things then what i come up with. and i do have lousy typing skills.
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2702
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

PreviousNext

Return to Plugin Support

Who is online

Users browsing this forum: No registered users and 4 guests