SmartWeather - Get local weather data combined with AI powered Forecast

GitHub release

Version 0.1.2

  • Updated the Icons for the Lightning Sensors
  • Fixed Rain Rate too low
  • Bumped pysmartweatherio to V0.1.3

I am using latest release of this custom component and when I use it with Darksky, I get 1F as a temperature reading. Seems like it is converting it to C and has a F symbol. Please see attached. Is there any way to fix this?

Hi @TerroBladeZ,

I can see what you mean. I am out travelling for the next 3 days, and have no access to my system, but will find the fix when I get back.

EDIT: I have published a fix for this to Github. I have had no possibilities to test it, but it should now display the right temperature when using Imperial Units. You only have to replace weather.py.
Let me know if this works.

Yes, Works fine now. Thank you for the quick change.

1 Like

Hey briis, you might not be able to help with this but I thought I’d try.

I had to delete my Sky today from the Weatherflow app and reconnect it after it wouldn’t pair once I changed batteries on it.

Now I can’t use your component. My station ID hasn’t changed but it just won’t work. If I use someone else’s station ID, no problem, but mine, 4602, won’t play nice. Data is reporting publicly but obviously something is going on as your component won’t fetch data from my station. Perhaps someone could try and input 4602 into their configuration and see if they get the same error?

I should mention that it is also reporting without issue to Weather Underground and PWS Weather.

Just to add, this is what comes up in the logs:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 154, in _async_setup_component
    component.setup, hass, processed_config)  # type: ignore
  File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/smartweather/__init__.py", line 94, in setup
    data.update()
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/util/__init__.py", line 224, in wrapper
    result = method(*args, **kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/smartweather/__init__.py", line 121, in update
    self.data = weather.currentdata()
  File "/srv/homeassistant/lib/python3.5/site-packages/pysmartweatherio/models.py", line 50, in currentdata
    Conversion.volume(float(self.json['obs'][0]['precip_accum_local_yesterday']), self.units),
KeyError: 'precip_accum_local_yesterday'
2019-04-10 12:26:33 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of smartweather.sensor. Setup failed for dependencies: smartweather

@efleming: Thanks for reporting this. This was a situation I had never been able to test, as it requires a new station setup, which you did. The problem was that some JSON keys are not created before the first time they are available. Amongst those are precipitation yesterday. I have now fixed this by checking if the key exist before trying to do something with it.
Release 0.1.4 is available on Github. You only need to download __init__.py as this is the only changed file.

That did the trick, cheers :slight_smile:

1 Like

Thanks again for this component, I am really liking it as it has improved my Garden Irrigation system no end (and not just for me, others are using it too) but is there any news on this?

Manually copying the files every time is a real pain first world problem. :wink:

2 Likes

@klogg: You got me!
I have now prepared the component for automatic updating. In order to get it to work you need to download all 4 files manually again (__init__.py, sensor.py, binary_sensor.py and weather.py). The only change is that now they contain a version number, so that changes can be tracked.
Once this is done, add the following to your configuration.yaml file:

custom_updater:
component_urls:
  - https://raw.githubusercontent.com/briis/smartweather/master/custom_updater.json

Restart Home Assistant, and you should get the below in your Tracker Card:
updater

Let me know if you have any issues with this. But else you should now get automatic notifications once I change things.

1 Like

A quick question…
I only use the sensor. Will that still work without problems/errors if I don’t include the binary_sensor.py and weather.py

Yes that will work. If weather.py and binary_sensor.py is not in the directory, you will not see them in the Tracker Card, but you will still see the other two components.

hi
I have a problem with my sensor everything seems to work in my configuration if i connect to for example the station 2777 but i get an erro if I connect to my public station 2946. Anyone have any ideas?

this is the error from the log

raceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/homeassistant/setup.py”, line 154, in _async_setup_component
component.setup, hass, processed_config) # type: ignore
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/smartweather/init.py”, line 96, in setup
data.update()
File “/usr/local/lib/python3.7/site-packages/homeassistant/util/init.py”, line 224, in wrapper
result = method(*args, **kwargs)
File “/config/custom_components/smartweather/init.py”, line 123, in update
self.data = weather.currentdata()
File “/config/deps/lib/python3.7/site-packages/pysmartweatherio/models.py”, line 43, in currentdata
self.json[‘obs’][0][‘feels_like’],
KeyError: ‘feels_like’

thanks

Hi Lorenzo,
It seems like you only have the AIR Module installed, as no Wind Readings are returned. Is that true?
I will try and do better error handling, so that you can load the module, even without a SKY module. Then there will just be a lot of zero values.

EDIT: There is now a new release that should work even if you don’t have either the SKY or AIR unit installed. Update through Customer Updater or download __init__.py

thanks a lot will try as i get back home

EDIT WORKS THANKS!!!

Hi,
thanks for the help, how to I change the unit for the wind from m/s to km/h? Any ETA for the UDP based version ?

thanks

I am assuming your are refering to the Sensor component, as the Weather Component does return Wind in km/h (As per default for this type of Component)
When your Home Assistant Unit System is Metric, it will always return the Wind Speeds in m/s. For now the only way to get this in km/h is by creating a template sensor where you convert the value. I will look in to having the option of converting to km/h build in to the component.

I have the Sensor component running via UDP on a test system for a few weeks now, I just need to find the time to package it all nicely together so that others can test it too.Hopefully during the Easter period I will find the time to do it.

1 Like

That was more or less where I got to, before I gave up. In the end I went with a UDP Listener helper, which published to MQTT and just picked it up in HA. Wasn’t what I wanted to do, but I really could not make head nor tail of how to proceed with a full custom component (nor if it should be sensors with attributes, platforms with sensors or any of the other combinations!).

Glad to see someone else working on it, I hope you have more luck :+1:

There is now a UDP version available for test. Look in this entry and please post questions to the UDP version in there. WeatherFlow Smart Weather Station via UDP

@Lorenzo_Gulli: There is now a new version that supports km/h as Wind Unit, when using the Metric Unit System in Home assistant. Download the sensor.py file or update via Custom Updater. See the README.md on Github, for setup instructions.