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

LaMetric values not correct #8

Closed sdecaux closed 7 years ago

sdecaux commented 7 years ago

Hello again,

I have a strange problem. Python script is OK, and gets the right values from my Netatmo station :) and seems to be able to send the data to the Push URL of the LaMetric widget. But on the LaMetric, the values are not correct :(

Here is the debug of the script DEBUG: Netatmo credentials: [('client_id', '***'), ('client_secret', '***'), ('username', '***'), ('password', '***')] DEBUG: LaMetric credentials: [('access_token', 'Ym***A=='), ('app_id', 'ba95dbadca543aaffb672f39b9847034/3')] DEBUG: Netatmo data: {u'Garage': {u'CO2': 452, 'rf_status': 67, u'Temperature': 19.8, 'data_type': [u'Temperature', u'CO2', u'Humidity'], 'When': 1474202537, u'temp_trend': u'stable', u'Humidity': 69, u'date_min_temp': 1474183262, u'date_max_temp': 1474202537, u'min_temp': 19, 'battery_vp': 5578, 'type': u'NAModule4', 'id': u'03:00:00:01:59:96', u'max_temp': 19.8}, u'Pluvio': {u'sum_rain_24': 0.101, 'rf_status': 63, 'data_type': [u'Rain'], 'type': u'NAModule3', 'When': 1474202569, u'Rain': 0, 'battery_vp': 5170, u'sum_rain_1': 0, 'id': u'05:00:00:00:2d:00'}, u'Int\xe9rieur': {u'Noise': 48, 'type': u'NAMain', u'Temperature': 20.9, 'data_type': [u'Temperature', u'CO2', u'Humidity', u'Noise', u'Pressure'], 'When': 1474202580, u'temp_trend': u'down', u'Humidity': 71, u'Pressure': 1021, u'CO2': 751, u'date_max_temp': 1474149852, u'AbsolutePressure': 1001.8, u'pressure_trend': u'stable', u'min_temp': 20.5, u'date_min_temp': 1474183001, 'wifi_status': 5, 'id': u'70:ee:50:00:50:bc', u'max_temp': 21.5}, u'Exterieur': {u'date_min_temp': 1474172715, 'rf_status': 71, u'Temperature': 16.7, 'data_type': [u'Temperature', u'Humidity'], 'When': 1474202549, u'temp_trend': u'stable', u'Humidity': 100, u'date_max_temp': 1474202549, u'min_temp': 13, 'battery_vp': 5233, 'type': u'NAModule1', 'id': u'02:00:00:00:3e:3e', u'max_temp': 16.7}} INFO: Station coordinates are latitude: 48.761848, longitude: 2.057204 INFO: Local TZ is CEST. The offset to GMT is 2 hour(s) INFO: Sunrise is 07:33 and Sunset at 19:57 WARNING: Other: Garage [03:00:00:01:59:96] NAModule4 with features: Temperature, CO2, Humidity WARNING: Other: Pluvio [05:00:00:00:2d:00] NAModule3 with features: Rain INFO: Station: Intérieur [70:ee:50:00:50:bc] NAMain with features: Temperature, CO2, Humidity, Noise, Pressure INFO: Module: Exterieur [02:00:00:00:3e:3e] NAModule1 with features: Temperature, Humidity DEBUG: Outdoor metrics: {'trend': 'stable', 'pressure': '1021mb', 'temperature': '16.7\xc2\xb0C', 'humidity': '100%'}

My Lametric displays sunrise 6h52, sunset 20h04, temperature 24.1 °C, 49% humidity !

On LaMetric developer site, the widget is listed as "published v3" with dataformat { "frames": [ { "text": "Name", "icon": null, "index": 0 }, { "index": 1, "chartData": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ] }, { "text": "Name", "icon": null, "index": 2 }, { "text": "Name", "icon": "i205", "index": 3 }, { "text": "Name", "icon": null, "index": 4 }, { "text": "Name", "icon": null, "index": 5 } ] }

Any idea?

baracudaz commented 7 years ago

Hi @sdecaux,

Sorry to hear that you are having issues. Actually I have no clue what might be wrong. However can you double-check the your app credentials directly on LaMetric site https://developer.lametric.com

