Closed genfersee closed 3 years ago
I finally reworked my code, now working!
The issue I see now is that the weather data I get from the home set in lnetatmo.WeatherStationData is in fact the weather data from my other home set in my account!
authorization = lnetatmo.ClientAuth(clientId = "xxx", clientSecret = "xxx", username = "xxx", password = "xxx") weatherData = lnetatmo.WeatherStationData(authorization,unicode('Home A','utf-8')) theWeatherData = weatherData.lastData() externalTemperature = round(theWeatherData[unicode('Extérieur','utf-8')]['Temperature'],1)
gives me the external temperature of Home B...
Thanks for reporting this issue. There was an error in default station selection for multi-home setup.
I just published the fix, if your confirm that the bug is fixed, please close the issue...
Many thanks, I will test the fix and tell you!
I am also trying to make the checkNotUpdated to work.
for m in weatherData.checkNotUpdated(1800): print("Warning, sensor %s information is obsolete" % m) if moduleByName(m) == None : print("The station is lost")
Since I only have 1 module, I simplified with: if weatherData.checkNotUpdated(1800) == None print("Module is lost")
But I always get None, even if some fresh data were published... What am I doing wrong?
Thanks in advance!
The response is the list of "not updated modules". If your data is fresh, it is the expected response to have "none" as a response. If one of your module was out of power for example, the corresponding data would not be fresh and it's name would be returned...
By the way, there was an obsolete station_name parameter that I am going to clean
Many thanks!! And I have a last question:
Calling this is working: weatherData = lnetatmo.WeatherStationData(authorization,unicode('Home A','utf-8'))
But if I add the station name like this: weatherData = lnetatmo.WeatherStationData(authorization,unicode('Home A','utf-8'),unicode('Appart','utf-8')) It says:
Traceback (most recent call last):
File "netamo.py", line 51, in
Whereas my station main module is indeed named "Appart". Station name is main module name correct?
How can I try your fix? I tried to enforce the resintall of 2.0.0 but the latest commits are not included. Should I wait for release 2.1.0?
Hi @philippelt , I applied your commits yesterday and it works: I now get the weather data from Home A instead of Home B. Many thanks!
Hello! I have an issue after updating to 2.0.0.
I updated my code with the following, because I have 2 homes linked to my Netatmo account, and 1 station in each home :
Then, it gives me the following result:
Traceback (most recent call last): File "netamo.py", line 52, in
main()
File "netamo.py", line 46, in main
currentTemperature,currentHumidity,currentPressure = getCurrentWeatherData()
File "netamo.py", line 26, in getCurrentWeatherData
externalTemperature = round(devList.lastData('Home A')['Exterieur']['Temperature'],1)
File "/home/pi/.local/lib/python2.7/site-packages/lnetatmo.py", line 374, in lastData
limit = (time.time() - exclude) if exclude else 0
TypeError: unsupported operand type(s) for -: 'float' and 'str'
Did I miss something? Thanks for your help!