We have moved at community.getvera.com

Author Topic: Netatmo Weather Station plugin  (Read 235667 times)

Offline diegocastanogonzalez

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: Netatmo Weather Station plugin
« Reply #450 on: February 17, 2015, 03:32:45 am »
I instaled the versi?n 3.20141113.
I tried upgrade but Im not sure if I did ok. I dont think so. Could you tell me how I have to do to upgrade LUA.
Thank you so much

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: Netatmo Weather Station plugin
« Reply #451 on: February 17, 2015, 05:22:21 am »
Could you tell me how I have to do to upgrade LUA.

The latest Lua code version is 2015.02.01 and available here: http://forum.micasaverde.com/index.php/topic,30478.msg217401.html#msg217401

Download the file, then upload to Vera using the Upload link Apps > Develop Apps > Luup files page.  By default (in UI7) this will restart and use the new code.  The authorization failure (assuming you have the right credentials entered) is a bug in UI7 which the above patch fixes.

3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline diegocastanogonzalez

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: Netatmo Weather Station plugin
« Reply #452 on: February 19, 2015, 07:28:41 am »
I did it everything. And I think in the correct form. But I have the same message.
I have the message Netatmo cant detect device.
When I install the app. I have a error, but I dont know why.
Any Idea.
Thank you.

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: Netatmo Weather Station plugin
« Reply #453 on: February 19, 2015, 07:55:54 am »
I have the message Netatmo cant detect device.
This is a UI7-releated problem, which I thought was fixed in an earlier version. 
  • What firmware version are you running?
  • What hardware?
Quote
When I install the app. I have a error, but I dont know why.
Again, this type of thing should be fixed in the latest code you downloaded. 
  • Can you confirm what version of the Netatmo.lua code you really have installed?
  • Are you absolutely sure you have your login credentials correct (for example, are ClientID and ClientSecret the right way round?)
I think this is working for others, so there must be something odd about your configuration.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline reneboer

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1574
  • Karma: +110/-31
Re: Netatmo Weather Station plugin
« Reply #454 on: February 19, 2015, 10:11:31 am »
Hi Akbooer,

FYI. the latest UI7 release has no fixes for the possible <br> issue, but you capture that, nor for the issue with having special HTML characters in your Variables inputs. I.e. Username and password should all be plain text and numbers and not have anything listed here http://www.utexas.edu/learn/html/spchar.html. A possible code improvement could be to test for an ampersand in the UID or PWD as that will mean trouble.

Maybe on UI7 we should no longer rely on the user entering data in the Variables directly, although that is quite an impact for many plugins :o.

Cheers Rene
« Last Edit: February 19, 2015, 10:14:16 am by reneboer »
2xVeraLite, VeraEdge, openLuup, ALTUI, 20 switches, 10 dimmers, 20 sensors, 10 scene controllers, 1 Harmony Hub, many plug-ins. Not enough time.

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: Netatmo Weather Station plugin
« Reply #455 on: February 19, 2015, 10:33:18 am »
FYI. the latest UI7 release has no fixes for the possible <br> issue, but you capture that,
You're right, I have that covered.

Quote
nor for the issue with having special HTML characters in your Variables inputs. I.e. Username and password should all be plain text and numbers and not have anything listed here http://www.utexas.edu/learn/html/spchar.html.  A possible code improvement could be to test for an ampersand in the UID or PWD as that will mean trouble.
Thanks for pointing that out (and Karma) I will fix that.

Quote
Maybe on UI7 we should no longer rely on the user entering data in the Variables directly, although that is quite an impact for many plugins :o.
Any suggestions as to what an alternative might be?  I'd rather not have to write some initialisation code which went through its own web page, although, in fact, that wouldn't be difficult.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline reneboer

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1574
  • Karma: +110/-31
Re: Netatmo Weather Station plugin
« Reply #456 on: February 19, 2015, 10:58:58 am »
Quote
Maybe on UI7 we should no longer rely on the user entering data in the Variables directly, although that is quite an impact for many plugins :o.
Any suggestions as to what an alternative might be?  I'd rather not have to write some initialisation code which went through its own web page, although, in fact, that wouldn't be difficult.
By having a separate Settings tab that is used for user input. That would mean more JSON, or even JS if you need to capture non-trivial data, indeed. It also requires even more testing and assuring it will all work on UI5/6/7. I have done it for the Harmony Control plugin mainly because I wanted to learn, but it can add hours to a project for sure (it did for me).

