I am unable to get this going. Getting this is the logfile:
Unable to fetch data from SEMS. 0
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity_platform.py”, line 365, in _async_add_entity
await entity.async_update_ha_state()
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 225, in async_update_ha_state
self._async_write_ha_state()
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 248, in _async_write_ha_state
state = self.state
File “/config/custom_components/sems/sensor.py”, line 136, in state
return self._attributes[‘pgrid_w’]
KeyError: ‘pgrid_w’
I just checked the raw data coming from the API. Looks like the parameter pgrid_w is changed to out_pac. @CervDotBe, you can try to change this in your local file sensor.py.
Just checking; is your problem resolved? The reference to pgrid_w should work, I store the out_pac value from the api as attribute pgrid_w for HA? Let me know if you need any assistance.
@hesselonline. Now i’m getting:
2019-06-18 20:53:05 ERROR (SyncWorker_14) [custom_components.sems.sensor] Unable to fetch data from SEMS. 0
I think this happens when no energy is produced, so it should not throw this exception.
Will take al look again tomorrow morning.
I added the status waiting:
self.status = { -1 : ‘Offline’, 0: ‘Waiting’, 1 : ‘Normal’ }
Seems to solve the issue (same status as in the sems android app)
I have one of those as well in my log file -> I think the api is a bit unresponsive some times. This might also explain the issue of CervDotBe; it was probably just a timeout of the API.
I did notice before that I can only login once with my account. When I’m running the sensor on Home Assistant, logging manually becomes practically impossible (constant logouts because HA is using the API every x seconds). Maybe this is causing this issue as well.
I have tested your sems2mqtt component. The sensors show up but never get updated. Any ideas?
EDIT: Seems also corresponding due to limited API calls. I had the sems component of hessel still active and he was probably using the API calls. Now it’s disabled and the sensors are getting updated.
yep, don’t know if it’s possible to create additional users, I think I saw an invite option in the android app.
I added the ‘waiting’ status to the code in the Git Repo, also changed the dictionary lookup to return ‘unknown’ if a new status code shows up. This should prevent errors on new unknown status codes.
I used the ‘invite’ button in the android app to invite another mailaddress. This resulted in a second account, and no more logon expired isssues. Haven’t tried if this account works with the component yet (but I expect no problems there). So, it might be wise to create a seperate account for the sensor this way.
Hmm, the data being obtained by the sems2mqtt-component from the GoodWe API seems to be frozen. I’m still getting data in but its always the same? @hesselonline, are you seeing this as well? Or am I the only one?