Remote connection to homeseer with Perl or PHP

Pop your questions regarding Home automation Domotica hardware here.....
rbmace2403
Starting Member
Starting Member
Posts: 32
Joined: Sun Mar 04, 2012 6:07 pm

Re: Remote connection to homeseer with Perl or PHP

Post by rbmace2403 »

This one is correct:

$hs->hs->Transmit("c8", "On", 100,0,false, true);
rbmace2403
Starting Member
Starting Member
Posts: 32
Joined: Sun Mar 04, 2012 6:07 pm

Re: Remote connection to homeseer with Perl or PHP

Post by rbmace2403 »

Can you post your code?
techboy
Starting Member
Starting Member
Posts: 17
Joined: Thu Jan 31, 2013 8:49 pm

Re: Remote connection to homeseer with Perl or PHP

Post 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';
?>
rbmace2403
Starting Member
Starting Member
Posts: 32
Joined: Sun Mar 04, 2012 6:07 pm

Re: Remote connection to homeseer with Perl or PHP

Post 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';
techboy
Starting Member
Starting Member
Posts: 17
Joined: Thu Jan 31, 2013 8:49 pm

Re: Remote connection to homeseer with Perl or PHP

Post 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??
rbmace2403
Starting Member
Starting Member
Posts: 32
Joined: Sun Mar 04, 2012 6:07 pm

Re: Remote connection to homeseer with Perl or PHP

Post 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?
techboy
Starting Member
Starting Member
Posts: 17
Joined: Thu Jan 31, 2013 8:49 pm

Re: Remote connection to homeseer with Perl or PHP

Post 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
techboy
Starting Member
Starting Member
Posts: 17
Joined: Thu Jan 31, 2013 8:49 pm

Re: Remote connection to homeseer with Perl or PHP

Post 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
techboy
Starting Member
Starting Member
Posts: 17
Joined: Thu Jan 31, 2013 8:49 pm

Re: Remote connection to homeseer with Perl or PHP

Post 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
techboy
Starting Member
Starting Member
Posts: 17
Joined: Thu Jan 31, 2013 8:49 pm

Re: Remote connection to homeseer with Perl or PHP

Post 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
rbmace2403
Starting Member
Starting Member
Posts: 32
Joined: Sun Mar 04, 2012 6:07 pm

Re: Remote connection to homeseer with Perl or PHP

Post 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);
techboy
Starting Member
Starting Member
Posts: 17
Joined: Thu Jan 31, 2013 8:49 pm

Re: Remote connection to homeseer with Perl or PHP

Post by techboy »

No difference works the first time then the same error.
techboy
Starting Member
Starting Member
Posts: 17
Joined: Thu Jan 31, 2013 8:49 pm

Re: Remote connection to homeseer with Perl or PHP

Post 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
rbmace2403
Starting Member
Starting Member
Posts: 32
Joined: Sun Mar 04, 2012 6:07 pm

Re: Remote connection to homeseer with Perl or PHP

Post 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
techboy
Starting Member
Starting Member
Posts: 17
Joined: Thu Jan 31, 2013 8:49 pm

Re: Remote connection to homeseer with Perl or PHP

Post 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.
Post Reply

Return to “Questions & Discussions Forum”