MiCasaVerde Vera UI5, UI6, UI7 Plugin

Questions and comments specific to a particular plugin should go here.
Post Reply
User avatar
kgschlosser
Site Admin
Posts: 2891
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

MiCasaVerde Vera UI5, UI6, UI7 Plugin

Post by kgschlosser » Sun Mar 20, 2016 3:04 am

New MiCasaVerde Vera Plugin

TO ANYONE ALREADY USING THE PLUGIN MADE BY ME OR THE ORIGINAL PLUGIN MADE BY RICK NAETHING
YOU WILL HAVE TO REMOVE THE OLD PLUGIN FIRST

New Version 4.3b Added On 05/27/2016

If Upgrading:
You will have to delete all the tree items and delete the plugin from the tree, save EG.
then close EG
then delete the folder that contains the plugin in the EG plugins folder (normally C:\Program Files (x86)\EventGhost\plugins\MiCasaVerdeVera)

Installation:
extract the attached zip file to the EG plugins folder (normally C:\Program Files (x86)\EventGhost\plugins\)
then launch EG and add the plugin to the tree. enter the IP address of the Vera
leave the port alone it's really there for testing

Speed Test: This plugin when the speed in the plugin config dialog is set to .10 most times will trigger an event before the UI7 web interface even shows a change. sometimes by at least a second. and the controls from the menu system respond faster than using the web interface. all in all it's a great plugin now for complete operation of the Vera. I would love to get the window coverings piece working but i need someone that has these to test for me. i am going to write it how i think it operates (should be like a dimmer) and eventually someone will use it.

Added: Multiple Section Events and control, this is for operation of more than one Vera device and if they are attached together.

Changed: Device chooser inside of the action dialogs is now broken down to 3 separate drop down you can select the section (hub) the room and the device

Added: In the action dialogs it will show the device number as well as midfix (the piece kinda between the prefix and suffix of the event) so you have an idea of what the action that is posted will be like and can create the action without it having to have happened i plan on adding the the prefix that was entered in the plugin config to this as well so all that you will have to add is the suffix onto the end to complete it. it will look like this
"My Home.Living Room.Overhead Light.Dimmable Switch

Changed: Server is Using XML data now and not JSON

Changed: Server only asks for devices that have updated instead of the whole list this should reduce load on the Vera because of the increased load from UI7 i didn't want to add a huge amount more

Changed/Added: separated all the different controls into separate files this will make it easier for me to add features in the future. will also make it easier for the user to omit a particular file if they are encountering a problem with being able to keep the upgraded version in place will help with isolating any problems

Changed/Added: the action dialog for the HVAC has changed and has a lot of new things added it can operate in 2 modes either like a real time thermostat or just a normal action you can have events trigger from i also added weather reports to the thermostat so have a visual of the conditions outside (this requires the world weather plugin for the Vera)

Added: Ramping dialog now has an option so you can use the current state of the dimmer and go from there and you can also view the current dimmer level from inside the action dialog. this is a nice feature because you can now just check a box for an action to lower the lights and it will use the current dimmer level and go down from there without the need for making a script to do it.

Added: Locking and Unlocking of doors

Changed: UI7 no longer supports changing states of dimmers using the ON OFF method or Toggle so dimmers have been removed from those 2 actions and only switches will show up in those

Changed: proper event naming for categories
Changed: not relying on category names to do specific things in the plugin. as this caused a problem when the Vera developers decided to change some of the names.

Added/Changed: Ability to maintain the code for MIOS UI versions simply (if needed) if they continue with the kind of standard they are using now it should continue to run indefinably

Changed: On devices with 2 states I removed the name of what was changing from the event example: this event example: "My Home.Living Room.Overhead Light.Switch.State.On" is now going to look like "My Home.Living Room.Overhead Light.Switch.On", the categories for which this change will occur in is Alarms, Door locks, Switches, Scenes

Added: changed the drop downs in the HVAC controls to have a degree symbol after selected temp, ok simplify this, to much to type, every relevant type of weather marker and or climate marker has been added to the backside of the text. in drop downs and all, and this is all set to read the default measurement type from the Vera, so no need to change anything. the actions that have been modified in this way are the Light Ramping, Light Dimming, HVAC Controls. if you use the action in a python script or python command .The action parameters can be used with either an int, float, str or a str with the marker on the end. So for instance to set the light level on a dimmer for device 10 you can do any of the following.
device 10 is the overhead light in the living room on the primary hub
examples:
eg.plugins.Vera.Dimming(param1, param2)
for param1 the device any of the following 3 can be used
"10"
10
"My Home.Living Room.Overhead Light"
and for param 2 any of the following can be used

"50"
"50%"
50
"50.00"
"50.00%"
50.00

