Tellstick & iPhone - Tellit, new webApp

Moderator: Telldus

Postby to2 » Sun Jan 03, 2010 6:42 pm

Ok nice to know :)

anyways: I installed the new update of Tellit 0.1.2, And it automatically setup my user to look for language "nb" (Norwegian Bokmål) I had to manually go into mysql and change it to "en" for the site to work... <-- just so you know :)
to2
 
Posts: 17
Joined: Fri Dec 25, 2009 7:57 pm

Postby skorpion » Sun Jan 03, 2010 7:00 pm

tellit grabs your browser language by default and looks in the /lang folder and if a translation exits, it will use it, if it doesnt exist, it will (it was ment to work so, but it might be a bug you have found) use the default language that is english.

Im not sure what you ment with "for the site to work"

When "nb" was in the database, could you see any text at all in tellit? Or did english show up?

If you want, you can translate tellit to "nb". Just copy one of the existing language files in /lang folder and translate it and send it to me (niclas at skorpion.se)

/niclas
skorpion
 
Posts: 74
Joined: Wed Mar 04, 2009 10:47 pm

Postby skorpion » Sun Jan 03, 2010 7:11 pm

to2: You found a bug (the language thing) THANK YOU

I've fixed it now (I think)

A new version will be out in a few days for you to try!

/Niclas
skorpion
 
Posts: 74
Joined: Wed Mar 04, 2009 10:47 pm

Postby to2 » Mon Jan 04, 2010 1:14 am

I'm just glad I can help! I love Tellit! And I love messing around with code! I actiually was thinking of making a /lang/nb.php file tomorrow at work ^^ and I will be sending it to you when I'm finished :-)

If you ever need someone to test the software I'm more than happy to be that guy!

Have you ever thought of making a sort of scheduler for Tellit?

Btw... What system do you use? Receivers and for what? I'm looking into ways of integrating everything I own with this! Just amazingly easy when I can control it from Tellit :-)

Later
-to2
to2
 
Posts: 17
Joined: Fri Dec 25, 2009 7:57 pm

Postby skorpion » Mon Jan 04, 2010 10:10 am

I have considered of making a scheduler, but I'm not sure how I want it to work and how simple it should be. Using cron or not. However, there is an existing scheduler for tellstick in linux, I might use it if I know howto "talk" to it in a simple way (add/edit/delete)

My server is running debian. My recievers are one nexa dimmer and 2 nexa switch and 3 risingsun (kjell & Co.)
I dont use them much right now, mostly just for testing purpose.

/Niclas
skorpion
 
Posts: 74
Joined: Wed Mar 04, 2009 10:47 pm

Postby to2 » Mon Jan 04, 2010 10:17 am

what scheduler for linux are you talking about?

Did you receive the nb.php translation ?
to2
 
Posts: 17
Joined: Fri Dec 25, 2009 7:57 pm

Postby skorpion » Mon Jan 04, 2010 10:32 am

I think the scheduler is called tellstickd. Its only commandline (which I prefer)

I recieved your translation, but I'm at work right now so I will look into it when I get home
skorpion
 
Posts: 74
Joined: Wed Mar 04, 2009 10:47 pm

Postby to2 » Sat Jan 09, 2010 12:36 am

Hi skorpion :)
I just ordered
- http://elby.no/Traadloes-styring/Nexa-t ... r-LWMR-210
and
- http://elby.no/Traadloes-styring/Nexa-t ... er-HDR-105

How can I add the selflearning (first link) to Tellit? (considering I have to type in specific house and number)


Also, I am trying to write a scheduler for Tellit using crontab, but it's fair to say that I'm not a experienced scripter :P I have written a new page inside the settings menu, where I start to choose one of the existing units, give the schedule a name, and write the crontab args. minute hour date month dayofweek, and last choose on/of in a checkbox.

So far I haven't even tried to get the the page to display the existing units, but I am struggeling with being able to get the PHP to accept the "*" symbol and then write it to the new "tellit_schedules" table in mySQL.
The fields holding "*" could just as well be empty but when I try to store it, it puts the cursor inside the field it "don't like"...

Any ideas?
to2
 
Posts: 17
Joined: Fri Dec 25, 2009 7:57 pm

Postby skorpion » Sat Jan 09, 2010 12:25 pm

