Netatmo on UI7

I’ve never seen that message before, and I’ve tested it on UI5 and UI7. I am perplexed.

[ul][li]The code you’ve pasted looks OK in the window of the Luup Lua test web page?[/li]
[li]This happens when you press the GO button?[/li]
[li]you did clear the old text in the window?[/li][/ul]

Can you try again from scratch (perhaps you already did?)

The file was created
ClientID = 5480c0361977591b5daec585

ClientSecret = JxLR4fU4BK0d90cDyR18dzyqtKUsN6V39S2V53bq

Username = tdavXXXXX@gmail.com
Password = irXXXXXX5

Our previous two messages crossed.

BINGO!

Three of the fields have the errant
inserted.

I have obfuscated your post with that sensitive data - you may care to choose and different password, etc.

I will shortly post a code to clean this out.

[Edit: you beat me to it!!]

OK, here’s the code to “clean” those fields.

[ol][li]Run it again as before[/li]
[li]Check that the fields are correct[/li]
[li]Restart the Luup engine[/li][/ol]

-- Netatmo diagnostic and repair code
-- 2015.01.31 @akbooer 
local NetatmoDEV = "urn:akbooer-com:device:Netatmo:1"
local NetatmoSID = "urn:akbooer-com:serviceId:Netatmo1"
local f = io.open ("/www/netatmodiagnostics.txt", "w")
if f then
  for dev,i in pairs (luup.devices) do
    if (i.device_type or '') == NetatmoDEV then
      for _,var in pairs {"ClientID", "ClientSecret", "Username", "Password"} do
        local x = luup.variable_get (NetatmoSID, var, dev) or ''
        x = x: gsub ("<br>", '')
        luup.variable_set (NetatmoSID, var, x, dev)
        local y = table.concat {var, ' = ', x or '?'}
        print (y)
        f: write (y..'\n')
      end
    end
  end
  f:close ()
end
return true

NOW what happens??

I do not know how to thank you enough. All is perfect now. I learned a lot during the process as well. How can I clobber that diagnostics file that was created on that web page? Thank you agin many times over.

Excellent news!

Are you able to [tt]ssh[/tt] in to Vera? If so, you’ll find it at [tt]/www/[/tt]. If not, I’ll send you some more code in the morning!

A good way to end the day, I’ll put up a sticky topic on this tomorrow too.

This one-liner pasted into the Luup Lua test window, and run with the GO button, will remove the file.

os.execute "rm /www/netatmodiagnostics.txt"

You’ll see I’ve put up a sticky, locked, thread to hold the current code version.

The latest version (2015.02.01) should solve all cases of “Authorization Error” (except for when your credentials are not entered correctly!) Please let me know if you find this problem cropping up again (or anything else for that matter.) There’s no need now to resort to yesterday’s solution of a specific piece of code to run in the test window.

Hi all,

Question. Are you using Firefox or IE? Reason I ask is that Firefox is showing empty Variable inputs with a height of zero, where IE is showing them normally (that’s a change isn’t it ;))

Looking at the Vera code they did change the type of the Variable input fields to just a div and not input in the latest release. Beats me why, but it sure is not working well as we can see.

Cheers Rene

Yes, it’s just a line in Firefox, but if you position the cursor right you can still use it.

Not just a Netatmo issue, then!

Hi akbooer,

No, not Netatmo specific but as you are asking for user credentials it pesters you big time.

I just installed it on my VeraEdge and I got you latest code. Guess what, still authorization failed error. I looked with InfoViewer and all variables are exactly identical to my VeraLite with UI7. No go. So I added some more logging and guess what… On the VeraEdge you should not have greater > or less < than in your password!! I thought I was loosing it.

On the VeraLite it is not an issue with UI5,6, or 7 but it is on the Edge. Sigh.

The Lite and Edge version are sure not the same.

But, it is working now :slight_smile:

Cheers Rene

Yes! That’s great.
Thanks for the feedback, and password warning.

And thank you to all who helped. I put the netatmo values to great use in both of my residences. Great job.

Excuse me if i’m not in the right place but i vould notice you a bug when you use the netatmo device…

And my english is not very high …alors je continue en francais :

Si on ne rempli pas le champ room dans le device netatmo il y a une erreur …une barre rouge s’affcihe au dessu du pluggin netatmo et c’est ecrit qu’il ne peut pas atteindre le device…

Il suffit juste de remplir le champ room du device netatmo et de relance l’engine et le defaut disparait…

Ma conig :veralite ui7…et quelques devices fil pilotes fibaro et une netatmo…

Bonne soir

[quote=“philoup, post:74, topic:185616”]…then I continue in French :

If we do not have the [tt]room[/tt] field filled in the Netatmo device there is an error … a red bar appears below the Netatmo plugin and it is says that it cannot reach the device …

You just have to fill out the Netatmo device [tt]room[/tt] field, restart the engine and the fault disappears …

My config : Veralite Ui7 … and some wireless devices and Fibaro drivers and one Netatmo …[/quote]

Merci beaucoup pour avoir signalee cette erreur. Je vais voir ce que je peux faire, au moins vous avez une facon de le fixer pour le moment!

Thank you very much for reporting this error. I will see what I can do, at least you have a way of fixing it at the moment!

Question on installing the latest version. This is a total n00b question, but how can I install the .lua file? I assume SCP it to the Vera, ssh in and run it somehow?

There should be the possibility to upload Luup Files from the Vera web-interface.

Unfortunately I don’t have UI7 so that I can tell you exactly where to look.

On UI5 it is at Apps → Develoup Apps → Luup files

@korttoma is quite right, you simply do this from the Vera UI: Apps > Develop apps > Luup files then select the Upload button or even (and here’s a new UI7 feature) drag and drop to the upload area. By default (again, a UI7 change) the “Restart Luup after upload” box is already checked, so a restart will happen automatically and the plugin will come up using the latest .lua file.

[quote=“akbooer, post:68, topic:185616”]You’ll see I’ve put up a sticky, locked, thread to hold the current code version.

The latest version (2015.02.01) should solve all cases of “Authorization Error” (except for when your credentials are not entered correctly!) Please let me know if you find this problem cropping up again (or anything else for that matter.) There’s no need now to resort to yesterday’s solution of a specific piece of code to run in the test window.[/quote]

I read everything, thanks akbooer.
I have to ask you a favor because I still can not seem to find the latest version (01.02.2015) of L_Netatmo.lua
As you can see in the attachment I still have 2015.01.28 version and it still appears “Authorisation failed”.
Thanks

If you download the attachment on this thread: [url=http://forum.micasaverde.com/index.php/topic,30478.0.html]http://forum.micasaverde.com/index.php/topic,30478.0.html[/url]

…and then upload to Vera using the Apps > Develop apps > Luup files > Upload button, then it should install that version.

Ask again if you still have problems (and welcome to the board!)