-
Notifications
You must be signed in to change notification settings - Fork 19
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 ControlValue sensor, OptionsFlow and RestoreState to make better use of Ngenic Track with UtilitySensors #22
base: master
Are you sure you want to change the base?
Conversation
* Add Option to create utility meters * Add Options to keep current/last month sensors
* Add RestoreState Sensor * Use RestoreState for NgenicEnergySensor * Use Option to add Utility Meters * Use Option to add current/previous month Sensors
This is great! I didn't even know about UtilityMeter :-)
2.2 I've noticed a bug where we start receiving errors in the log when reloading the integration. This doesn't have anything to do with you changes, but if the workflow is to reload the integration after any changes it needs to be fixed first. I've reported this here: #23
|
1.For example, the daily utility meter resets it's value to 0 at 00:00:00. This means that it is still possible to "catch" an update on the wrong day, since the source meter is updated every 10 minutes. But as long as we can accept that every kWh is registered pretty close to the correct day, the utility meters will give a pretty good estimate. Worst case would be if the energy meter is updated at 00:00:01, which would then register the entire poll period on the wrong day. Perhaps, in another PR, I could try to reschedule the updates of the energy sensor to reduce the chance of having the energy register in the wrong cycle 2.I am not sure how removed (or orphaned) sensors can be (forcefully) removed 2.2.I noticed this as well, but didn't look into it. I will definitely follow #23 . Right now a HA restart is required after the options are updated 🤔 3.Good catch. It should be possible to alter the utility meters when adding them. I will a look at this A use caseI use the UtilityMeters together with |
Now UtilityMeter sensors will be added to the entity registry and show up under "Ngenic Tune" Also, I added a comment in the README suggesting a HA restart if options are changed |
Can you please check this out? #24 (comment) |
Please rebase your branch so you'll get the fixes for #23 |
@andersteern Any chance you can rebase this so it cab be merged? |
This looks very nice @andersteern 👍 Do you have the time to rebase and update this PR? |
First off, thanks for creating this platform
This PR consists of 3 parts
Add
NgenicControlTempSensor
The API exposes a
CONTROL_VALUE
sensor that indicates the adjustment made by the tune on the outdoor temperature.This value is made available in a new temperature sensor
sensor.ngenic_controller_control_value
Prepare Ngenic Track Energy Sensor for UtilityMeter
As explained in here the source sensor should/could implement
RestoreEntity
to store it's state between restarts.To cater for that the
NgenicEnergySensor
now has it's state stored and updated on loadThe other change to the
NgenicEnergySensor
is that the value ofsensor.ngenic_sensor_energy
now reads the total number of kWh's consumed since installationAdd options to replace the current/previous month sensors with utility meters
The Integration now has an
OptionsFlow
that will make all additions of meters optional.The default setting will be to not add utility meters, and keep the current
sensor.ngenic_sensor_monthly_energy
andsensor.ngenic_sensor_last_month_energy
untouched