the plugin allows for down to a quarter of a percent resolution for lighting
the next thing i am going to redo is the menus so they aren't so long will make it easier to select a value

pressure, standard: 'inch Hg', metric: 'mb'
thermal unit, standard: 'F', metric: 'C'
speed, standard: 'mph', metric: 'km/h'
percent: '%'
i don't know if this is going to show up
degree: &#176

just to name a few

Changed: Menu System!!! what a lot of work. think i got it running smooth tho, accepts mouse input and keyboard input
button mapping

up/numpad up: menu up
down/numpad down: menu down
left/numpad left: backup a level
right/numpad right: forward or execute
return/numpad enter: forward or execute
home/numpad home: back to the room list
escape: exit menu system
backspace: back up a level

mouse double click is execute
mouse single click advances the menu
mouse wheel up is menu up
mouse wheel down is menu down

ok here is the kicker with this thing the menu is a never ending loop so no need to go backwards when you can go forwards
there is a close timer and that close timer stops running when the mouse is over the menu, and in order to use any of the controls the mouse has to be over the menu
the menu system allows for control of the devices (the ones i have added thus far) and it also will redraw with the current information. example: say you turn the lights up from the menu, it will show it in the menu as a nice confirmation. it also will position it's self in the menu at the current setting. so if you have a light at 43% when you go in to change the level, it will plop you on 43% as a start point

the menu has full lists of all of the percents and temps to set to (no decimal resolution) and it will show the correct temp range if you are metric or standard

items notated with the ---> on the right have another level and items notated with -*- are executable. scenes are also in this list. anything weather related will show up in a menu item called weather and if something doesn't have a room it will be in "No Room" and if it's a plugin it should be in the plugins folder (unless the plugin has been assigned a different category on the Vera)
there are going to be items that do not highlight these items are not select-able/use-able there are there for information and decoration

you can tell where you are in the menu because of 2 things, one. the current selected is always at the top.
and the second is the line shifts to the left

there are a lot of settings in the action dialog for this thing. you can change pretty much everything right down to the rounding of the corners on the menu and the width of the border
if you are having slow downs with the menu (it's time to upgrade the computer you have :D) nah, you probably need to decrease the size of the menu or change some of the transparency settings and the corner rounding. the harder it is for it to draw the slower it may become with a lot of data on the screen. it's an anti aliased image so it's purdy!

Added/Changed: i made the plugin dialog look better than it was and the items aren't all smooshed together. I also added 2 buttons only one of which works properly. the All Vera Data
I also grayed out the Port dialog window but it is still there so it can be viewed. if for some reason you need to change this parameter probably because you are forwarded through a router you have to edit the PluginConfigControls.py file and change the line with ENABLEPORT = False to ENABLEPORT = True it's right at the top of the file in the All Vera Data button if you click it you have to give it a second to populate, it's a lot of data so don't go click all impatient like. the Vera Unit is pretty handicapped in the speed department and that's why i don't like calling this particular command to it for device updates. but at some point i am going to have to because they are getting rid of the command i am using (don't understand as to why). but this will give you every thing that is set on the Vera and i do mean everything it's in a tree format and i have done a little shuffling around of some of the tree item names to make it easier to understand but all in all it's close to identical from what comes off the vera. this is in the exact same format as what i parse from the Vera. took a while for me to learn how to deal with all the information.

there are various other things i have changed throughout the plugin, i didn't make a list. but it seems to be running fine on my end.

bug reporting is the same. i cannot help if i do not have the following information

a screen shot of the error
a complete description of what was occurring when the error occurred.
a copy of the log for about 20 lines before and after (if so applicable) in a text file and attached to the post. don't want to filter through that in the forum thread

if there is a feature request, please do submit it in triplicate carbon copy snail mailed to Santa Clause, and he may give it to you for Christmas.
or you could just ask nicely

planned additions:

