Homeseer Plugin - Please take a look and help thank you

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
bocarob
Posts: 3
Joined: Wed Jun 03, 2009 7:48 pm

Homeseer Plugin - Please take a look and help thank you

Post by bocarob » Sat Aug 07, 2010 5:40 pm

Hi all found this bit of code for aplugin tried contacting the writer but can not find him his site does not allow regestration. Any way I have attached his code it seems to fail but looks just like a great plugin could someone sort it out:

err I get unpon running it is seems to connect just fine but when I run a command :

Error in Action: "Homeseer: OnOffCommand: \67"
Traceback (most recent call last) (1436):
File "C:\Program Files\EventGhost\eg\Classes\ActionBase.py", line 168, in CallWrapper
File "C:\Program Files\EventGhost\plugins\Homeseer\__init__.py", line 113, in __call__
File "C:\Program Files\EventGhost\plugins\Homeseer\__init__.py", line 60, in doOnOffCommand
AttributeError: 'function' object has no attribute 'IsOn'

Any help not a python programer ( not yet working on learning) thank you

Robert
Attachments
EventGhost.Plugin.HomeSeer.zip
(4.17 KiB) Downloaded 580 times

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

Re: Homeseer Plugin - Please take a look and help thank you

Post by krambriw » Sun Aug 08, 2010 5:45 am

I do not have Homeseer but it seems that there is a problem with the device code you entered. My guess is that you should double check the device code you entered. It is defined as a string and I think you should enter it like B2, A4 depending on your configuration in Homeseer

It doesn't look like the plugin has any error control that the device really exists in Homeseer configuration so it better be precise. Maybe this part can be improved with some try/except statements or it might be that it is possible to read configured devices from Homeseer to have them at hand during the action configuration

I hope other users with Homeseer will help you further

Best regards, Walter

bocarob
Posts: 3
Joined: Wed Jun 03, 2009 7:48 pm

Re: Homeseer Plugin - Please take a look and help thank you

Post by bocarob » Sun Aug 08, 2010 12:26 pm

Thank you for your responce the device code is correct it is the code that is failing does the std dist of eventghost include the lib
import win32com.client ..........

Regards

Robert

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

Re: Homeseer Plugin - Please take a look and help thank you

Post by krambriw » Sun Aug 08, 2010 5:26 pm

That's no problem I think, if I try to import win32com.client, I can do that without problem

There are however some code in the plugin I would have done a bit differently. Maybe you can try if I make some modifications?

Maybe you can try/answer the following
- does the plugin load correctly in EG without error messages (I guess your answer is yes)
- are you able to do connect to Homeseer host?
- does the speak action work?

Best regards, Walter

User avatar
Livin
Experienced User
Posts: 790
Joined: Wed Oct 08, 2008 4:56 am

Re: Homeseer Plugin - Please take a look and help thank you

Post by Livin » Sun Aug 08, 2010 11:35 pm

Bob,
I have used HS for 8+ years and created a lot of web code for it and use web pages as they are the most universal so i can use the same code on iPhone/iPod, PC, Android, etc. I'm no web developer, just a hack but here's the links if you want to see the different command options HS has...

Home Control Center (HCC)
... reads current config from HS dynamically
http://forums.homeseer.com/showthread.php?t=137374

All-In-One Mobile UI
... each control is specified in code
http://forums.homeseer.com/showthread.php?t=138279

I don't do much in the way of "integration" with EG except send a few simple commands (see below script). Maybe you can explain what you are looking to do?

Code: Select all

# Send HTTP Post
import urllib
WEBSVR = "http://htpc/"
devicename = "Living Room Subwoofers"
action = "action_off"
cmd = "Off"
# Encode the data
params = urllib.urlencode({'control_device':devicename, action:cmd, 'selectdim':0})
# Send POST command to Homeseer
urllib.urlopen(WEBSVR, params)
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system

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

Re: Homeseer Plugin - Please take a look and help thank you

Post by krambriw » Mon Aug 09, 2010 5:47 am

Might be better to follow Livin's advice

I have the same problem as you. I'm using the latest eg beta 0.4.0 r1397 but the author is using 0.3.7 r1462

It connects ok to the HS server but that's all

I managed to make it speak by changing the line

Code: Select all

            self.hsi.speak(speech)
Using hsi instead of hs but it did not help for the doOnOffCommand action

I think there might be a COM problem. If I use hsi also for the doOnOffCommand I get

Code: Select all

07:56:38             if self.hsi.IsOn(deviceCode):
07:56:38           File "win32com\client\dynamic.pyc", line 512, in __getattr__
07:56:38         AttributeError: HomeSeer2.application.IsOn
There has been several other issues earlier discussed here in this forum regarding COM problems. It might be that the registration of HS failed or was incorrect during install

I do not know what to do next, sorry

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

Re: Homeseer Plugin - Please take a look and help thank you

Post by krambriw » Mon Aug 09, 2010 9:59 am

Finally I got a modified version working....

Best regards, Walter
__init__.py
(5.31 KiB) Downloaded 522 times