Im not sure on how it works exactly. But i think you need to put your reciever in some kind of learning-mode (look in the manual (http://www.nexa.se/ManualerProduktblad.htm))
Then you might be able to send a house and number code for it to learn. It could be that it doesnt want a letter for housecode (I think I've read it somewhere). Try searching this forum for "selflearning".

If you find out what "selflearning" wants to recieve from the tellstick (rfcmd), please let me know so I can make changes to tellit if its nessacary.

EDIT: For your other question, it sounds like its my javascript-function that search for valid characters and if it finds one illegal character it steal the focus to the inputfield. It could be this, but maybe something else to.

(If its the JS that steals the focus to a field, PHP will also not accept it, because its uses almost the same function)

/Niclas
skorpion
 
Posts: 74
Joined: Wed Mar 04, 2009 10:47 pm

Good work!

Postby thoberre » Thu Jan 21, 2010 11:26 pm

Hi,

this is really good, and very promising!

I needed rewrite a bit to make it use tdtool on my Mac - but now it works just fine - even my wife uses her iPhone to control the lighting :)

I have some headers sent issues various places, but have not managed to pinpoint why, other than during Guest-link login. I'll work with that and post the results.

Keep up the work!

Thom
thoberre
 
Posts: 12
Joined: Wed Jan 20, 2010 7:41 pm

Postby skorpion » Fri Jan 22, 2010 5:44 am

Thats really interesting
I'm working on making it compatible with tdtool and I'm almost finished.

Hom did you make tellit to communicate with tdtool?

I hope I will get a new version out this weekend or in the beginning of next week.

/Niclas
skorpion
 
Posts: 74
Joined: Wed Mar 04, 2009 10:47 pm

Postby thoberre » Fri Jan 22, 2010 10:46 pm

Just made a quick and dirty hack:

After installing TelldusCenter I had to symlink tdtool according to other posts in this forum:

sudo ln -s /Library/Frameworks/TelldusCore.framework/Versions/2.0.0/Frameworks/QtCore.framework/Versions/4/QtCore /usr/local/lib/
sudo ln -s /Library/Frameworks/TelldusCore.framework/Versions/2.0.0/Libraries/libftd2xx.0.1.4.dylib /usr/local/lib

In the configpart I used this, also according to other posts in this forum:
$tellstickExecutableFullPath="export DYLD_LIBRARY_PATH=\"\"; /usr/bin/tdtool";

Obviously I have to add units with the same name in Tellit and TelldusCenter, tdtool is not able to add units?

I have no dimmable units, so I ignored that part of the code, but that should be implementable with tdtool as well. I don't know if iUI have some kind of control that could present absolute dimming i.e for the Nexa dimmers?

I also run my MAMP installation Apache server under the same user as the TelldusCenter.

In index.html around line 219 I changed to this:

Code: Select all
        //If lamp is not dimable
        else{
            switch($status){
                case 0:
                $toggle=1;
                system($tellstickExecutableFullPath." -n ".strtoupper($item). " " .$tellstickExecutableFullPathEnd);
                error_log($tellstickExecutableFullPath." -n ".strtoupper($item). " " .$tellstickExecutableFullPathEnd);
                break;
                case 1:
                $toggle=0;
                system($tellstickExecutableFullPath." -f ".strtoupper($item). " " .$tellstickExecutableFullPathEnd);
                error_log($tellstickExecutableFullPath." -f ".strtoupper($item). " " .$tellstickExecutableFullPathEnd);
                break;
                case 2:
                $toggle=0;
                system($tellstickExecutableFullPath." -f ".strtoupper($item). " " .$tellstickExecutableFullPathEnd);
                error_log($tellstickExecutableFullPath." -f ".strtoupper($item). " " .$tellstickExecutableFullPathEnd);
                break;
            }
            mysql_query("UPDATE tellit_item SET activity='".date("D M j G:i:s T Y")."', status='".$toggle."' WHERE device=(select device from (select * from tellit_item) as x where id='".$_GET['id']."') && house=(select house from (select * from tellit_item) as x where id='".$_GET['id']."') && number=(select number from (select * from tellit_item) as x where id='".$_GET['id']."')") or die(mysql_error());
        }
        //system($tellstickExecutableFullPath." -f ".strtoupper($item). " " .$tellstickExecutableFullPathEnd);
        //        error_log($tellstickExecutableFullPath." -f ".strtoupper($item). " " .$tellstickExecutableFullPathEnd);


I regards to the header issue, it's consistent when using the guest direct link mode (which is no issue for me as it is only internally reachable - and actually also critical as my wife would throw everything out if she had to log on each time she needs to control lights :)

Since I have no experience in session handling I don't know how to deal with this.....


Notice: Undefined index: user in ...htdocs/tellit/index.php on line 147
Notice: Undefined index: pass in ....htdocs/tellit/index.php on line 147
Notice: Undefined index: guestpass in ...htdocs/tellit/index.php on line 153
Warning: Cannot modify header information - headers already sent by (output started at ....htdocs/tellit/index.php:147) in ....htdocs/tellit/index.php on line 162
thoberre
 
Posts: 12
Joined: Wed Jan 20, 2010 7:41 pm

Postby thoberre » Fri Jan 22, 2010 11:27 pm

In regards to the header already sent issue on guest link login (actually missing index fr user, pass, guestpass) it was fixed by reversing the order of login if..elseif..else test to:

//Link login (guest)
//Guest login
//Admin login

This way it does not test the parameters if it's not set i.e for a guest link login?

Don't know if it breaks anything as I don't fully understand the tests, but it looks good.

I think maybe the problem is more of a general problem regarding mixing POST and GET parameters, but then again - what do I know? :)

Thom
thoberre
 
Posts: 12
Joined: Wed Jan 20, 2010 7:41 pm

Postby thoberre » Fri Jan 22, 2010 11:37 pm

New "bugreport" :) Could my server output this due to php.ini settings?

