Problem with pysma integration

Hello,

first of all Home Assistant is awesome thank you guys for the development. And please don’t struggle me if I’m posting this topic in the wrong categorie.

So my problem is that i wanted to setup the sma sensor (https://home-assistant.io/components/sensor.sma/) So far so good the configuration should be good because

./hass --script check_config

is not expecting any errors.

But in the log i’m getting this:

    2017-07-26 13:29:51 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib64/python3.6/asyncio/tasks.py", line 181, in _step
    result = coro.throw(exc)
  File "/srv/homeassistant/lib64/python3.6/site-packages/homeassistant/components/sensor/sma.py", line 125, in async_sma
    values = yield from sma.read(keys_to_query)
  File "/home/homeassistant/.homeassistant/deps/pysma/__init__.py", line 79, in read
    yield from self.new_session()
  File "/home/homeassistant/.homeassistant/deps/pysma/__init__.py", line 52, in new_session
    URL_LOGIN.format(self._ip), self._new_session_data)
  File "/home/homeassistant/.homeassistant/deps/pysma/__init__.py", line 46, in _fetch_json
    return (yield from res.json())
  File "/srv/homeassistant/lib64/python3.6/site-packages/async_timeout/__init__.py", line 46, in __exit__
    raise asyncio.TimeoutError from None
concurrent.futures._base.TimeoutError

And here is the snippet from my configuration.yaml
sensor sma:
- platform: sma
host: !secret sma_host
password: !secret sma_password
sensors:
current_consumption: [total_consumption]
current_power:
total_yield:

Do I missed any configuration step?

Thanks,
Christoph

Can anybody help with this topic? Do you need more information?

Hi, I have the exactly the same issue. Anyone,help please…

I am having this issue too and a few people in this topic are having the same problem.

I’ve made some progress on this. In the ~/.homeassistant/deps/lib/python/site-packages/pysma/__init__.py file I changed:

URL_LOGIN = "http://{}/dyn/login.json"
URL_LOGOUT = "http://{}/dyn/logout.json"
URL_VALUES = "http://{}/dyn/getValues.json"

to

URL_LOGIN = "https://{}/dyn/login.json"
URL_LOGOUT = "https://{}/dyn/logout.json"
URL_VALUES = "https://{}/dyn/getValues.json"

and now it is logging me in.

1 Like

Not tried your adjustment yet, but will do it next week. But also when it solved the problem on other installation maybe you should open a pull request on the official repo from pysma

1 Like

Any luck @freshhat?

@monkey-house just saw that there was an update on this thread. Didn’t get a notification. Unfortunately my SMA inverter doesn’t host an own WebServer, therefore it’s not possible to use pysma.

For all others which are stuck with that config. I have SMA 8000TL-20 which has the internal Webconnect, but now internal webserver.

I’m now using a scrapping sensor in order to pull it from my public sunnyportal.com page

1 Like