nissse
Posts: 11
Joined: Wed Sep 08, 2010 2:13 pm

Re: Homeseer Plugin - Please take a look and help thank you

Post by nissse » Wed Sep 08, 2010 2:21 pm

Can someone please help me !

I'm trying to add on off command to the script and not only onoff switch

I have never coded in eventghost before, but i have tryed for many houres now.
The problem i'm having is to add another "self.AddAction" I only get it to work with 2.

I guess that krambriw can fix this in 5 min but i whanted to try first before asking here.

here is the file with 2 "self.AddAction" working.
Attachments
__init__.py
(7.21 KiB) Downloaded 422 times

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

Re: Homeseer Plugin - Please take a look and help thank you

Post by krambriw » Wed Sep 08, 2010 3:32 pm

Hi, you may try this updated version, it works here
It has 3 actions; the old "on/off", an "on" and an "off"

Best regards, Walter
__init__.py
(7.1 KiB) Downloaded 656 times

nissse
Posts: 11
Joined: Wed Sep 08, 2010 2:13 pm

Re: Homeseer Plugin - Please take a look and help thank you

Post by nissse » Thu Sep 09, 2010 6:08 am

Hello Walter.

Thank you so mutch for taking the time to help me with this. It works perfekt.

Again THANK YOU !

Best Regard.

User avatar
Livin
Experienced User
Posts: 790
Joined: Wed Oct 08, 2008 4:56 am

Re: Homeseer Plugin - Please take a look and help thank you

Post by Livin » Mon Sep 20, 2010 12:18 am

I suggest using my code posted above... much more flexible. this plugin only uses device code and on/off... my code can use the Device Name (much easier to remember) and can do ANY command.

I think it also works on events... cannot remember if I test that.
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system

wollo
Posts: 4
Joined: Wed May 25, 2011 4:23 pm

Re: Homeseer Plugin - Please take a look and help thank you

Post by wollo » Fri Jun 03, 2011 6:44 pm

Looking for a little help.despite various attempts with different logins and port numbers I cant even log onto my homeseer machine with this plugin. I get this error most of the time:

Error starting plugin: Homeseer
Traceback (most recent call last) (1509):
File "C:\Program Files\EventGhost\eg\Classes\PluginInstanceInfo.py", line 177, in Start
self.instance.__start__(*self.args)
File "C:\Program Files\EventGhost\plugins\Homeseer\__init__.py", line 61, in __start__
self.hs = Dispatch("homeseer.application")
File "win32com\client\__init__.pyc", line 95, in Dispatch
File "win32com\client\dynamic.pyc", line 108, in _GetGoodDispatchAndUserName
File "win32com\client\dynamic.pyc", line 85, in _GetGoodDispatch
com_error: (-2147221005, 'Invalid class string', None, None)

or gtcp is already registered.

Am I right in saying I shouldnt use a port number in the box for host name? although I have tried the port homeseer web ui is on and 8737 and 8742.I am using valid logon details for the homeseer web ui.I am connecting remotely from my intranet. and I do have speaker client installed on the machine with eventghost and the machine with homeseer. I am very new to eventghost and still finding my feet. please help.

wollo
Posts: 4
Joined: Wed May 25, 2011 4:23 pm

Re: Homeseer Plugin - Please take a look and help thank you

Post by wollo » Fri Jun 03, 2011 7:50 pm

Sorted by downloading a newer version of the plugin.

kiliansitel
Posts: 3
Joined: Thu Aug 11, 2011 12:42 pm

Re: Homeseer Plugin - Please take a look and help thank you

Post by kiliansitel » Thu Aug 11, 2011 2:36 pm

Hello,

I cant get this plugin to work: connects to homeseer okay, speak works after changing HS to HSI but the on/off command will not work. Tried all versions of the plugin i could find but no luck :(

This is my error:

Homeseer: OnOffCommand: A1
Error in Action: "Homeseer: OnOffCommand: A1"
Traceback (most recent call last) (1534):
File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionBase.py", line 170, in CallWrapper
return self(*args)
File "C:\Program Files (x86)\EventGhost\plugins\Homeseer\__init__.py", line 119, in __call__
self.plugin.doOnOffCommand(deviceCode)
File "C:\Program Files (x86)\EventGhost\plugins\Homeseer\__init__.py", line 74, in doOnOffCommand
if self.hs.DeviceExistsRef(deviceCode)>-1: # krambriw: Check if the device exists
File "<COMObject HomeSeer.application>", line 2, in DeviceExistsRef
com_error: (-2147352567, 'Exception occurred.', (0, u'homeseer', u'Object variable or With block variable not set', None, 1000091, -2146828197), None)

Thanks a lot for any reply.

Grtz,

Kiliansitel

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

Re: Homeseer Plugin - Please take a look and help thank you

Post by krambriw » Fri Aug 12, 2011 6:19 am

Hi,

It works for me. I have a Standard Edition version 2.4.0.1 with a trial license that has expired but when I send commands to device "A1" the Homeseer log says it is working fine

Best regards, Walter

Post Reply