For those of you that enjoy writing your own applications or integrate with Automagically I have now published the API that is used internally as well. It is documented here. Coments and suggestions are very welcome.

I am also looking into the API of Telldus Live to see if I can integrate towards that. It looks promising. So hopefully soon you will be able to use all Apps made for Telldus live togheter with Automagically (thru the Telldus live server). It will also benefit from their security work so that 

Peter
9/1/2013 03:05:42 am

Hi again David,
Thanks for keeping the updates and added functionality coming on this project. It's becoming a nice addition here at home :)

One thing that I had quite an issue with in my setup was memory - I ran out of it, since I have the old B-version with only 256MB RAM and I'm also running a crashplan server on the same server. I know, it's tight and I've already ordered a couple more RPis to help me separate the functionality again.

Still, I found that it's possible to tweak MySql a lot, in a fairly easy way as well. It seems that you're using MyISAM files for your database, so there's no need to have the InnoDB module enabled in MySql. Sadly it's enabled by default since version 5.1.

Here are the two lines needed to be added to my.cnf to disable InnoDB.

default-storage-engine = myisam
skip-innodb

The first line changes the default from InnoDB to myisam and the second line simply disables the module.

Doing this I was able to have mysqld shrink from about 340M to roughly 50M allocated memory and all of a sudden I have a system that's quite a lot more responsive.

Thanks again for the nice work, and good luck with the new features - I'm back to making some schedules for lamps etc using crontab and some simple bash scripts now :)

Cheers,
/Peter

Reply
David
9/1/2013 04:15:35 am

Hi and thank you very much for the suggestion. I will try it out and include it.

Reply
Peter
14/1/2013 05:38:03 am

David - I've noticed a problem with the change I suggested :(

I can't seem to access my custom remote page, nor the 'change/edit' pages within the admin areas. Not sure if you're actually using any of the tables as in-memory, to save memory or so...

Haven't dug into that to figure out what's going on...

Removing my changes made the remotes and admin part work fully again...

Reply
David
14/1/2013 01:26:17 pm

That is about the same experience I got with your change. Some of tables seems to have been created with InnoDB and when those are accessed errors occur. I have manually removed all constraints in the tables and change storage engine but I haven't figured out how to send that as an update to installed systems.

Reply
Fredrik
19/1/2013 02:58:46 am

Hi,

Is it possible to use the API to get only one of the attribute values do a global variable as a http query. For example

URL:/rest/gv/1/

Gives me one of the variables, but how could I get for example the attribute 'value' ?

/Fredrik

Reply
David
19/1/2013 02:46:19 pm

It is currently not possible to get only one attribute value over the API, you have to parse the resulting JSON object for it.

Reply
Fredrik
19/1/2013 06:51:05 pm

Hi David,

OK, thanks. World it be possible to consider an alternative output format from these http GETs? For exemple to match the automatic feed options that COSM can handle (see e.g. http://community.cosm.com/quickstart). Their JSON format is quite similar to the one you use, but with some required fields.

/Fredrik

Fredrik
19/1/2013 07:23:27 pm

Hi David,

OK, thanks. World it be possible to consider an alternative output format from these http GETs? For exemple to match the automatic feed options that COSM can handle (see e.g. http://community.cosm.com/quickstart). Their JSON format is quite similar to the one you use, but with some required fields.

/Fredrik

David
20/1/2013 05:28:37 pm

Fredril regarding Cosm. Do you have Amy suggestion on what Value to use for datastream? Should that be one uniq for the system, or describe the actual variable. Haven't figured out exactly how cosm works in terms of multiple sensor values from one location. Making an additional output format to match cosm is a piece of cake.

Reply
Fredrik
20/1/2013 11:35:17 pm

Hi David,

COSM has feeds and data streams, and the idea is that a feed corresponds to a location or device (potentially mobile), while data streams models the different sensors at that location or in that device. Therefore, it can be relevant to have some flexibility in Automagically. For example, two temperature/humidity sensor device connected to Tellstick can be one feed with four data streams, or two feeds (one for each temp/hum device), with each one temp and one hum data stream.

In case of automatic feeds, COSM fetches the data via http GET for each feed, and the different data streams can have data points via XML, CSV or JSON.

In brief, I guess it can be valuable if you can configure feeds and data streams with some freedom. One start could be to be able to define feeds and data streams that COSM can fetch via http GET. In the case of uploads, it can also be good to be able to configure a reporting period, maybe also with the possibility to report in bulk.

B.R.

/Fredrik

Reply
Fredrik
21/1/2013 03:26:05 am

Hi again,

Came to think about one thing. One interesting feature could be to forward events and commands to data streams to COSM as well. Thereby, one can monitor for example whenever a door has been opened if using a magnetic contact, or when the heater has been turned on and off over time, or ...

I noticed that one can have private and public feeds, and it could be nice to have one feed with things you want public, like temperature, and thing you want to keep private, like events etc.

Just some ideas ...

/Fredrik

Reply
Fredrik
7/2/2013 12:42:55 am

Do you think it would be a good idea to start a COSM discussion here at the blog? Maybe more people have ideas, but now this discussion s hidden under the API blog post.

/Fredrik

Reply
andreas
27/1/2013 09:02:36 pm

Hey David!

This might be asking for too much, but if it's not to hard, it would be awesome if support is added to automagically for the RemoteStick Lite android application? ie, extend you API to simulate the RemoteStick Server ;)
The API for the RemoteStick server can be found here:
https://github.com/pakerfeldt/remotestick-server/wiki/REST-API

I'm not a pythonian, but I'll try to get hacking myself when I get the time ;)

The remotes in automagically are cool, but they're a little sluggish to load if you want to turn things on/off quickly with the phone (it's another thing if it's loaded and running on a tablet or similiar).

Reply
Jens
9/2/2014 10:41:51 pm

Hi David,

I have a problem posting to the API, should it be a JSON or string I send? I try to send the string 'type=command&commandid=101&deviceid=78' but absolutely nothing happens.

Also it would be great with a way to see all received/sent commands through the API, for integration with e.g. Fibaro HC2.

Cheers,
Jens

Reply



Leave a Reply.