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 kgschlosser » Tue Apr 04, 2017 8:45 pm

when I make the switch over to Domoticz and start making some things for it. and post how it's running I am sure that may sway your decision on the 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:58 pm

kgschlosser wrote: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


I'm sure I'll find a use for this soon. By the way is there a way to pull instead of just waiting for temperature updates from the Vera? Just curious.

kgschlosser wrote: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.


Ok. Just saw this one. I'll start using the coding corner if I have more questions.

kgschlosser wrote:when I make the switch over to Domoticz and start making some things for it. and post how it's running I am sure that may sway your decision on the Vera.


I can't wait to see your Domoticz posts! I saw a video on youtube of a fellow who figured out how to reverse engineer 433mhz plugs to be controlled by the computer. He briefly showed Domoticz at the end of the video but I never thought much of it till now. I think it would really make Eventghost that much more useful if we could tie it into a better home automation software and link it to our homebrewed automation gadgets!
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 10:21 pm

well you don't have to pull it.. you store the temp. because it will trigger an event if it changes. so if you store the value locally in EG it will always be the same as what the sensor is. because when the sensor sends a change in temp to the Vera. the Vera in turn sends the new temp to EG so EG will always have the most up to date Temp reading.


make a macro with the event from the sensor for the temperature reading.. also add the event that shows the device getting added this happens when you launch EG. then make a Python script action and put the code below in it.

Code: Select all
if 'temperature' in eg.event.payload:
    eg.globals.veraTemperature = eg.event.payload['temperature']


you will have to install the keyboard plugin for this but make another macro and add an event with a key combination you select then make a pytyhon script with the code below in it.