When adding lamp i get this:

Notice: Array to string conversion in ...htdocs/tellit/index.php on line 276
Warning: Cannot modify header information - headers already sent by (output started at ...htdocs/tellit/index.php:276) in ...htdocs/tellit/index.php on line 279

Since the file is modded this should be at the add lamp part
Code: Select all
    //Add lamp
    if(isset($_GET["additem"]) && $_GET["additem"]==1){
        if(empty($_POST["dimmer"])){
            $_POST["dimmer"]=0;
        }
        else{
            $_POST["dimmer"]=1;
        }
        if(!stristr($add=validate_input($_POST,"room=Char(32),name=Char(32),device=CHAR(32),house=CHAR(1),number=int(1),dimmer=NULL"),"RROR")){
            mysql_query("INSERT INTO tellit_item(room,name,device,house,number,dimmer) VALUES('".$add["room"]."','".$add["name"]."','".$add["device"]."','".$add["house"]."','".$add["number"]."','".$add["dimmer"]."')");
        }
        header("Location: ?");
    }

thoberre
 
Posts: 12
Joined: Wed Jan 20, 2010 7:41 pm

Postby skorpion » Sat Jan 23, 2010 9:28 pm

New version out!

WHATS NEW?
Bug-fixes
New bugs ;)
tdtool compatibility
and things that I've forgot

To start with, I see a problem with the compatibility between rfcmd and tdtool. The code is just too messy. Some things might not work when using rfcmd but with tdtool and vice verse.

So what do you think of getting rid of rfcmd compatibility?
Tdtool works (should work) on OSX, LINUX and WIN and has its own memory whether lamp is on or off
If tellit will be tdtool-only, it will not be possible (for now) to add new lamps using tellit, nor editing or deleting lamps. (of course it is possible, its a question on how difficult and time-consuming it vill be.
Also, to add lamps, the user needs to add them in other ways, either from TelldusCenter or directly by editing the config-files.

Here it is:
http://skorpion.se/tellit/zip/tellit_0.1.4.zip

/Niclas

Ooopps
I forgot to tell that OSX and Linux users should add some text to sudoers.
I use this line:
_www ALL=(niclas)NOPASSWD:/dev/tellstick, /usr/local/bin/rfcmd, /usr/bin/tdtool
This means that user _www (the user that is running my webserver) on host ALL, can run the aftercoming commands as user niclas without specifying password.
If you are using OSX or Linux, you should have a line like this (username niclas should match the user that you used when you added lamps to tdtool)
$cmd_prefix="sudo -u niclas";

If you are using Win, just comment out this line:
$cmd_prefix="sudo -u niclas";
skorpion
 
Posts: 74
Joined: Wed Mar 04, 2009 10:47 pm

PreviousNext

Return to Mac OS X

Who is online

Users browsing this forum: No registered users and 2 guests