Page 2 of 2
Re: Remote connection to homeseer with Perl or PHP
Posted: Tue Feb 05, 2013 9:08 pm
by rbmace2403
This one is correct:
$hs->hs->Transmit("c8", "On", 100,0,false, true);
Re: Remote connection to homeseer with Perl or PHP
Posted: Tue Feb 05, 2013 11:14 pm
by rbmace2403
Can you post your code?
Re: Remote connection to homeseer with Perl or PHP
Posted: Wed Feb 06, 2013 7:39 am
by techboy
Hi here is my code many thanks
<?php
$hs=new COM("Homeseer2.application");
$hs->SetHost("localhost");
$hs->connect("guest","guest");
$hs->hs->Transmit("C8","on",100,0,false,false);
echo 'processed';
?>
Re: Remote connection to homeseer with Perl or PHP
Posted: Thu Feb 07, 2013 11:59 am
by rbmace2403
try:
$hs=new COM("Homeseer2.application");
$hs->SetHost("localhost");
$hs->connect("guest","guest");
$hs_api=$hs->GetHSRef();
$hs_api->Transmit("C8", "on", 100, 0, false, true);
echo 'processed';
Re: Remote connection to homeseer with Perl or PHP
Posted: Thu Feb 07, 2013 10:45 pm
by techboy
getting error
Call to a member function Transmit() on a non-object in D:\xampp\htdocs\HsTestControl\homeseer.php on line 8
any ideas??
Re: Remote connection to homeseer with Perl or PHP
Posted: Sat Feb 09, 2013 9:24 am
by rbmace2403
You copied the homeseer dll ( dll files mentioned in the beginning of this topic) files into your php directory, where php.exe is?
Re: Remote connection to homeseer with Perl or PHP
Posted: Sun Feb 10, 2013 12:42 am
by techboy
Hi I have copied the homeseer2.dll and the other 2 files into the php.exe folder.
I have even set everything up on my other laptop one running xp the other vista 64bit, same error on both although the second machine vista worked once and only once.
does anything need altering in php.ini??
I have also applied the latest homeseer updates
thanks
Re: Remote connection to homeseer with Perl or PHP
Posted: Sun Feb 10, 2013 7:59 am
by techboy
I am wondering if a path needs to be set????
at the moment I have copied the files to c:\xampp\php
does php.ini need an alteration to include that or a path setting to c:\programfiles\homeseer?
whicj I realise is less than ideal in the wild but would prove a point for testing?
thanks
Re: Remote connection to homeseer with Perl or PHP
Posted: Sun Feb 10, 2013 8:16 am
by techboy
I have just created a little test app in vb6 and it worked straight out of the bag?
I must have some security setting different in the php.ini but no idea what any ideas, please?
thanks
Re: Remote connection to homeseer with Perl or PHP
Posted: Sun Feb 10, 2013 9:43 am
by techboy
It seems if I reboot my machine start homeseer and go straight to my test page I can turn C8 on once and only once then the error returns
Re: Remote connection to homeseer with Perl or PHP
Posted: Sun Feb 10, 2013 7:53 pm
by rbmace2403
You have to check if $hs_api already exists, if it exists you dont need to login for a second time.
Try this :
if (empty($hs_api)) {
$hs=new COM("Homeseer2.application");
$hs->SetHost("localhost");
$hs->connect("guest","guest");
$hs_api=$hs->GetHSRef();
}
$hs_api->Transmit("C8", "on", 100, 0, false, true);
Re: Remote connection to homeseer with Perl or PHP
Posted: Mon Feb 11, 2013 7:55 am
by techboy
No difference works the first time then the same error.
Re: Remote connection to homeseer with Perl or PHP
Posted: Mon Feb 11, 2013 11:10 am
by techboy
Could it be that the object doesn't disconnect from homeseer correctly?
Should I dispose of the object in someway at the end of the script?
thanks
Re: Remote connection to homeseer with Perl or PHP
Posted: Mon Feb 11, 2013 1:15 pm
by rbmace2403
Do you have email, I can sent you a class file which worked for me? I am not using it anymore, because I created my own home automation system in PHP with everything. The reason was that i Found I could create a better system with a better GUI than homeseer and its fun
The class I created was created 1,5 years ago, so it could be that it isnt working anymore because homeseer changed something?
Ronald
Re: Remote connection to homeseer with Perl or PHP
Posted: Mon Feb 11, 2013 5:25 pm
by techboy
Will pm you,
thanks I am wondering that, HS changed something as I had it working on the demo system 6+ months ago straight out of the box and couldn't believe my luck, So went on the webdesign front end thinking the back end was a piece of cake!!!
I would like to moce away from Homeseer but I haven't seen a DLL that will transmit a x10 code(haven't had a real chance to look) and I have an Ocelot setup which I works really well.