Page 1 of 3

Telldus Live Pebble app with support for groups and sensors.

Posted: Fri Mar 17, 2023 9:45 am
by fingalo
Hello,
I have made additions to the TelldusLive Pebble app with support for groups and sensors (temperature and humidity).

You will find the source on gihub https://github.com/fingalo/TelldusPebble.git.

https://github.com/fingalo/LaTC-Remote.git

You will need Telldus live keys and preferably an account on Cloudpebble.

Import in Cloudpebble and you can build the project and download to the watch.
You will need to enter your Telldus keys on lines 63, 64 in the pebble-js-app.js source code.

Only special handling in use is, when dimming a device you need to make a long keypress on the middle button. For each long keypress the dimming will change 25%. Short keypresses will turn on / turn off devices.
g.png
g.png (42.51 KiB) Viewed 21626 times
e.png
e.png (43.74 KiB) Viewed 21626 times

Re: Telldus Live Pebble app with support for groups and sens

Posted: Fri Mar 17, 2023 9:45 am
by Michael_MMX
Hi,

Nice work, but I can't get in to the settings page,

[PHONE] pebble-app.js:?: Calling Pebble.openURL() is not supported outside of a showConfiguration event. (Passed URL: http://api.telldus.com/oauth/authorize? ... XXXremoved mytokenXXXXXXX)

If i remove the // around the show Configuration function, I'm able to login, but the app stops at authenticating action
[DEBUG] telldus-live.c:132: Got module: auth, action: authenticating

And the Pebble screen only shows "authenticating..."

Running the app from an iPhone,

Re: Telldus Live Pebble app with support for groups and sens

Posted: Fri Mar 17, 2023 9:45 am
by fingalo
Hello,
regarding IOS I have not addressed that problem.

But I made some test to get it to run on IOS by adding my Telldus keys on lines 71, 72 in pebble-js-app.js like
this.token = 'xxxxxxxxxxxxxxxxx'; Your key here
this.tokenSecret = 'xxxxxxxxxxxxxxxxxxx'; Your key here
and later also also commenting away on line 257
// dispatcher.authenticate();

Then I could run via my ipad without getting auth and inlogging screens.
New test: This is working on Android now but on IOS does not seem to work very good.
Second test: Uncomment lines 91 and 93 also, then the app works on IOS for me but still no access to the settings page.

Other:
I think my decoding of dimmers need some refactoring. I read statevalue from the devices and that may not be the correct way to do it (also a problem for groups decoding).

I am still in learning mode for the TelldusAPI!

Re: Telldus Live Pebble app with support for groups and sens

Posted: Fri Mar 17, 2023 9:45 am
by Michael_MMX
Tested you're 'hack' and that works on my iPhone.
Found an error in the code that prevents the settings screen to load, on line 85 there is one / to much
if i change it to pebblejs://close# the screen loads, but the token and tokenSecret is not stored in local storage, and therefor it cant authenticate. I have no clue how to fix it, but maybe you do.

And there seems to be a problem loading groups, only one is displayed.

Re: Telldus Live Pebble app with support for groups and sens

Posted: Fri Mar 17, 2023 9:45 am
by fingalo
Hello,
regarding loading groups I found that statevalue is sometimes null and IOS builds seem to be fussy about it(?!).
I changed code (regarding dimvalue) in function
179 dispatcher.doCall('devices/list', {supportedMethods: 1023}, function(r)
(github updated)

Regarding loading settings I am still very lost about a solution.

Re: Telldus Live Pebble app with support for groups and sens

Posted: Fri Mar 17, 2023 9:45 am
by Michael_MMX
Now it runs perfect, apart from the not storing the token and tokenSecret in the local storage.

Editing line 71 and 72
this.token = this.token;
this.tokenSecret = this.tokenSecret;

and using 68 and 69 to store the keys.

Re: Telldus Live Pebble app with support for groups and sens

Posted: Fri Mar 17, 2023 9:45 am
by zacay
thanks for sharing!

But if you have unknown device in your list the app will crash! "(no name)"
Change in function getDevices() {
if (name.length > 16) { --> if ((name) && (name.length > 16)) {
Can't check length to a empty variable :)

Re: Telldus Live Pebble app with support for groups and sens

Posted: Fri Mar 17, 2023 9:45 am
by fingalo
Thank you, I will correct that.

Just wonder, how do you get an unknown device in the list?
It is possible to get unknown sensor devices in the list but devices I have not seen?

Re: Telldus Live Pebble app with support for groups and sens

Posted: Fri Mar 17, 2023 9:45 am
by zacay
my mistake, I meant sensor list

Code: Select all

dispatcher.doCall('sensors/list', { includeValues: 1}, function(r) {
	pebbleSendQueue.send({ "module": "auth", "action": "done" });
	sensors = r.sensor;
	for(var i in sensors) {
		var name = sensors[i].name;
		if ((name) && (name.length > 16)) {
			name = name.substr(0,16);
		} 
		var temp = sensors[i].temp;
		var humidity = "";
		if(sensors[i].humidity) {
			humidity = sensors[i].humidity;
		}
		pebbleSendQueue.send({
			module: "sensor",
			action: "info",
			name: name,
			temp: temp,
			hum: humidity,
			id: parseInt(i)
		});
	}
});

Re: Telldus Live Pebble app with support for groups and sens

Posted: Fri Mar 17, 2023 9:45 am
by fingalo
Github is updated with fixes for unknown sensors, devices.
Also on the watch it is possible to expand/collapse the section with sensors. (Pressing center key to toggle).

Posted: Fri Mar 17, 2023 9:45 am
by reidar.ostrem
Do we find this pebble app in the app store or do I need to actually compile it myself?

Re: Telldus Live Pebble app with support for groups and sens

Posted: Fri Mar 17, 2023 9:45 am
by fingalo
This version you will need to compile yourself, with your own Telldus keys.
I have no official keys (from Telldus) wich I believe is needed if you publish it as a ready app on the store.

Also if you compile it yourself with keys, it will work on IOS.

Re: Telldus Live Pebble app with support for groups and sens

Posted: Fri Mar 17, 2023 9:45 am
by reidar.ostrem
fingalo wrote:This version you will need to compile yourself, with your own Telldus keys.
I have no official keys (from Telldus) wich I believe is needed if you publish it as a ready app on the store.

Also if you compile it yourself with keys, it will work on IOS.
Ok, thanks for the information. Maybe I'll give it a whirl later on.

Re: Telldus Live Pebble app with support for groups and sens

Posted: Fri Mar 17, 2023 9:45 am
by fingalo
I need to change the name of the app. See first post for github change.

Please see github if you like to test with your keys. I have now the same behaviour on Android and IOS (some auth message warning/error when installing first time, but actually working with logging in etc).

I am currently testing the app and if successful it will be published on Pebble appstore.

Re: Telldus Live Pebble app with support for groups and sens

Posted: Fri Mar 17, 2023 9:45 am
by Michael_MMX
Tested the app for a couple of days, and it works great. No auth message warnings/errors on iOS. So it seams to be resolved.
And the keys (publicKey and privateKey) seams to be the same for all users, did a search on Google with mine, and found a couple of projects with the same keys (not my own projects :D ), and even some hits on this forum (http://www.telldus.com/forum/viewtopic. ... 174#p14244)