I just updated from 0.107.7 to 0.108.0 and all my mystrom switches are no longer available. Homeassistant complains about a key error.
configuration.yaml
switch:
- platform: mystrom
host: 192.168.4.20
name: Fernseher Schlafzimmer
- platform: mystrom
host: 192.168.4.21
name: MyStrom Sonos Kueche
- platform: mystrom
host: 192.168.4.22
name: MyStrom Sonos Schlafzimmer
- platform: mystrom
host: 192.168.4.23
name: MyStrom Sonos Buero
- platform: mystrom
host: 192.168.4.24
name: MyStrom Sonos One Wohnzimmer
- platform: mystrom
host: 192.168.4.25
name: MyStrom Sonos Beam Wohnzimmer
- platform: mystrom
host: 192.168.4.26
name: MyStrom Phone Charger
- platform: mystrom
host: 192.168.4.27
name: MyStrom Aquarium Licht
- platform: mystrom
host: 192.168.4.28
name: MyStrom Aquarium Heizung
- platform: mystrom
host: 192.168.4.29
name: MyStrom Aquarium Filter
- platform: mystrom
host: 192.168.4.30
name: MyStrom Aquarium Luftpumpe
- platform: mystrom
host: 192.168.4.31
name: MyStrom Aquarium Ventilator
2020-04-08 20:51:04 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 295, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 447, in _async_add_entity
await entity.async_update_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 284, in async_update_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 320, in _async_write_ha_state
state = self.state
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 612, in state
return STATE_ON if self.is_on else STATE_OFF
File "/usr/src/homeassistant/homeassistant/components/mystrom/switch.py", line 60, in is_on
return bool(self.data["relay"])
KeyError: 'relay'
Just reverted homeassistant back to 0.107.7 with ha core update --version 0.107.7 and mystrom seems to work again.
Hey there @fabaff, mind taking a look at this issue as its been labeled with a integration (mystrom
) you are listed as a codeowner for? Thanks!
I confirm I have exactly the same issue with v0.108 and MyStrom switches.
I have just rolled back to 0.107.7 and they have not come back. I have not done a rollback before so perhaps I did something wrong. I'll work on that but it would be great to see a fix to move forwards.
My bad, I see my rollback failed so I was still on 108.
@schneuwlym can you share how exactly you rolled back? I've not done one before and used pip3 install homeassistant==0.107.7 but it crapped out...
My bad, I see my rollback failed so I was still on 108.
@schneuwlym can you share how exactly you rolled back? I've not done one before and used pip3 install homeassistant==0.107.7 but it crapped out...
As I wrote I'm using the supervised version of home assistant. Some time ago I also installed it directly with pip, but then I found out that it is a real pain to install stuff like node-red and other fancy stuff.
So I would advise you to do the same. It makes things much easier! If you have the supervised version (formerly called hassio), then you have the tool ha to manage your installation and then you can use the command which I already posted above:
ha core update --version 0.107.7
Thanks Mathias.
I am indeed running the supervised version on a RPi. My issue was that I had followed documentation for another version (there are so many ways to use this platform that I never find the right docs!).
I am running ha core update --version 0.107.7 now and it says "processing" with a nice whizzy block of dots. Let's see if that works.....
Thanks for the clarification.
@schneuwlym Rollback worked seamlessly. Thanks!
@fabaff I confirm that the MyStrom switches are working again once I rolled back to 107.7. They did not work on 108 or 108.1
My solution to fix the mystrom issue for the meantime is, to create a command_line switch.
- platform: command_line
switches:
tv_command_line:
command_on: "curl -X GET 'http://192.168.1.40/relay?state=1'"
command_off: "curl -X GET 'http://192.168.1.40/relay?state=0'"
command_state: "curl -X GET 'http://192.168.1.40/report'"
value_template: '{{ value_json.relay == true }}'
friendly_name: TV
My mystrom switch works all fine again with this solution in 0.108.1
Hi @fabaff. Are you able to confirm if a fix is on the horizon?
@Siggy101 Please don't ping people for that reason. The issue is open, assigned and he has been notified. Anyone else can pick it up as well.
Sorry, I wasn't aware that's a no no.
Point taken and I apologise.
I have the same problem. I have 6 MyStrom devices which all disappeared after the update. However, three of the six devices reappear after a couple of minutes after a reboot. The other three do not reappear.
I am also running my Home Assistant on Ubuntu 18.04.4 LTS on an Intel NUC. I am running the version with the supervisor in docker.
Rolling back to version 0.107.7 resolved the issue with the MyStrom devices. However, when I rolled back, the two Harmony TV did not work anymore. It was working before with this version. Therefore, I went back to the last version and use currently the workaround @Morpheus8 proposed. I hope this will be only a workaround for a short period and the MyStrom integration can get fixed. Thanks to everyone working on that issue!
Hello,
I have the same problem with my myStrom switches (v1 and v2). The Temperature Sensors (of v2) seem to work, but not the Power Consumption. I'm running Home Assistant 108.3 with HassOS 3.12 on a Raspberry Pi
Same here
I see that this issue has been closed stating that MyStrom light and switch have been moved to async.
I see no change to the documentation for MyStrom.
Can anyone clarify what we need to do to get the switches working again? Do we need to edit the YAML configuration? If so, can we have an update to the documentation please.
The config should be the same as fabaff declared in #34079:
but mine are not working either (Home Assistant 0.108.8):
Edit: I saw that we have to wait for a new release.
I confirm that I have the same config but have rolled back to 107.7 to keep things working.
Aaaaaah, where did you read that it'll be in a future release @ggmanugg ? That's the key bit of info I was missing and if that's the case then all is good with the world again.
You can see in the changelog which changes has been implemented.
MyStrom is not listed here but the pull request was merged so it should be available in the next release :)
I'm aware of the changelog and have been reading each one carefully since 108 broke MyStrom. No sign of it so far.
As you say, if it has been included in the latest pull request then perhaps we will see it soon. I'll be sitting on my hands until then.
@fabaff
When will your pull request be released in Home Assistant? The version 0.109.1 still don't work with the myStrom integration..
I confirm the same. I did a test install of 109 but MyStrom stopped working again. No sign of it in the release notes either.
Rollback to 107.7 still works perfectly so that's good.
109.3 was released but still no sign of the MyStrom fix in the release notes.
Can anyone say when this fix will go live?
109.4 has landed. MyStrom fix is not in the release notes.
@Siggy101 the fix was merged only into the dev branch. I don't think we'll see it in any of the hotfix releases. It'll likely be in the next full release.
Ah hah. I wasn't aware that it was only released into dev. That's a shame that the integration is broken and left that way for now.
Roll on v0.110 then...
Thanks for clarifying.
@Siggy101 Yea.. idk the reasoning behind it.. maybe there were too many changes necessary for it to be a hotfix. But to be fair it's all contributed work.. so I'm just glad that it got fixed even if it takes a while to be in production.
If you want to update anyway there's a workaround that makes the switches work: If you trigger them via an automation after starting - they work okay to turn on/off, only the power output value doesn't get updated properly. Which breaks my washing machine done notification.. :P but the main thing is that I can at least turn on/off things.
Yep, you are quite right about this being people's time they are giving up. I can be guilty of forgetting that sometimes so it's a helpful reminder. Thanks.
I use mine for heating electric radiators from solar panels so it's no big deal to stay on 107.7 as I very rarely use them now it's spring.
I shall wait for the next full release with the fix. I like to stay with official workings even if that means holding off a few updates.
No mention of it in the release notes but this seems to be fixed in 0.110.0.
Thanks guys!
It was actually mentioned in the release notes:
Move myStrom light and switch to async (fabaff - #34079) (mystrom docs)
I can also confirm that it works again since 0.110.0.
Thanks a lot! :smile:
That's so weird that I missed it. I opened the release notes and searched in Chrome.
Oh well, I'm far too happy to be bothered! My electric radiators now work and it's 27 degrees outside. Yay!
Hi everyone
I have a problem with mystrom, the switch works regularly but the power consumption sensor doesn't work? Is it just my problem or does it happen to you too?
Is there a possibility to have the temperature sensor integrated in the smart plug as well?
thx
N.
Please do not respond to closed issues and open a new issue instead if you're experiencing issues.
Most helpful comment
I'm aware of the changelog and have been reading each one carefully since 108 broke MyStrom. No sign of it so far.
As you say, if it has been included in the latest pull request then perhaps we will see it soon. I'll be sitting on my hands until then.