Cheers Rene
2xVeraLite, VeraEdge, openLuup, ALTUI, 20 switches, 10 dimmers, 20 sensors, 10 scene controllers, 1 Harmony Hub, many plug-ins. Not enough time.

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: Netatmo Weather Station plugin
« Reply #457 on: February 19, 2015, 12:07:25 pm »
That would mean more JSON, or even JS if you need to capture non-trivial data, indeed. It also requires even more testing and assuring it will all work on UI5/6/7. I have done it for the Harmony Control plugin mainly because I wanted to learn, but it can add hours to a project for sure (it did for me).

Yes, I was afraid of that.  I'm not into JS at all, and loathe to do anything that makes the Vera UI harder to maintain.  I've long held that it is just a configuration interface not an adequate mode of interaction for general users.  To that end, in all my UI7 app updates, I'm stripping most of the UI-related functionality in terms of custom displays.  However, for Netatmo, I'd still like to get the dynamic icons working, and for me, on UI7 / Edge, at the moment, they don't.

Configuration is something which is done so rarely that it is hardly worth going to great lengths to finesse.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline reneboer

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1574
  • Karma: +110/-31
Re: Netatmo Weather Station plugin
« Reply #458 on: February 20, 2015, 04:55:15 am »
Hi Akbooer,

The UI is not where the smarts is (or should be) so indeed not much honor in that. As I said I took it as a learning experience as it was my first serious plugin and you are way, way past that point  ;)

With dynamic icons you mean your 20,50,75,100% ? I do see that for the main device and CO2. Or do you mean something else?

Cheers Rene
2xVeraLite, VeraEdge, openLuup, ALTUI, 20 switches, 10 dimmers, 20 sensors, 10 scene controllers, 1 Harmony Hub, many plug-ins. Not enough time.

Offline mvzut

  • Sr. Newbie
  • *
  • Posts: 32
  • Karma: +1/-4
Re: Netatmo Weather Station plugin
« Reply #459 on: February 20, 2015, 05:35:03 am »
Thanks for this great plugin!

I had a lot of trouble getting it to work though (I'm using a Vera Lite with UI7). Tried several times re-installing, uploading the newest version of the lua file, creating a new client ID & secret, but no success: it could not "find" the device no matter how I tried. I noticed that the user name (which is an email address) was given a blue color by Internet Explorer after leaving the field: did IE somehow recognize it as an email address and turn it into a hyperlink? In my last attempt, I re-installed and reconfigured everything in Chrome, and it worked! Maybe others can benefit from this experience.

One minor question: I am using Imperihome, and since it has its own Netatmo support I have added my system without going through Vera. Nevertheless, most sensors also show up in Imperihome as Vera sensors, thanks to your plugin. There is one sensor though that doesn't show up in this way, and that is the rain sensor. It's not a huge thing for me, but would be nice if this can be addressed in the future...
« Last Edit: February 23, 2015, 03:28:41 am by mvzut »
Vera Edge - 5 x Zwave module (switch/door/water/siren) - RFXtrx interface - ~30 KAKU modules (switch/PIR/smoke) - Netatmo - 6 x Philips Hue - P1 Smart Meter - Opentherm Gateway - Logitech Harmony Hub - 2 x Foscam R2 - 2 x Hikvision DS-2CD2132F-I - Imperihome

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: Netatmo Weather Station plugin
« Reply #460 on: February 20, 2015, 06:02:26 am »
As I said I took it as a learning experience as it was my first serious plugin and you are way, way past that point  ;)
No actually, speaking for myself, I don't think I am very much further on... grappling with a problem at the moment that can't possibly be happening, but is.  Or perhaps it isn't and it's something else going wrong.  You sail along quite happily for weeks and then something takes you back to square one.  The learning experience doesn't stop.

