-
Notifications
You must be signed in to change notification settings - Fork 4.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
Allow calibration of HuaFan devices (and other hardware) #654
Conversation
5.5.0 20170730 * Reduce code space by removing the following commands as they are replaced by SetOption alternatives: * SaveState = SetOption0 * ButtonRestrict = SetOption1 * Units = SetOption2 * MQTT = SetOption3 * MQTTResponse = SetOption4 * TempUnit = SetOption8 * Smoothing WS2812 animation poll, invert fade speed and max allowed wakeup time down to 3000 seconds * Fix initial button press detection * Add support for Sonoff RF Bridge 433 using command RfKey * Fix regression from 5.0.7 by increasing message buffer size from 360 to 368 to accomodate 4 x DS18x20 sensors (#637) * Add GroupTopic to Topic test when using ButtonTopic/SwitchTopic to send either ON/OFF or TOGGLE (#642) * Adjust HLW calibration limits to accomodate HuaFan device and add commands HlwPSet, HlwUSet and HlwISet (#654)
The calibration is working quite nice with the SET command 👍 I'm only struggling with the voltage. Can it be outputted with one or two decimals? Because 1V is quite a big calibration gap. Now I need to wait when the voltage is rounded to calibrate. Can you make an extra option to automatically calculate the PCAL when I have calibrated the U and I? Something like HLWPSETAUTO? I can measure the voltage (in parallel) and the current (in serie) with the multimeter. Calculating the P is quit hard with changing values :) I don't believe that all bulbs have the exact same wattage ;) Thereby who got the old bulbs yet still? When I measure exactly 231.0 V I send it to the device: When I look into the webinterface it keeps saying 230 V when my multimeter is saying 231.0 |
Thanks for adding this. Closing the pull request. |
5.5.1 20170805 * Fix Sonoff Rf Bridge issues * Add Sonoff RF Bridge MQTT messages on received and learned RF signal * Add command VoltRes 0|1 to select voltage resolution to 0.1 V (#654) * Add averaging to Analog input (#686) * Add Energy tele data on Sonoff Pow Threshold change (#688) * Fix inconsistent property names in Messages (#690)
5.5.0 20170730 * Reduce code space by removing the following commands as they are replaced by SetOption alternatives: * SaveState = SetOption0 * ButtonRestrict = SetOption1 * Units = SetOption2 * MQTT = SetOption3 * MQTTResponse = SetOption4 * TempUnit = SetOption8 * Smoothing WS2812 animation poll, invert fade speed and max allowed wakeup time down to 3000 seconds * Fix initial button press detection * Add support for Sonoff RF Bridge 433 using command RfKey * Fix regression from 5.0.7 by increasing message buffer size from 360 to 368 to accomodate 4 x DS18x20 sensors (arendst#637) * Add GroupTopic to Topic test when using ButtonTopic/SwitchTopic to send either ON/OFF or TOGGLE (arendst#642) * Adjust HLW calibration limits to accomodate HuaFan device and add commands HlwPSet, HlwUSet and HlwISet (arendst#654)
5.5.1 20170805 * Fix Sonoff Rf Bridge issues * Add Sonoff RF Bridge MQTT messages on received and learned RF signal * Add command VoltRes 0|1 to select voltage resolution to 0.1 V (arendst#654) * Add averaging to Analog input (arendst#686) * Add Energy tele data on Sonoff Pow Threshold change (arendst#688) * Fix inconsistent property names in Messages (arendst#690)
The calibration limits hardcoded into xsns_hlw8012.ino are too high for calibrating the HuaFan devices. The HuaFan's shunt resistor is double the Sonoff's and there are only 4 voltage divider resistors rather than 5. For example, to calibrate the Huafan required the following values: HLWPCAL: 4,750, HLWUCAL: 1,525, HLWICAL: 1,680 (the first and last are below the hardcoded limits).
This PR proposes an alternative calibration approach allowing the user to provide known power, voltage and current values with the software auto-calibrating to these values. This would also allow the HuaFan to be calibrated as well as devices with other hardware. The PR adds the following three commands:
The use cases for calibration are either:
This approach seems more consistent with the guidelines provided in the wiki pages for preparation and simplifies the calibration process.