The Push URL of the Netatmo app app_id = somehash/6 is currently on version 6. You might want to redeploy the app and check the credentials.

Update 1: The LaMetric app now show sunrise and sunset times a therefore it has six frames. The old one had only four. You need to update your app to have sex frame instead of four.

Update 2: Ahhh, I had to reread your message again. You have had six frames already. The log output looks also fine. No idea why the values on your LaMetric display are completely off. Try to recreate the app and put new credentials into config.ini.

baracudaz commented 7 years ago

@sdecaux did you have any success?

sdecaux commented 7 years ago

Still not...

I have created a new LaMetric app. Published as version 1. My LaMetric now displays sunrise=7h20, sunset=19h22, temperature=17.8, humidity=70%, pressure=1024.7. These are not my values! Could it be yours?

Here is the log: DEBUG: Netatmo credentials: [('client_id', '**'), ('client_secret', '***'), ('username', '***'), ('password', '***')] DEBUG: LaMetric credentials: [('access_token', 'YmM4M2***UyZA=='), ('app_id', 'd05f***93f/1')] DEBUG: Netatmo data: {u'Garage': {u'CO2': 455, 'rf_status': 67, u'Temperature': 20.5, 'data_type': [u'Temperature', u'CO2', u'Humidity'], 'When': 1474746640, u'temp_trend': u'stable', u'Humidity': 59, u'date_min_temp': 1474702606, u'date_max_temp': 1474731569, u'min_temp': 18.7, 'battery_vp': 5548, 'type': u'NAModule4', 'id': u'03:00:00:01:59:96', u'max_temp': 21.1}, u'Pluvio': {u'sum_rain_24': 0, 'rf_status': 61, 'data_type': [u'Rain'], 'type': u'NAModule3', 'When': 1474746647, u'Rain': 0, 'battery_vp': 5162, u'sum_rain_1': 0, 'id': u'05:00:00:00:2d:00'}, u'Int\xe9rieur': {u'Noise': 41, 'type': u'NAMain', u'Temperature': 21.5, 'data_type': [u'Temperature', u'CO2', u'Humidity', u'Noise', u'Pressure'], 'When': 1474746650, u'temp_trend': u'down', u'Humidity': 57, u'Pressure': 1019.9, u'CO2': 818, u'date_max_temp': 1474743334, u'AbsolutePressure': 1000.7, u'pressure_trend': u'down', u'min_temp': 20.4, u'date_min_temp': 1474697813, 'wifi_status': 3, 'id': u'70:ee:50:00:50:bc', u'max_temp': 22.2}, u'Exterieur': {u'date_min_temp': 1474692367, 'rf_status': 67, u'Temperature': 16, 'data_type': [u'Temperature', u'Humidity'], 'When': 1474746602, u'temp_trend': u'down', u'Humidity': 74, u'date_max_temp': 1474724919, u'min_temp': 11.2, 'battery_vp': 5227, 'type': u'NAModule1', 'id': u'02:00:00:00:3e:3e', u'max_temp': 19.6}} INFO: Station coordinates are latitude: 48.761848, longitude: 2.057204 INFO: Local TZ is CEST. The offset to GMT is 2 hour(s) INFO: Sunrise is 07:41 and Sunset at 19:44 WARNING: Other: Garage [03:00:00:01:59:96] NAModule4 with features: Temperature, CO2, Humidity WARNING: Other: Pluvio [05:00:00:00:2d:00] NAModule3 with features: Rain INFO: Station: Intérieur [70:ee:50:00:50:bc] NAMain with features: Temperature, CO2, Humidity, Noise, Pressure INFO: Module: Exterieur [02:00:00:00:3e:3e] NAModule1 with features: Temperature, Humidity DEBUG: Outdoor metrics: {'trend': 'down', 'pressure': '1019.9mb', 'temperature': '16\xc2\xb0C', 'humidity': '74%'}

App ID and token are correct, as if I change it, log shows error...

sdecaux commented 7 years ago

OK, I found what was wrong. I was using your published app in the LaMetric Store, so probably your weather! I found that I had to go to LaMetric store, then select 'private' in the dropdown menu, then my Netatmo app...

baracudaz commented 7 years ago

LOL! I hope you enjoyed Swiss weather 👍