PHP interface for TellStick, HomeAutomation v2.0.2 released!

Moderator: Telldus

tbrg78
Posts: 4
Joined: Fri Mar 17, 2023 9:45 am

Re: PHP interface for TellStick, HomeAutomation v2.0.2 relea

Post by tbrg78 »

Ahh, ok! After searching for "schtasks" in the code and enabling the debug mode in the HA settings-panel, I was able to track down the problem. My Win2003 Server uses a german language pack, and there is a slight commandline difference when running schtasks.exe. As intelligent as Microsoft is from time to time, they translated strings like "DAILY", "ONCE" etc. to german as well, and that's where HA fails to run schtasks.exe, as it obviously does not talk "german" o) I changed the keywords in the code to get around this.

Another reason why scheduled tasks within HA was not working, was because it did not supply the "silent/force" switch "/F" to schtasks.exe automatically. I digged the code and found a constant to be checked. After adding "define(CFG_WINDOWS_FORCE_SCHEDULER_AVAILABLE, 1);" to config.php, HA does add the switch to the commandline and HA/schtasks.exe no longer "stalls" waiting for user confirmation. Now all is working fine!

So in case anybody has problems managing scheduled tasks, he might check the debug logfile and the commandlines used under "/logs" after enabling debug mode.

Thanks again!.. o)
tom_rosenback
Posts: 779
Joined: Fri Mar 17, 2023 9:45 am
Contact:

Re: PHP interface for TellStick, HomeAutomation v2.0.2 relea

Post by tom_rosenback »

tbrg78 wrote:Ahh, ok! After searching for "schtasks" in the code and enabling the debug mode in the HA settings-panel, I was able to track down the problem. My Win2003 Server uses a german language pack, and there is a slight commandline difference when running schtasks.exe. As intelligent as Microsoft is from time to time, they translated strings like "DAILY", "ONCE" etc. to german as well, and that's where HA fails to run schtasks.exe, as it obviously does not talk "german" o) I changed the keywords in the code to get around this.

Another reason why scheduled tasks within HA was not working, was because it did not supply the "silent/force" switch "/F" to schtasks.exe automatically. I digged the code and found a constant to be checked. After adding "define(CFG_WINDOWS_FORCE_SCHEDULER_AVAILABLE, 1);" to config.php, HA does add the switch to the commandline and HA/schtasks.exe no longer "stalls" waiting for user confirmation. Now all is working fine!

So in case anybody has problems managing scheduled tasks, he might check the debug logfile and the commandlines used under "/logs" after enabling debug mode.

Thanks again!.. o)
The translation issue I had not been aware of need to take that into account for later releases. The FORCE flag has been there for a while. Great that you got it working!
//Tom

Senaste info och release om/av HomeAutomation hittas här http://karpero.mine.nu/ha
Latest info and release of HomeAutomation can be found here http://karpero.mine.nu/ha
ltpitt
Posts: 18
Joined: Fri Mar 17, 2023 9:45 am

Re: PHP interface for TellStick, HomeAutomation v2.0.2 relea

Post by ltpitt »

Hi everyone and happy and home-automated new year :D

I've been struggling in the past to be able to change my Smartphone status (present @ home or not) in HA.

Finally I've had success!

Here's how:

<?php
// Get cURL resource
$curl = curl_init();
// Set some options - we are passing in a useragent too here
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => 'http://YOURIP/ajaxinterface.php?login_u ... D&status=1',
CURLOPT_USERAGENT => 'Codular Sample cURL Request'
));
// Send the request & save response to $resp
$resp = curl_exec($curl);
// Close request to clear up some resources
curl_close($curl);
?>

Before I was using curl from bash that definitely didn't do the job.

Php version did great so now I have a python script monitoring for my smartphone ip at home and calling this php script accordingly.

Neat!

Thanks for this lovely product...
As soon as I can I'll donate again :)
tom_rosenback
Posts: 779
Joined: Fri Mar 17, 2023 9:45 am
Contact:

Re: PHP interface for TellStick, HomeAutomation v2.0.2 relea

Post by tom_rosenback »

ltpitt wrote:Hi everyone and happy and home-automated new year :D

I've been struggling in the past to be able to change my Smartphone status (present @ home or not) in HA.

Finally I've had success!

Here's how:

<?php
// Get cURL resource
$curl = curl_init();
// Set some options - we are passing in a useragent too here
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => 'http://YOURIP/ajaxinterface.php?login_u ... D&status=1',
CURLOPT_USERAGENT => 'Codular Sample cURL Request'
));
// Send the request & save response to $resp
$resp = curl_exec($curl);
// Close request to clear up some resources
curl_close($curl);
?>

Before I was using curl from bash that definitely didn't do the job.

Php version did great so now I have a python script monitoring for my smartphone ip at home and calling this php script accordingly.

Neat!

Thanks for this lovely product...
As soon as I can I'll donate again :)
Thanks for sharing!
//Tom

Senaste info och release om/av HomeAutomation hittas här http://karpero.mine.nu/ha
Latest info and release of HomeAutomation can be found here http://karpero.mine.nu/ha
tom_rosenback
Posts: 779
Joined: Fri Mar 17, 2023 9:45 am
Contact:

HomeAutomation v3.0

Post by tom_rosenback »

Now has the day come that hopefully many of you have been waiting for! HomeAutomation 3.0 has been for a long time under development and the timetable has just stretched for some reason or another (building house, newborn daughter etc) but now we have come that far that we feel 3.0 is ready for public release too. :D

There has been a lot going on behind the scenes in 3.0 but also the GUI has gotten some attention. Largest bit is the mobile userinterface. In 3.0 one can also build own systemplugins så that one can use other systems than Telldus too, I´ll write a short "for-dummies" how to do this. In the installation is included tdtool and some other plugins that we feel can be useful right from the start. The Weather Parser has also been integrated into HA now so no need the download it separately anymore. The API has been restructured and refactored, also some new functionality has been added. You can now also find a short documentation on how to do requests against the API. That was just a summary of what has happened, do you feel that you want more info about what exactly has been changed, have a look in the ChangeLog here http://karpero.mine.nu/mantis

If you find anything wierd or have any questions about the 3.0 release, just give me a ping so that we can solve it.

The download link can be found here: http://karpero.mine.nu/ha/index.php?page=download
//Tom

Senaste info och release om/av HomeAutomation hittas här http://karpero.mine.nu/ha
Latest info and release of HomeAutomation can be found here http://karpero.mine.nu/ha
tom_rosenback
Posts: 779
Joined: Fri Mar 17, 2023 9:45 am
Contact:

HomeAutomation

Post by tom_rosenback »

In the same time as HomeAutomation 3.0 was released also a new department for HomeAutomation was opened on the Telldus forum, please continue discussion there.

New HomeAutomation department: http://www.telldus.com/forum/viewforum.php?f=27
//Tom

Senaste info och release om/av HomeAutomation hittas här http://karpero.mine.nu/ha
Latest info and release of HomeAutomation can be found here http://karpero.mine.nu/ha
Post Reply