Security sensor arming and disarming (per sensor)
Schedule for the HVAC
Security Camera Viewing
Controls for the Vera plugins (has to be done on a plugin by plugin basis upon user request
Window Coverings

just to name a few

Remember this is experimental so please report any bugs to me and i will fix them pretty quickly

file is attached below

Thanks

K
Attachments
MiCaaVerdeVera4.3b.zip
(35.2 KiB) Downloaded 162 times
Last edited by kgschlosser on Fri May 27, 2016 5:55 pm, edited 7 times in total.
If you like the work I have been doing then feel free to Image

blaher
Experienced User
Posts: 464
Joined: Thu Nov 17, 2011 1:27 am

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Post by blaher » Sun Mar 20, 2016 5:16 am

Thanks for this. Here's a bit of feedback:

The temperature setting of the HVAC might need a Celsius / Fahrenheit setting, as the default of 70 is pretty warm in degC, but it may still work properly when a more reasonable temp is entered.

There's a little typo in 'set teperature' in the config box.

You might need to make a unique identifier for this Vera plugin, or EG will think the new one is a copy of old one, like in the pic. It might be the guid bit under eg.RegisterPlugin, but I have no idea how that string is chosen.

Thanks again.
Attachments
1Capture.JPG
1Capture.JPG (11.23 KiB) Viewed 4290 times

krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Post by krambriw » Sun Mar 20, 2016 5:50 am

but I have no idea how that string is chosen
This is important when creating new plugins. Always follow this advice;

viewtopic.php?f=10&t=604&start=15#p12011
My latest plugins
http://plugins.krambriw.net/index.html

Two men in front of a huge excavator...
- that beast steels work from 100 men with shovels
- well, a 1000 men could do the same using teaspoons

User avatar
kgschlosser
Site Admin
Posts: 2891
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Post by kgschlosser » Sun Mar 20, 2016 6:36 pm

I have been running this guy with it's own GUID i can change it for the sake of but I am not sure as to why it multiloaded like that.

at any rate.


about the Celsius I will add that today.

I just did a HUGE overhaul.

now it shows device rooms and names in the config panels.

i added about 200 lines of code but remove 300 i think
LOL

i managed to combine most of the config panel code together eliminating alot of repeat code.

the new addition of the rooms names hopefully should not affect backwards compatibility with those of you who have it installed.

Unfortunately my dumbass didn't think to set up a couple of actions to test that portion of it.

I think I have gotten everything working again but again people always find bugs.

I will change the GUID on this newest release.

BIG downside to a new GUID is it breaks backwards compatability 100%

so i will attach with new GUID here and edit the first post and leave the original one.


K
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 2891
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Post by kgschlosser » Sun Mar 20, 2016 6:48 pm

blaher wrote:Thanks for this. Here's a bit of feedback:

The temperature setting of the HVAC might need a Celsius / Fahrenheit setting, as the default of 70 is pretty warm in degC, but it may still work properly when a more reasonable temp is entered.

There's a little typo in 'set teperature' in the config box.

You might need to make a unique identifier for this Vera plugin, or EG will think the new one is a copy of old one, like in the pic. It might be the guid bit under eg.RegisterPlugin, but I have no idea how that string is chosen.

Thanks again.
what i will do is grab the vera setting for thermal units and use that by default

and you have to overwrite the old plugin i just started using a zip file, so you may have more than one location where the plugin is installed.

i am going to start cracking at the thermal units.

give me a few i should have it done in a jiff. the data is already there i just have to pull it and do a conversion.

K
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 2891
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Post by kgschlosser » Sun Mar 20, 2016 7:14 pm

All Done. it will automatically set the thermal units according to what the vera is set to.

i have attached the newest version on the 1st post

K
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 2891
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Post by kgschlosser » Mon Mar 21, 2016 12:26 am

I just finished adding a Vacation mode where EG will randomly turn lights on and off I want to add a config panel to it so the user can adjust thing like how long before it turns that light off, how long between turning lights on. it's a random time thing but the user would be able to set a min and max amount of time. for the different timers.

it works great how i have it set up variable timing capped at 30 minutes.

so how it works is it will generate a list of all of the lights, if its a dimmer it will pick a random lighting level and then it will turn the light on and set a timer to shut it off, then set another timer as when to turn another light on could be shorter than the shutoff of the other light or longer,


nice thing to have so people will think you are home even when you aren't. i have it joined to the e-mail plugin so i can send a text message right from my phone to an e-mail address it's monitoring to turn it on or off.

would anyone find an interest in me making a control panel type dealie for the HVAC, with full timers and scheduling and what have you??

input appreciated

Thanks

K
If you like the work I have been doing then feel free to Image

blaher
Experienced User
Posts: 464
Joined: Thu Nov 17, 2011 1:27 am

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Post by blaher » Mon Mar 21, 2016 1:46 am

krambriw wrote:
but I have no idea how that string is chosen
This is important when creating new plugins. Always follow this advice;

viewtopic.php?f=10&t=604&start=15#p12011
To create a GUID for your plugin, open the "Python Shell" under the "Help" menu. Then type:

import pythoncom
pythoncom.CreateGuid()

Do you make a blank EG config and then just load your plugin only, before opening the shell?

blaher
Experienced User
Posts: 464
Joined: Thu Nov 17, 2011 1:27 am

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Post by blaher » Mon Mar 21, 2016 2:15 am

kgschlosser wrote:now it shows device rooms and names in the config panels.
That is really cool, and makes it so much easier than looking up scene, or device numbers.

The Celsius bit works well too. Great job.

Edit: Even with the guid, adding your plugin to the tree when the old one is still there, or vice-versa, they become #2. Maybe because some of the class names are the same? I have no idea. :)
I have a fairly complicated tree, so I don't want to delete the old one before I have a chance to duplicate my actions in the macros.

The 'Run a Scene' config box could probably be labelled 'Scene:', or 'Room, Scene, Scene No.:', rather than 'Device:'.

The 'set light level' works well, but the event that is generated sometimes seems to be an unrelated scene, eg. wrong room, and scene, but the level is reported correctly.

The 'level of a dimmer' doesn't seem to generate an event, if that's its purpose.

And the 'ramp dimmable light' gives me a 'start' variable error.
Attachments
3Capture.JPG
ramp dimmable light
4Capture.JPG
typo
4Capture.JPG (10 KiB) Viewed 4268 times

krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Post by krambriw » Mon Mar 21, 2016 5:04 am

Maybe because some of the class names are the same?
Yes, this is a common reason
My latest plugins
http://plugins.krambriw.net/index.html

Two men in front of a huge excavator...
- that beast steels work from 100 men with shovels
- well, a 1000 men could do the same using teaspoons

User avatar
kgschlosser
Site Admin
Posts: 2891
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Post by kgschlosser » Mon Mar 21, 2016 5:53 am

eg.result baby

LOL
it returns the current dimmer value.

i did that so if you are going to use the ramp feature you have a known stating point and can go up or down from there so the lights don't be hittin ya with a light show because it's at say 15% and your script told it to start at like 40%.

the light would skyrocket to 40 then slow down to the speed you had set.

so i thought it would be usefule to just have a function that return the current dimmer value so that won't happen


yeah I know there are going to be some glitches and i caught that one with the device instead of the scene label.

it's because of how i combined all the egconfig panels together in common code.

it's the only one that doesn't use a device

LOL

so when i iterate through it it grabbed it as a device, tho the data is correct in the field.

i gave the Vera plugin a rest for a couple of hours i needed something different to do. getting fried on it.

i really really really do want to make a nice config panel for controlling the thermostat something with a nice 7 day scheduling ability and some fancy dancy buttons to opperate the modes and have a readout to let you know what state it's currently in.

but for the life of me I can't seem to get a handle on the wx crap.

the vacation timer is pretty pimp.

well i am going to go and make another new thread, i hacked the hell out of this really really old OSD plugin that didn't work properly. now it does, and its better than the builtin on screen menu jobs.

i only started messin with it a few hours ago but i am sure you guys have already seen it, and the lack of the ability to change monitors with it sucked.

so i fixed that.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 2891
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Post by kgschlosser » Mon Mar 21, 2016 5:56 am

doah! i forgot to change the var names on the ramp, that's a 30 second fix. but i will release the latest when i am done with the vacation timer and i will have that fixed as well as the device thing in the scenes.


K
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 2891
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Post by kgschlosser » Mon Mar 21, 2016 5:57 am

blaher wrote:
krambriw wrote:
but I have no idea how that string is chosen
This is important when creating new plugins. Always follow this advice;

viewtopic.php?f=10&t=604&start=15#p12011
To create a GUID for your plugin, open the "Python Shell" under the "Help" menu. Then type:

import pythoncom
pythoncom.CreateGuid()

Do you make a blank EG config and then just load your plugin only, before opening the shell?

or you can do the really really simple and go to https://www.guidgenerator.com/ LOL

the truth,
If you like the work I have been doing then feel free to Image

blaher
Experienced User
Posts: 464
Joined: Thu Nov 17, 2011 1:27 am

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Post by blaher » Tue Mar 22, 2016 7:39 am

krambriw wrote:
Maybe because some of the class names are the same?
Yes, this is a common reason
I changed the Vera pluginbase class name to VeraK, ( after the artist :) ), from Vera, and voila, no more clash with the old plugin, i.e. neither are renamed to #2.

The ramp feature works well now too. It would be a cool feature to be able to abort the sequence, eg. if it's gradually dimming, and someone decides they need a brighter light, they don't have to fight against the rampable sequence.

kfxo
Posts: 4
Joined: Thu Mar 31, 2016 3:38 am

Re: MiCasaVerde Vera UI5, UI6, UI7 Plugin

Post by kfxo » Thu Mar 31, 2016 3:46 am

I am having a hard time getting this plugin to work. I am new to Vera and just received a Vera Plus. The plugin appears to connect successfully to the Vera's API but then I get the following error over and over again. It never stops

23:36:26 MiCasaVerde: Server: EvalData: Error 1: (<type 'exceptions.ValueError'>, ValueError('No JSON object could be decoded',), <traceback object at 0x046173A0>)Error 2: (<type 'exceptions.SyntaxError'>, SyntaxError('invalid syntax', ('<string>', 1, 9, 'ion/json\r\n')), <traceback object at 0x04617788>)

Any ideas? Thanks

Post Reply