Quote
With dynamic icons you mean your 20,50,75,100% ? I do see that for the main device and CO2. Or do you mean something else?
That's exactly what I mean - it's simply not working for me.  I just get a broken icon symbol for precisely those devices (on Edge/UI7.)  I saw on a posted image that it does work, but for me, no.  I must have screwed up the placement... the documentation (http://wiki.micasaverde.com/index.php/Luup_plugin_icons) states:
  • "/www/cmh/skins/default/img/devices/device_states/" for the default icon, and
  • "skins/default/img/devices/device_sates/" for state_icons (obviously a typo?)
Anyway, it doesn't work for me!  I'd also like to get he measurement and units on the same line as the icon, like the temperature devices do, but I can't achieve that either.  I HATE JSON FILES!  >:(

3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline reneboer

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1574
  • Karma: +110/-31
Re: Netatmo Weather Station plugin
« Reply #461 on: February 20, 2015, 08:22:06 am »
Hi akbooer,

The learning on Vera does not seem to stop indeed and as each UI7 release seems to change how the JSON positioning's are handled does not help either. You can try negative top and left values to make your plugin look a bit like a standard one, but it sure is a pain.

For the icons I now use something like Richards technique he uses for PLEG etc. In the app market set the normal UI5 path /www/cmh/skins/default/icons/ and with manual put the icon files in that. Then add an install.sh script that is not compressed like images and is run at startup to make links to the right locations. I have this in mine:
Code: [Select]
-- Make sure icons are accessible when they should be. Thanks to RichardTSchafer
os.execute("/bin/sh /etc/cmh-ludl/harmony-install.sh")
os.remove("/etc/cmh-ludl/harmony-install.sh")
os.execute("touch /etc/cmh-ludl/harmony-install.sh")
And this is the script file. Also shows the paths to use.
Code: [Select]
if [[ -e /www/cmh_ui6 ]]; then
  cd /www/cmh_ui6/skins/default/icons/
  rm -f Harmony*.png
  ln -s /www/cmh/skins/default/icons/Harmony.png
  ln -s /www/cmh/skins/default/icons/Harmony_0.png
  ln -s /www/cmh/skins/default/icons/Harmony_25.png
  ln -s /www/cmh/skins/default/icons/Harmony_50.png
  ln -s /www/cmh/skins/default/icons/Harmony_75.png
  ln -s /www/cmh/skins/default/icons/Harmony_100.png
fi
if [[ -e /www/cmh/skins/default/img/devices/device_states ]]; then
  cd /www/cmh/skins/default/img/devices/device_states
  rm -f Harmony*.png
  ln -s /www/cmh/skins/default/icons/Harmony.png
  ln -s /www/cmh/skins/default/icons/Harmony_0.png
  ln -s /www/cmh/skins/default/icons/Harmony_25.png
  ln -s /www/cmh/skins/default/icons/Harmony_50.png
  ln -s /www/cmh/skins/default/icons/Harmony_75.png
  ln -s /www/cmh/skins/default/icons/Harmony_100.png
fi
You can all this just from LUA so you are not dependent on an extra install file, especially for manual installs. But for me this is working now.

Cheers Rene.
2xVeraLite, VeraEdge, openLuup, ALTUI, 20 switches, 10 dimmers, 20 sensors, 10 scene controllers, 1 Harmony Hub, many plug-ins. Not enough time.

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +292/-70
  • "Less is more"
Re: Netatmo Weather Station plugin
« Reply #462 on: February 20, 2015, 08:26:56 am »
@reneboer

That looks like a great suggestion, I'll try something along those lines.

Many thanks, once again!
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline reneboer

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1574
  • Karma: +110/-31
Re: Netatmo Weather Station plugin
« Reply #463 on: February 20, 2015, 11:47:03 am »
Since the previous UI7 version the JSON positioning of variables changed. If you want to position 3 bits of text, your scenegroup x must be 3 as well.

Code: [Select]
"SceneGroup":[
{
"id": "1",
"top": "1.5",
"left": "0.25",
"x": "3",
"y": "1"
}
Then you put your controls on top,left 0,0 0,1 and 0,2 you get it to show as below in UI7. Sadly on UI5 things sure are not looking better as the (mm) text drops off this way  :(

Cheers Rene
2xVeraLite, VeraEdge, openLuup, ALTUI, 20 switches, 10 dimmers, 20 sensors, 10 scene controllers, 1 Harmony Hub, many plug-ins. Not enough time.

Offline reneboer

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1574
  • Karma: +110/-31
Re: Netatmo Weather Station plugin
« Reply #464 on: February 20, 2015, 12:14:10 pm »
...and if you want it to look like this the scenegroup x is set to 12 (not 11 or goes wrong on small devices screens).
The Rain text not in the ControlGroup
The left for CurrentLevel at 9 and top at -2.8 (!)
The left for (mm) at 10 and top at -2.8 too.
The total height of the device is not changing on the screen so not saving any white space.

Ain't this jolly  ::)

Cheers Rene
« Last Edit: February 20, 2015, 12:19:34 pm by reneboer »
2xVeraLite, VeraEdge, openLuup, ALTUI, 20 switches, 10 dimmers, 20 sensors, 10 scene controllers, 1 Harmony Hub, many plug-ins. Not enough time.