SMA Webconnect not getting values

I’ve setup the SMA webconnect component and don’t get any errors when loading the configuration. But I don’t get any values in the sensors. Any idea what might be the cause of this, below my configuration. I have this working with SMBSpot in Domoticz.

sensor sma:

  • platform: sma
    host: xxx.xxx.xxx.xxx
    password: “password”
    sensors:
    current_consumption: [total_consumption]
    current_power: [current_power]
    total_yield:

I have the same issue. Check_config is clean, however I do get some async timeout errors in homeassitant log. Anyone that can help out here, please.

I’m having the same issue here.

This is the error I’m getting:

2018-01-16 16:47:45 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/tasks.py", line 180, in _step
    result = coro.send(None)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/sma.py", line 125, in async_sma
    values = yield from sma.read(keys_to_query)
  File "~/.homeassistant/deps/lib/python/site-packages/pysma/__init__.py", line 79, in read
    yield from self.new_session()
  File "~/.homeassistant/deps/lib/python/site-packages/pysma/__init__.py", line 52, in new_session
    URL_LOGIN.format(self._ip), self._new_session_data)
  File "~/.homeassistant/deps/lib/python/site-packages/pysma/__init__.py", line 46, in _fetch_json
    return (yield from res.json())
  File "/usr/local/lib/python3.6/site-packages/aiohttp/client_reqrep.py", line 795, in json
    headers=self.headers)
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: '

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

@kellerza, did you get a chance to check if that helps/integrate it to the code? I’m also experiencing connection issues… May try this!