Code: Select all
if hasattr((eg.globals, 'veraTemperature'):
    temp = eg.globals.veraTemperature + '\xba F'
else:
    temp = 'Temperature Not Available'

eg.plugins.EventGhost.ShowOSD(temp, u'0;-48;0;0;0;700;0;0;0;0;3;2;1;66;Lucida Calligraphy', (31, 237, 7), (0, 0, 0), 0, (0, 0), 0, 3.0, None)


so now when you want to display the temperature you can. by pressing that key combination
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 11:12 pm

I think I get it. So the accuracy of the weather will be limited to the frequency of updates from the VERA. I'll give this a go and report back on my results. Thanks again kg!
loveleejohn
Experienced User
 
Posts: 124
Joined: Thu Dec 10, 2015 12:09 am

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Postby kgschlosser » Wed Apr 05, 2017 1:49 am

yes and no.. if there is a change that is reported to the vera then it gets reported to EG. so the "accuracy" is really dependent on the device/plugin that is reporting.



ok so this is the process.. there are 3 components at work here

the device
the Vera
and the plugin i made for EG but we will refer to that as EG

so the Vera polls a device by default every 60 seconds. it asks for it's current status..
and the device responds

so say the vera has a current temperature for that specific device as being 65 degrees. and after the vera asks for an update and the device responds. it responds with 66.
the vera then checks what it has stored and sees the values are not the same so it then sets a dirty flag meaning that something for the device has been updated. and then sets the 66 degrees into that same storage container.

now EG polls the Vera the length of time between polling is what you set in the plugin config dialog.
so EG asks the Vera if anything has changed since it last asked.. and the vera responds back with everything that has changed. and the plugin then looks at the new data and parses it and triggers an event for the information it received from the vera.

so technically speaking if the device in question is that Motion sensor thing then the temperature is accurate to every 60 seconds unless you have set a different polling time between the Vera and the device or you have a polling time between EG and the Vera that is slower then the polling time between the vera and the device
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 » Thu Apr 06, 2017 11:24 pm

I thought I had this one figured out when I used the following python script but Eventghost began to bleed in red ink again...

Code: Select all
if 'temperature' in eg.event.payload:
    eg.globals.VERATemperature = eg.event.payload['temperature']


I even altered the triggering event to several different variants in order to capture all temperature events captured from the vera. Here's an example of one.

Vera.TestSpace.TestRoom.Sensor1 Temp.*

If a temperature event has occurred in the log seconds prior I can sucessful execute the python script manually but if any other activity occurs in the log before I run the script I get red errors suggesting that "none-type" cannot be iterated.
loveleejohn
Experienced User
 
Posts: 124
Joined: Thu Dec 10, 2015 12:09 am

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Postby kgschlosser » Fri Apr 07, 2017 12:27 am

Code: Select all
from copy import deepcopy

payload = deepcopy(eg.event.payload)
if 'temperature' in payload:
    eg.globals.VERATemperature = payload['temperature']


give this a try and see if it works for you.

the problem you are having is because a dictionary is a mutable object.. so as an example

if i did this..

Code: Select all
payload = {'test': 1}
eg.TriggerEvent('some.event', payload=payload)
dummyPayload = payload

dummyPayload['test'] = 2


what would happen is the value for test in eg.event.payload would change to 2 as well. even tho i didn't change it directly in that variable they are still connected. I would have to go and check to see if i passed the payload using deepcopy. if i didn't then this is the issue because once i trigger the event the event happens in a completely different thread then the plugin so 2 things can happen at the same time. so while the checking is taking place to see if temperature is in the payload it gets changed then when you go to access it you can't.

dictionaries, lists, and class/module/instance objects are mutable
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 » Fri Apr 07, 2017 12:35 am

Unfortunately that one didn't work out either but don't devote too much to this this since you've definitely triggered my interests in vera alternatives so I'll probably use the WU plugin you are making far more than trying to capture these weather events from the vera.
loveleejohn
Experienced User
 
Posts: 124
Joined: Thu Dec 10, 2015 12:09 am

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Postby kgschlosser » Fri Apr 07, 2017 12:37 am

Yup I would. I got tied up with other things and was having some issues with the WU plugin. so hopefully i will release it soon
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 » Fri Apr 07, 2017 12:54 am

No hurries at all. I'm actually learning a bit of things from using this eventghost program more. :)
loveleejohn
Experienced User
 
Posts: 124
Joined: Thu Dec 10, 2015 12:09 am

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Postby holdestmade » Fri Jul 28, 2017 7:32 am

I'm also not getting any events when sensors are tripped, the device does appear in the log when doing a full Vera add:

Vera.Added.Sensor.Garage Door {'category': '4', 'name': 'Garage Door', 'parent': '22', 'altid': 'DS/D/9DB9A0', 'lasttrip': '1501183288', 'armedtripped': '0', 'room': '10', 'batterylevel': '100', 'armed': '0', 'id': '383', 'tripped': '0', 'subcategory': '1'}

I only really need an event on "tripped" or "armedtripped"

Is there a quick way to add / enable this to your plugin ?

I know you are moving away from Vera and I would love to also, but I use RTI remote processors and there is no driver for Domoticz yet. I aim to not use the UI7 interface at all as I have built one in the RTI, but still need (want) EG to monitor Vera and do actions based on Vera events.

Thanks

SImon
holdestmade
 
Posts: 34
Joined: Thu Dec 04, 2014 2:44 pm

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Postby kgschlosser » Fri Jul 28, 2017 8:37 am

there are events already set up for armedtripped. what this means is the sensor is tripped when you armed the system. so essentially a sensor fault. there is an event for armed and disarmed also. I am not sure why you are not getting the events. But i also added events for tripped as well. you will have to replace the TextControls.py file in your vera plugin folder. with the attached one.

I have also added the different variables to the other sensor groups as well. so maybe that will help ya out. don't know tho.
Attachments
TextControls.py
(15.94 KiB) Downloaded 18 times
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 » Fri Jul 28, 2017 8:42 am

I have also decided I am not going to use domoticz. it is very problematic and the support is not very good. Their python plugins are limited to only being able to make devices and not control already existing ones. and to be honest is slower then hell. and doesn't update properly when a light is turned on manually or if it does it takes a couple of minutes before it updates. which is pretty useless in the world of being a home automation program.

I am going to be making a native zwave plugin for EG. this is going to take a very long time to do and the only python library i have found won't build on a windows operating system. if I could get it to build then it would make my job a lot easier then having to learn swig. because i can't seem to properly access the dll file without using 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 holdestmade » Fri Jul 28, 2017 10:17 am

You're a star, works a treat, there was a missing comma after

'armed' : [['Disarmed', 'Armed']]

but all OK now.

I'll keep watching for your progress on the Z-wave !

Thanks again for all you help on this and other stuff.

Simon
holdestmade
 
Posts: 34
Joined: Thu Dec 04, 2014 2:44 pm

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Postby kgschlosser » Fri Jul 28, 2017 3:25 pm

ooops on the missing ,

sorry. but at least it works for ya which is a good thing. you see now where i made the change. and how it is done?

that works for any of the vera categories.. it's laid out like this

Code: Select all
category number:
    variable name: [event suffix]

category number:
    variable name: [[event suffix state off, event suffix state on]]



the category number you can match up with the pairing right above that if the number is less then 0 then it is one that I added and is not a vera number
when you add the variable name if it is something like a weather forecast or a temperature.. some kind of data you will put a single suffix. if it is something that is going to be a state change where the values would be 0, 1, 2, 3, so on and so forth you would enter an event suffix for each of the state changes. if the state changes skip a digit for instance the variable will only ever be 0134 you have to make the suffix like like so [['0', '1', '', '3', '4']] that is really all the magic there is. i made it like that so events could be added or removed very easily.
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 3 guests