Closed messismore closed 5 years ago
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!
This is a automatic comment generated by codeowners-mention to help ensure issues and pull requests are seen by the right people.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
Same here... My quick and dirty workaround was to always add 0.01 to the result returned by components/switch/mystrom.py, (current_power_w).
Same here... My quick and dirty workaround was to always add 0.01 to the result returned by components/switch/mystrom.py, (current_power_w).
hey would you mind explaining how to add that? i'm having the same issue as i'm trying to use an automation based on th read-out.
hey would you mind explaining how to add that? i'm having the same issue as i'm trying to use an automation based on th read-out.
Depending on the version of home-assistant you're running, either edit components/switch/mystrom.py
or components/mystrom/switch.py
, look for def current_power_w(self):
, change the return statement two lines below to return round(self.data['power'] + 0.01, 2)
and finally restart home-assistant.
Depending on the version of home-assistant you're running, either edit
components/switch/mystrom.py
orcomponents/mystrom/switch.py
, look fordef current_power_w(self):
, change the return statement two lines below toreturn round(self.data['power'] + 0.01, 2)
and finally restart home-assistant.
Hey thanks for getting back at me. I‘m running hass.io on a raspberry 4 and am using the standart integration (adding it to config.yaml). I ssh‘d as root but can’t find either of those folders, not even the components one.
@dezuber As far as I know, components in <config dir>/custom_components
overwrite the built in ones, but I can't find it in the documentation right now.
You can get the original file here.
@messismore thanks for your reply. just created the folders \hassio\config\custom_components\mystrom and added the file you posted. doesn't seem to work...
@dezuber I just tried it and it seems to work. Did you make the change suggested by @matoxp?
Home Assistant release with the issue:
94.4
Last working Home Assistant release (if known):
Operating environment (Hass.io/Docker/Windows/etc.):
Hass.io
Component/platform:
myStrom switch
Description of problem:
The switch's
current_power_w
attribute will not update when power consumption drops to zero but instead sticks to the last reported value. (It seems like Hass is no longer reporting it? When I query the state of the switch with the hass cli the attribute is no longer listed)The component relies on https://github.com/fabaff/python-mystrom which correctly reports the switch's consumption.
Is this a problem with how Home Assistant deals with attributes? I noticed that when I change
mystrom/switch.py
to always returncurrent_power_w = 0
the attribute does not show up in Home Assistant either…Problem-relevant
configuration.yaml
entries and (fill out even if it seems unimportant): SwitchSensor
Traceback (if applicable):
Additional information: