baracudaz / netatmo-lametric-proxy

A simple client which turns LaMetric into Netamo display. This client calls Netatmo API and updates LaMetric display.
15 stars 6 forks source link

URL to get data from*: #9

Closed Mapantz closed 7 years ago

Mapantz commented 8 years ago

Hi This is my first time setting something up like this. I have read the helpfile, and got so far with it, but, I haven't found it, well... helpful.

In the section: URL to get data from*:

What URL are we talking about?

Scrap that, I forgot to change it to 'push'

The next bit though, where do i find the app_id? I can't see that anywhere,

I'm sorry, but your helpfile is the most unhelpful thing I've ever seen!

I'm running the cronjob from my own server, and all it does is download the updateLaMetric.py..

baracudaz commented 8 years ago

Hi @Mapantz,

Thanks for the feedback! I am open to suggestions, so you are free to improve description. That would be actually much appreciated.

The app_id is the last bit after .com.lametric in Push URL: https://developer.lametric.com/api/v1/dev/widget/update/com.lametric.abc123xyz/6

So in this case the app_id config.ini should be app_id = abc123xyz/6

Let me know how you are getting on.

baracudaz commented 8 years ago

BTW, I just notice both LaMetric and Netatmo redesigned their developer websites. Now they both look a lot different comparing to how they did in past when I created this little project.

Just updated the README.md hopefully to make things a tiny bit clearer.

Mapantz commented 8 years ago

Hi I'm still unable to get this to work, even though I have followed everything to the letter. If I put the Local Push URL in to my browser, am i supposed to see Netatmo data returned? All I get is: { "errors" : [ { "message" : "Wrong api key" } ] }

Which I don't understand, as everything is correct. The Netatmo client id and secret are 100% correct, as is the LaMetric access token and app_id. I just cannot get anything to show within the LaMetric app I created and installed. :|

baracudaz commented 8 years ago

Hi @Mapantz,

Let's not confuse things. Pasting URL to web browser is a GET query and it doesn't send your credentials, hence the error. There is more to it.

Anyway the LaMetric library is meant to be used with app_id from Push URL. The Local Push was not available back when it has been written. Having said that it should be pretty straightforward to modify it to use the local access as well.

For the time being use the app_id from Push URL.

Mapantz commented 8 years ago

I'm completely at odds with it all. I have tested my connection to the LaMetric via postman, and all is working. I have set all the parameters in the config file, but nothing works.

Is this the correct command for the cronjob?

python /home/*****/public_html/lametric/updateLaMetric.py >>/tmp/out.txt 2>&1

baracudaz commented 7 years ago

@Mapantz, did you make any progress on your issue?

Mapantz commented 7 years ago

I'm afraid not. I set it all up to the letter, but it still won't work. I'm not even sure the cronjob is calling the file correctly? At the moment, all I have is, an expensive clock sat on the side. Very disappointed.

baracudaz commented 7 years ago

The cronjob the task on Linux should be OK with following syntax: /10 * * * \ python /updateLaMetric.py

However if the script update does not work when executed from CLI then it won't work from Cron either.

Have you tried to play with the sample push request with cURL? Did you have any luck there? The example is available with your App on LaMetric https://developer.lametric.com?