-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add vera power meter. #7134
Add vera power meter. #7134
Conversation
@pavoni, thanks for your PR! By analyzing the history of the files in this pull request, we identified @robjohnson189, @balloob and @fabaff to be potential reviewers. |
@pavoni - what do I need to do to test? |
@danodemano Have you done any development on HA. If so you just need to checkout my branch ( If not you'll need to set up a dev version of HA as described here (https://home-assistant.io/developers/development_environment/). You can skip the initial stuff about forking the repo and creating a local repo (unless you plan to do some development yourself), and just |
@pavoni - I have not done any dev work, no. I will give that a shot and let you know. |
Sounds like it may be a challenge for you to run this - but if you manage please test that your Power Meters appear - and update correctly. |
Nah, dev environment is nearly up and running. setup.py is just installing everything now. Should have some test results for you shortly. |
Thanks for testing. Can you |
Those numbers all look pretty big. Should we display in kw? |
That's better! I think watts is fine, it looks nice when you move it to a panel: Though kw would be fine, I just worry that those with usage <1kw are going to see like .485 kw which isn't really nice either. I don't suppose there is any way to change it dynamically from w to kw if the usage is > 1000w? |
@@ -67,6 +73,12 @@ def update(self): | |||
self.current_value = self.vera_device.light | |||
elif self.vera_device.category == "Humidity Sensor": | |||
self.current_value = self.vera_device.humidity | |||
elif self.vera_device.category == "Power meter": | |||
power = self.vera_device.power; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
statement ends with a semicolon
@@ -49,6 +49,12 @@ def unit_of_measurement(self): | |||
return 'lux' | |||
elif self.vera_device.category == "Humidity Sensor": | |||
return '%' | |||
elif self.vera_device.category == "Power meter": | |||
power = self.vera_device.power; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
statement ends with a semicolon
Good idea - let's try. Have also rounded the numbers for the main display. So if you can pull and try again. |
@@ -49,6 +49,12 @@ def unit_of_measurement(self): | |||
return 'lux' | |||
elif self.vera_device.category == "Humidity Sensor": | |||
return '%' | |||
elif self.vera_device.category == "Power meter": | |||
power = convert(self.vera_device.power, float, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undefined name 'convert'
@@ -49,6 +49,12 @@ def unit_of_measurement(self): | |||
return 'lux' | |||
elif self.vera_device.category == "Humidity Sensor": | |||
return '%' | |||
elif self.vera_device.category == "Power meter": | |||
power = convert(self.vera_device.power, float, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undefined name 'convert'
Can you try again @danodemano? |
Thanks for your help. |
fe57126
to
3d48d81
Compare
I'm pretty sure switching units will mess up the historic data. So is probably a bad idea. So we should settle on My sense is probably |
Ahh that's a good point. I would just stick with W then, people can adjust the display using templates if required. HA when directly connected to these meters uses W. |
quick test looks good, but I need to switch out a lot of config to be 100% sure it fixes the issues I had around the switch states/etc, especially in automation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🐬 ok to merge when it's all ok with you @pavoni
@danodemano Did you change anything locally? If not may be the rebase I did to combine the commits. You could try the suggestions here to overwrite your local with the new remote http://stackoverflow.com/questions/1125968/how-do-i-force-git-pull-to-overwrite-local-files. Worst case you can delete and re-clone the repo assuming you don't have anything valuable locally. Will merge when you've tested. |
@pavoni - thanks, I was able to fetch and hard reset and am on the current copy of your branch. I have it running now, will let you know how the historical data looks in a few hours. I nuked the database before starting just to make sure it was fresh. |
Description:
Adds a vera power meter as a sensor - with watts as the state - and kwh as an additional attribute.
I don't have one of these - so @danodemano Could you test?
Related issue (if applicable): fixes #
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.github.io#<home-assistant.github.io PR number goes here>
Example entry for
configuration.yaml
(if applicable):Checklist:
If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
tox
run successfully. Your PR cannot be merged unless tests passREQUIREMENTS
variable (example).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.If the code does not interact with devices:
tox
run successfully. Your PR cannot be merged unless tests pass