Closed RubenKelevra closed 2 years ago
Ah, I forgot, my smart plug is a TS0121_plug by TuYa which has Zigbee.
Hi, Doing manual measurements is really only feasible for brightness only lights. Which only need to have power values for different brightness settings. For color_temp you'll need hundreds of readings, and for hs (color) mode thousands. You can just look at another brightness.csv to see how these files are structured. There is also a section in the readme explaining the file structure. The script does not provide a way yet to input manual measurements, but it could be a nice addition thinking about it some more. Functionality wise the script would do exactly the same, but instead of reading directly from a smartplug ask you to input the power value manually. Would be not that difficult to implement.
I am not sure about the accuracy of TS0121. Maybe @nepozs has an idea. Here is an overview of different smart plugs and there accuracy as provided by some users. https://github.com/bramstroker/homeassistant-powercalc/discussions/330 At least you could try with this smart plug and compare some readings with your multimeter. When it is close enough it is acceptable.
Implemented possibility for manual measurements #354.
Well, the regular light bulbs I use are just brightness and color temperature. I thought about just doing 100% cold, 50/50, and 100% warm for off, 1%, 25%, 50%, 75%, and 100%. Is this too naiv?
That's just 18 measurements.
The same goes for hs color bulbs if mainly used in color temperature mode...
But since I got both ready, I give your idea a try. :)
So I put a stupid LED bulb from OSRAM in the test socket. My multimeter shows 0.066 A, the sticker states 65 mA, and my TS0121 plus says 0.07 A.
Sounds accurate enough to me.
The setup was: Phase -> Smartplug -> Multimeter -> Light -> Smartplug -> Neutral
Well, the regular light bulbs I use are just brightness and color temperature. I thought about just doing 100% cold, 50/50, and 100% warm for off, 1%, 25%, 50%, 75%, and 100%. Is this too naiv?
18 measure points is not really enough imo. The default setting for the measure script takes the following amount of measurements:
color_temp: 1872 hs: 24786 brightness: 255
When you take manual measurements it's not really feasible to take more than 100. I would say 100 measurements are acceptable when doing manual measurements and it would take 10-20 minutes when you input one measurement each 5/10 seconds.
However it's preferable to do the automatic method with the Tuya TS0121, since you already checked it's accurate enough. You could do another check with a led bulb on really low brightness levels. Currently you only checked ~16 watt. Most smart plugs have difficulty to measure power lower than 0.5 watt.
Do your scripts support manual input of the mA and voltage?
Not currently, but I should be able to add that. First let me know if you plan to do manual with your multimeter or automatic with the Tuya plug.
Already implemented inputing ampere and voltage ;-) https://github.com/bramstroker/homeassistant-powercalc/pull/355
Also increased default step sizes so the measure script will take 86 measurements for brightness mode and 134 for ct mode when using the manual power meter option. #356
@bramstroker wrote
hs: 24786
This sounds pretty excessive. The issue with using a Zigbee plug in my setup - so using HA with Zigbee2MQTT is, that it will fetch a new value from the plug every 60 seconds.
Changing this is currently (easily) possible. So a scan would take 17 days? :D
So doing a couple of measurements manually would take less time, but is obviously more work.
The question is probably more if a simple interpolation is really this far off (if you take only 18 measurements for color temp) if you consider that you can only measure with only 0.1A resolution.
The issue with using a Zigbee plug in my setup - so using HA with Zigbee2MQTT is, that it will fetch a new value from the plug every 60 seconds.
Here's my ticket about this:
Here is an overview of different smart plugs and there accuracy as provided by some users. #330
Thread #330 is not intended to show accuracy of smart-plugs - it contains only information about power draw by smart-plug itself (there are shown also models without ability of any metering).
@bramstroker ability to manual measure by providing separately measured voltage and current make no sense, because it don't use power factor (which in case of LED-bulbs is really much lower than 1), so calculated power draw will have really much overstated values. So in my opinion script with such ability should never be published (as producing files with wrong values it will destroy our LUT database).
I would like to emphasize it by speaking really loudly: just don't make any moves that might destroy the whole meaning of the powercalc project.
This method of measure produces values with VA as unit of measure - so it is not suitable to use when W is really needed. For alternating current value in VA is different than value in W for any non-resistance load (like LED-bulb, Led-driver and so on). Quick example: 0.01A, 230V, power factor (cosinus fi) 0.6
Pa=2.3VA (apparent power measured in VA or simply calculated by multiply measured voltage and current) but P=1.38W (real power measured in W, and this value should be in LUT database) https://en.wikipedia.org/wiki/Electric_power#Alternating_current_without_harmonics without dedicated power meter it is impossible to measure power factor, so using just ordinary multimeter with ability to measure alternating current isn't enough!
Smart-plugs have small accuracy and are unsuitable to measure very low power, but they have built-in measuring system able to measure power factor and use it to show real power.
Power factor can have variable value (and it usually have), so we can't say: "use for example 0.6" because it is not true - it depends on electrical design of LED-drivers, so it depends on current brightness/model/manufacturer. There are model which have power factor between 0.4 and 1 (depending on brightness/colour/saturation/hue) and there are models with for example power factor 0.5 in nearly all points of characteristic.
@nepozs thanks for your critical feedback. So using a multimeter isn't going to work.
What's the recommended way to measure the power draw of my devices to provide them to the powercalc database?
I got the already mentioned device, which has 1 W resolution for power draw (at least what's reported via Zigbee2MQTT). Maybe the device could in theory report with higher resolution. The alternative is to measure the energy consumption for say an hour with the device. Maybe that's more accurate?
I also got a different type of plug which has WIFI and is called "SP211".
Is there any affordable solution to measure the actual power draw accurately enough, if those options are not accurate enough?
Thanks @nepozs for the feedback, appreciated. Didn't know about power factor being an issue. Thanks for the explanation. I will remove the added functionality for input of ampere and voltage.
@RubenKelevra 1W resolution will be to broad. We need at least 0.1 W accuracy, because most lights are low power devices (LED) which draw at most 10 watts. Measuring for a longer time period won't work, because the whole idea of powercalc LUT database is to have different power readings for different brightness/color settings. The measure script will set the light to a certain setting, wait a few seconds, take a power reading, set to the next setting etc. etc.
Do you have a link to SP211?
Thanks @nepozs for the feedback, appreciated. Didn't know about power factor being an issue. Thanks for the explanation. I will remove the added functionality for input of ampere and voltage.
Maybe amps, voltage and power factor is fine? As long as it won't accept values without a power factor.
@RubenKelevra 1W resolution will be to broad. We need at least 0.1 W accuracy, because most lights are low power devices (LED) which draw at most 10 watts. Measuring for a longer time period won't work, because the whole idea of powercalc LUT database is to have different power readings for different brightness/color settings. The measure script will set the light to a certain setting, wait a few seconds, take a power reading, set to the next setting etc. etc.
Do you have a link to SP211?
Yeah here:
Never mind the SP211, the device is dead. Looks like it got damaged on the last move.
So... this means I'm looking into getting something new, any recommendations?
I found this one - would that work?
https://de.aliexpress.com/item/1005002409588154.html
We're talking about Schuko/230V/50Hz.
No Tuya based hardware is recommended (due to typically low quality), but if you are ready to experiment, you can try this model, it should be sufficient, but it is Zigbee version (I don't know if the script supports Zigbbee!).
links in English version are preffered (as aliexpress sets cookies changing interface language, when visiting national version of page) https://www.aliexpress.com/item/1005002409588154.html
In my opinion Shelly Plug (old BIG version) https://www.amazon.de/dp/B0835YG5HK/ should be slightly better than Shelly Plug S (small version) because it is big and parasitic noise (this causes deviation of the results) should be lower (due to smaller density of components, but I have not tested it!) and it supports Schuko/230V/50Hz.
From my experiments it looks like TP-link HS110 has smaller measure noise (but it uses lots of power itself and it is only slightly better than Shelly Plug S).
As of today I can't recommend any smart-plug due inability to measure power draw ~<0.5W.
No Tuya based hardware is recommended (due to typically low quality), but if you are ready to experiment, you can try this model, it should be sufficient, but it is Zigbee version (I don't know if the script supports Zigbbee!).
The script supports any powermeter which can be connected to home assistant. You can select
hass
as power meter and than you can select the givensensor.
from home assistant.As of today I can't recommend any smart-plug due inability to measure power draw ~<0.5W.
I did only use Shelly Plug S myself, it is not good on really low power as @nepozs indicates. All lights I measured started on lowest brightness on 0.8 watt, so it was sufficient for these cases. I measured standby power with a accurate manual meter. I plan on buying some more smart plugs to do some testing on low power values, to give some recommendations for a certain smart plug, but not sure when I will be able to do this. Time wise and budget wise.
So I ordered a Shelly Plug (without the S) and as soon as the Zigbee2MQTT stuff works with 1-second updates I'll give the DIN-Rail stuff a go. :)
Thanks for the help!
@RubenKelevra Nice! Keep us updated. Which lights do you plan to measure and contribute to the repo?
@bramstroker -Yeelight LED-Strip 1S - Wifi -Yeelight Bulb 1S - Wifi -TuYa TS0505B (light strip) - Zigbee -Xiaomi (Aqara) ZNLDP12LM - Zigbee
Additionally, I also got a dual triac module called QS-Zigbee-D02-TRIAC-2C-LN from Lonsonho which I run with dimmable LEDs from IKEA - So at least for this combination, I could also provide values.
Then I got some switch modules, like the SONOFF ZBMINI, the eWeLink SA-003-Zigbee, and a third one which isn't installed yet.
I also would like to provide some standby power measurements for some common appliances like my Roborock S6 MaxV as well as the consumption while charging.
Very nice!
LUT files for the first 4 lights could be provided to the library as this will also help other using the same light.
For the others you are still able to measure and create LUT files, but you'll need to add these to your own instance by using the config/custom_powercalc_models
directory feature, or the custom_model_directory
configuration option. That are two ways to include custom LUT files.
For the others you are still able to measure and create LUT files, but you'll need to add these to your own instance by using the config/custom_powercalc_models directory feature, or the custom_model_directory configuration option. That are two ways to include custom LUT files.
I think - unusual cases (like Lonsonho driver module + Ikea dimmable bulb) can be published in Discussions under "Share your config" category (with attached files). When possible also with full information about driver (like power draw in standby and power draw without load), so any user of similar non-standard installation can use it modifying provided files. I thought about tables like in thread #330 - something like that can be useful when enough data will be collected.
LUT files for the first 4 lights could be provided to the library as this will also help other using the same light.
Yeah, the script is working on the first one since yesterday. :)
I mean technically we could easily identify the dimmer itself and use a LUT to calculate the consumption (without load).
The user could just add an identifier of the light bulb which is used. The LEDARE light bulbs from Ikea are extremely common. So it might be interesting to have a consumption LUT.
Not sure how comparable different TRIACs are in terms of interchangeability. @nepozs any idea?
Hey guys,
All my lights are not supported yet. While I own one type of smart plug I don't think it's accurate enough for creating a LUT.
Your wiki entry doesn't list a multimeter as a possible measuring device (which I think is more accurate).
Do your scripts support manual input of the mA and voltage?