Start a new topic
Implemented

Direct send json to the metric

Hello

During kickstarter question its told that its possible to directly send data to the lametric via internal ip address.

So NOT via IFTTT but directly, lots of people have own steering and dont want to go in the cloud.

Please tell how this is possible


regards & thanks


ps: via mail i asked this question already and not getting the right answer :-(

just referring to IFTTT is not the answer.




8 people like this idea

having problems with the direct local json sending. The problem is that a value is send via frame to the lametric, the Http server gives me a 200, so it looks like all went well, Problem is that the value often not is being updated?. For example I send the temperature of the thermostat to the lametric and its not being updated all the time. I have tested this many time with same result. Sometimes its updating Ok but sometimes its not?

a very strange situation, if you send the value multiple times it works, it think its a small bug!


Please help?

Pieter

So I'm trying this right now and I realize this is not what everyone was hoping for, at least not me, but let me explain...

While it's a step in the right direction, from not being able to push anything at all, I think that being stuck with only 4 types of metric screens is very restrictive, especially with the dev account custom requirements that Alex so kindly described, but that will be a barrier to entree for most...

While I applaud LaMetric's effort to improve their awesome device, I think It'd be a lot more valuable and useful to be able to have a generic app that everyone can install and set a token or password from the app, if need be, and to which you could push a complete "free" frame. you'd get to define the pixels as a matrix, just like a screen. With that you could create animations, other types of data representation, fonts, etc. and simply make the LaMatric a much more powerful display device by setting this as the only app. So, you'd have a choice to use the simpler limited set OR use this app as a limitless display.

Why would we limit the output and make it so difficult instead of simply creating that one single app that can accept all the possible screen that everyone can think about, without having to create a developer account that is going to basically keep the current feature very niche...

With a common app like I'm describing, a whole community could share screen routines on github and integrate the LaMetric with IoT, special triggers, switches, software builds (jenkins?), etc. in a much more powerful way and rich way for the users!

Imagine simple users that do not want to code anything and without the technical know how (basically, most users), that could simply install a plugin to their desktop or server app, that would point to their LaMatric without having to go through all of this setup for a limited result...

This, I think, would make LaMetric market expand in, making it more visible, sparking a community of enthusiasts and allow it to be used anywhere for so many other use: commerce, work teams, startups everywhere, etc.

So, LaMetric has done a great job till now, but I think this final step could make them shine and please a lot more users and help them sell more by getting more functionality and visibility...

What do you all think?

Thanks!

I haven't tried this so far - I don't know how I would provide the local push url to the user who installed the app. I can see it in the developer backend. but if you install it - how would you know the exact url?

Thanks Alex, but can this app be pushed to the "app store" so we can simply install this "push it yourself" app and push to it locally?

If everyone need to create a developer account to push to their device, it's missing the point? Or am I confused? :)

thanks Alex really great!

You can find my tutorial (LaMetric local push using PHP) here:


http://blog.aruehe.io/lametric-local-push/




3 people like this

I'm writing a blog post right now, showing how to create an indicator app and how to use local push with php, will post here.

ok thanks

what can i do with index?

chart data?


do have an example or explanation for these

@Knuvers:

So far the speed of the text can only be set globally in the app (https://lametric.freshdesk.com/support/discussions/topics/6000033516/page/last#post_6000069223).


@Knuvers, A G:

The parameters you can use are the ones shown in the developer backend for your app (e.g. index, text, chart data, icon...). What exactly are you looking for? 

A small walkthrough with all the options would be great as I'm not sure I get how to "create the app" to push to ?
cheers!

 

Ok great :-)

i can confirm the local link push is working perfect!

very nice function!!


now im trying to find out what parameter i all can use in the json push

for example how can i set the speed of the text?

is there an overview of all the options we can use in the json?

cant find it on the forum...

No, this is the identifier of yor app. In this way firmware knows which app is responsible for displaying the message. Hope it helps.

2 people like this

ok i did that

why is com.lametric.xxxx still in the local link?

this looks like the local push is still going to lametric servers?


https://10.0.0.116:4343/api/v1/dev/widget/update/com.lametric.529fe44e85bedf/1


1 person likes this

Dear Knuvers,


The way it works is almost the same as if you push via cloud. First you should create "Indicator App". 


Choose communication type to be "push".

Then create UI structure and publish app privately. After that install your app to your device. Now you can push data directly to the app using URL like this: http://<lametric_ip_address>:8080/api/v1/dev/widget/update/<app_package_name>/<app_version>.

Exact local URL is available in your application details tab on developer.lametric.com.


In your particular case your URL is missing app package name in the URL. Also I want to draw your attention that ../v1/.. part should have letter 'v' in lower case.


Hope it helps.


1 person likes this

can you tell exact how to do it? what is the exact url in this sample

i have this below (the token is a fake)

getting a 404


var request = require('request');

var token = "MDQ2ZjNlY2NYjVkNjdhYzI1NGMzMzk0YTFmZjA5MA==";

var url = 'http://10.0.0.116:8080/api/V1/dev/widget/update/'

var postData = JSON.stringify({

  "frames": [

        {

            "index": 0,

            "text": "Hallo Piknwir",

            "icon": "i275"

        }

    ]

});

console.log(postData);

request({

    url: url,

    method: 'POST',

    headers: {

  'Accept': 'application/json',

  'X-Access-Token': token,

  'Cache-Control': 'no-cache'

    },

    body: postData

}, function(error, response, body){

    if(error) {

        console.log(error);

    } else {

        console.log(response.statusCode, body);

    }

});

Login or Signup to post a comment