Skip to content
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

Feedback #24

Open
woopstar opened this issue Nov 14, 2024 · 54 comments
Open

Feedback #24

woopstar opened this issue Nov 14, 2024 · 54 comments
Assignees
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed skip-changelog

Comments

@woopstar
Copy link
Owner

Report bugs and/or feedback in relation to the energy sensors in this topic.

@Extati
Copy link

Extati commented Nov 15, 2024

After latest Update, working mode sensor is now unknown / ukendt - making the program not working anymore?

@woopstar
Copy link
Owner Author

#23 should fix it. I will merge and release it.

@Extati
Copy link

Extati commented Nov 15, 2024

Perfect - Thanks

@Extati
Copy link

Extati commented Nov 15, 2024

Another request. Right now I dont have an EV charger sensor, our any export sensor. It looks like when it cant find the sensor, it keep filling the log about a missing sensor every second or so, so it build up the .db way to fast. Is there a fix for that?

@woopstar woopstar self-assigned this Nov 15, 2024
@woopstar woopstar added documentation Improvements or additions to documentation skip-changelog labels Nov 15, 2024
@woopstar
Copy link
Owner Author

Another request. Right now I dont have an EV charger sensor, our any export sensor. It looks like when it cant find the sensor, it keep filling the log about a missing sensor every second or so, so it build up the .db way to fast. Is there a fix for that?

Can you create a new issue and put some of the logs into it, so I can see what output it is and surpress it.

@woopstar woopstar changed the title Home Assistant Energy Sensors Feedback: Home Assistant Energy Sensors Nov 15, 2024
@woopstar woopstar pinned this issue Nov 15, 2024
@Extati
Copy link

Extati commented Nov 15, 2024

Another request. Right now I dont have an EV charger sensor, our any export sensor. It looks like when it cant find the sensor, it keep filling the log about a missing sensor every second or so, so it build up the .db way to fast. Is there a fix for that?

Can you create a new issue and put some of the logs into it, so I can see what output it is and surpress it.

Sure - Will do it later

@Extati
Copy link

Extati commented Nov 15, 2024

#23 should fix it. I will merge and release it.

Just updated, restartet and configed again, still shows working sensor as Unknown / Ukendt

@woopstar
Copy link
Owner Author

#23 should fix it. I will merge and release it.

Just updated, restartet and configed again, still shows working sensor as Unknown / Ukendt

Can you provide me with logs and a screenshot of the attributes on the working mode sensor:

image

@Extati
Copy link

Extati commented Nov 15, 2024

What logs do you wanna see? The working sensor is empty.
FYI: I use the standard names from Huawei solar intergration.
Also my net consumption is: Unknown / Ukendt ?

Hope you can see something from this:

last_updated: "2024-11-15T18:22:53.397980"
last_changed_mode: "2024-11-15T18:21:53.393172"
unique_id: hsem_workingmode_sensor
huawei_solar_device_id_inverter_1_id: fe8976f680ef7c70154d4c4a472ad13a
huawei_solar_device_id_inverter_2_id: null
huawei_solar_device_id_batteries_id: 79013076495028544b2c0de5ef408d2f
huawei_solar_batteries_working_mode_entity: select.batteries_working_mode
huawei_solar_batteries_working_mode_state: time_of_use_luna2000
huawei_solar_batteries_state_of_capacity_entity: sensor.batteries_state_of_capacity
huawei_solar_batteries_state_of_capacity_state: 5
huawei_solar_batteries_grid_charge_cutoff_soc_entity: number.batteries_grid_charge_cutoff_soc
huawei_solar_batteries_grid_charge_cutoff_soc_state: 100
huawei_solar_batteries_maximum_charging_power_entity: number.batteries_maximum_charging_power
huawei_solar_batteries_maximum_charging_power_state: 2500
huawei_solar_inverter_active_power_control_state_entity: sensor.inverter_efficiency
huawei_solar_inverter_active_power_control_state_state: "100.0"
huawei_solar_batteries_tou_charging_and_discharging_periods_entity: sensor.batteries_time_of_use_periods
huawei_solar_batteries_tou_charging_and_discharging_periods_state: "2"
huawei_solar_batteries_tou_charging_and_discharging_periods_periods:

  • 06:00-10:00/1234567/-
  • 17:00-23:59/1234567/-
    house_consumption_power_entity: sensor.house_power_consumption
    house_consumption_power_state: 240
    solar_production_power_entity: sensor.inverter_input_power
    solar_production_power_state: 0
    net_consumption: null
    net_consumption_with_ev: 0
    energi_data_service_import_entity: sensor.energi_data_service
    energi_data_service_import_state: 2.553
    energi_data_service_export_entity: sensor.energi_data_service_produktion
    energi_data_service_export_value: 0.573
    battery_max_capacity: 5
    battery_remaining_charge: 4.75
    battery_conversion_loss: 10
    ev_charger_status_entity: sensor.go_echarger_is_charging
    ev_charger_status_state: null
    ev_charger_power_entity: sensor.go_echarger_222819_nrg_12
    ev_charger_power_state: null
    house_power_includes_ev_charger_power: true
    morning_energy_need: 1.5
    solcast_pv_forecast_forecast_today_entity: sensor.solcast_pv_forecast_forecast_today
Skærmbillede 2024-11-15 kl  18 25 12 Skærmbillede 2024-11-15 kl  18 25 28

@Extati
Copy link

Extati commented Nov 15, 2024

In System logs i also get this error now after the update.

Skærmbillede 2024-11-15 kl  20 19 20 Skærmbillede 2024-11-15 kl  20 19 32

@woopstar
Copy link
Owner Author

What logs do you wanna see? The working sensor is empty. FYI: I use the standard names from Huawei solar intergration. Also my net consumption is: Unknown / Ukendt ?

Hope you can see something from this:

It did. Net consumption was not calculated because you don't have a charger. If no net consumption the sensor does not work. Can you update to 1.0.2 and see if it fixes the issue.

@Extati
Copy link

Extati commented Nov 15, 2024

It did. Net consumption was not calculated because you don't have a charger. If no net consumption the sensor does not work. Can you update to 1.0.2 and see if it fixes the issue.

I have an EV Charger, but it is a Clever, so can't get it in, before I get my Shelly 3EM.
Now I can't get pass the EV charger setup.

Skærmbillede 2024-11-15 kl  21 00 58

@woopstar
Copy link
Owner Author

It did. Net consumption was not calculated because you don't have a charger. If no net consumption the sensor does not work. Can you update to 1.0.2 and see if it fixes the issue.

I have an EV Charger, but it is a Clever, so can't get it in, before I get my Shelly 3EM. Now I can't get pass the EV charger setup.

Skærmbillede 2024-11-15 kl 21 00 58

can you try the latest release 1.0.3. It should be fixed now.

@Extati
Copy link

Extati commented Nov 16, 2024

can you try the latest release 1.0.3. It should be fixed now.

Now I got past it, and looks correct whit the working sensor now.

Only thing now, is I'm not sure I use the right sensor for "Huawei solar inverter active power control state entity" We don't have any sensor named that whit the standard config from Huawei solar integration. We have "sensor.inverter_efficiency" - I assume that is the correct one?

Thanks again for a very quick fix.

@woopstar
Copy link
Owner Author

can you try the latest release 1.0.3. It should be fixed now.

Now I got past it, and looks correct whit the working sensor now.

Only thing now, is I'm not sure I use the right sensor for "Huawei solar inverter active power control state entity" We don't have any sensor named that whit the standard config from Huawei solar integration. We have "sensor.inverter_efficiency" - I assume that is the correct one?

Thanks again for a very quick fix.

The sensor sensor.inverter_active_power_control is disabled by default in the Huawei integration. You need to to the the Huawei integration and click the entities that are hidden for the inverter. Then enable the entity by clicking it.

@Extati
Copy link

Extati commented Nov 16, 2024

The sensor sensor.inverter_active_power_control is disabled by default in the Huawei integration. You need to to the the Huawei integration and click the entities that are hidden for the inverter. Then enable the entity by clicking it.

Ah okay, I saw it yesterday, but didn't think that it was that. After your picture yours says limited to 100%, where mine says unlimited. I have now activated it, and make the hole setup again.

Again, thank you so much for the effort you put in this.
Also appreciate the quick replies.

@Extati
Copy link

Extati commented Nov 26, 2024

Not sure if you want me to open a issue or not, but it looks like we don't have sensor.batteries_rated_capacity under inverter or batteries that can be enabled. Only rated_capacity is under the PEES intergration, but that is from a input and not as a sensor.

Can you see were you have sensor.batteries_rated_capacity from evt.?

@woopstar
Copy link
Owner Author

Not sure if you want me to open a issue or not, but it looks like we don't have sensor.batteries_rated_capacity under inverter or batteries that can be enabled. Only rated_capacity is under the PEES intergration, but that is from a input and not as a sensor.

Can you see were you have sensor.batteries_rated_capacity from evt.?

I have it under Diagnostics for Batteries:

image

@woopstar
Copy link
Owner Author

I'm running 1.5.0a1 of Huawei integration

@Extati
Copy link

Extati commented Nov 26, 2024

I'm running 1.5.0a1 of Huawei integration

Ah, must be the reason then. On Public release 1.4.1 we don't have that option.
Maybe you can add, so both old, and new method for SOC can be used?

@woopstar
Copy link
Owner Author

I'm running 1.5.0a1 of Huawei integration

Ah, must be the reason then. On Public release 1.4.1 we don't have that option. Maybe you can add, so both old, and new method for SOC can be used?

Let me check when 1.5.0 will be out. I think it's soon. Rather use the option.

Until then, we could create an input helper type Number, and set it to 0 to x.000 Watts. So if you have 10kWh battery, set it to 10.000

Would that work?

@Extati
Copy link

Extati commented Nov 26, 2024

Yes, that should work in theory.
Else you chould make it so it also could pull the data from the "Huawei_solar_pees" intergration, it uses the sensor called:

input_number.battery_rated_capacity

Don't know what makes the most sense to use.

@woopstar
Copy link
Owner Author

Yes, that should work in theory. Else you chould make it so it also could pull the data from the "Huawei_solar_pees" intergration, it uses the sensor called:

input_number.battery_rated_capacity

Don't know what makes the most sense to use.

v1.2.2 should fix this and allow input_number for the sensor.

@Extati
Copy link

Extati commented Nov 26, 2024

v1.2.2 should fix this and allow input_number for the sensor.

Great work as always. Will test later and let you know if I have any errors.

@woopstar
Copy link
Owner Author

The sensor sensor.inverter_active_power_control is disabled by default in the Huawei integration. You need to to the the Huawei integration and click the entities that are hidden for the inverter. Then enable the entity by clicking it.

Ah okay, I saw it yesterday, but didn't think that it was that. After your picture yours says limited to 100%, where mine says unlimited. I have now activated it, and make the hole setup again.

Again, thank you so much for the effort you put in this.

Also appreciate the quick replies.

Can you screenshot the configuration screens and also all attributes ? Might take a minute or two for the sensor to adapt. But the rated capacity is missing.

@Extati
Copy link

Extati commented Nov 26, 2024

Can you screenshot the configuration screens and also all attributes ? Might take a minute or two for the sensor to adapt. But the rated capacity is missing.

The sensor has not updated yet, I think it's the input helper not giving the data it's needed.

Screenshots of the sensors is here:

Skærmbillede 2024-11-26 kl  20 29 33 Skærmbillede 2024-11-26 kl  20 29 43 Skærmbillede 2024-11-26 kl  20 30 01

And helper is like this:

Skærmbillede 2024-11-26 kl  20 34 34

Looks like its not using the right input sensor for the batteries rated capacity. Try to just configure HSEM. Don't delete the device and re-add it. But configure.

The sensor is set to sensor. And you are using a input_number. So it looks like its using the wrong entity here.

Can't configure again, once it has been setup, can't get pass the EV charger again, as I'm missing one sensor. So are getting the same error as before your fix. Was the same in the other updates, so I have to delete, and restart after every update ;-)

Edit: Just tried to use another sensor for the EV charger to get pass it, and set it up again, seams that you can't change the sensor to an input sensor in this version. So I think the error is there around that area somehow.

@Extati
Copy link

Extati commented Nov 26, 2024

Edit: Just tried to use another sensor for the EV charger to get pass it, and set it up again, seams that you can't change the sensor to and input. So I think the error is there somewere.

Back on v1.1.1 again, and all sensors and work mode is fine again. Will wait until further updates.

@woopstar
Copy link
Owner Author

Back on v1.1.1 again, and all sensors and work mode is fine again. Will wait until further updates.

I found the issue and will soon release 1.2.4, which fixes it. Thank you for testing everything!

@Extati
Copy link

Extati commented Nov 27, 2024

I found the issue and will soon release 1.2.4, which fixes it. Thank you for testing everything!

Great work. Sure, it's a pleasure to test, and see the work you are implementing, to make it better all the time.

@Extati
Copy link

Extati commented Nov 27, 2024

I found the issue and will soon release 1.2.4, which fixes it. Thank you for testing everything!

Updated to 1.2.4. and now it look more right. The only thing that confuses me is the Batteries conversion loss, is still shows as: Ukendt

Also the "Huawei solar batteries tou charging and discharging periods periods" shows: 00:00-00:01/1234567/+ and not the time like in the old versions. Don't know if this is intended or not?

See below sensor settings now in .1.2.4:

Skærmbillede 2024-11-27 kl  17 46 21 Skærmbillede 2024-11-27 kl  17 46 32 Skærmbillede 2024-11-27 kl  17 46 58

@woopstar
Copy link
Owner Author

Updated to 1.2.4. and now it look more right. The only thing that confuses me is the Batteries conversion loss, is still shows as: Ukendt

Will be fixed in #66 - I will release 1.2.5 in a moment to fix it.

The TOU mode is OK. It should change later on.

@Extati
Copy link

Extati commented Nov 27, 2024

The TOU mode is OK. It should change later on.

Indeed it did - so far all seams good - I would say 1.2.5 is stable and working perfect so far.

@woopstar woopstar changed the title Feedback: Home Assistant Energy Sensors Feedback Dec 6, 2024
@woopstar woopstar added the help wanted Extra attention is needed label Dec 6, 2024
@Extati
Copy link

Extati commented Dec 11, 2024

Just for everyone to know, version 2.0.0 is super great, stabe and charging/discharging is so far spot on.
Great work as always.

@Extati
Copy link

Extati commented Dec 18, 2024

Update 2.1.0 have a fault when you update from a working intergratin you get an error saying that you are missing inputs, when you try to config, you again can't get pass the EV charger page..

@woopstar
Copy link
Owner Author

Update 2.1.0 have a fault when you update from a working intergratin you get an error saying that you are missing inputs, when you try to config, you again can't get pass the EV charger page..

2.1.1 should fix the issue. Just published it.

@Extati
Copy link

Extati commented Dec 18, 2024

2.1.1 should fix the issue. Just published it.

Indeed it did - Thanks again for the quick fix as always.

@Extati
Copy link

Extati commented Feb 21, 2025

After update 3.0 all my sensors show just 0.0 kwh. The only one that shows something hourly is utility_meter hourly. It will not buy any power from the grid, even if all inputs are filled correctly. Anyone else experiencing the same error? I have deleted the integration and set it up again, but the same error and sensor logic occurs again.

Also the sensor for the active hour seams to be very High.

Image
Image

@Extati
Copy link

Extati commented Feb 21, 2025

Update: Back on version 2.2.0 and everything is fine again - All sensors show correct data now.

Where is the data keep's from the sensor for the diffrent days? I tried to purge the hole HA database, but it somehow still know some of the sensor historic on both version 3.0 and on the old 2.2.0 - Just wanted to test if it helps to clear some of the sensor, but on version 3.0 it still shows 0 on most of the sensors as above picture, trust that HSEM display OK.

For information I'm on version 1.5.4 on the Huawei Solar integration, but that shouldn't effect anything despite version 2.2.0 works. Can't seam to find why version 3.0 don't work on my system.

@heinoskov
Copy link
Collaborator

In developer tools --> Statistics - you can search for HSEM and select those you want to delete..

@woopstar
Copy link
Owner Author

After update 3.0 all my sensors show just 0.0 kwh. The only one that shows something hourly is utility_meter hourly. It will not buy any power from the grid, even if all inputs are filled correctly. Anyone else experiencing the same error? I have deleted the integration and set it up again, but the same error and sensor logic occurs again.

Also the sensor for the active hour seams to be very High.

Image
Image

How long did you run for ? V3.0.0 introduces new energy sensors as the ones in 2.2.0 is wrong. This also means when you upgrade the sensors will reset and it will take up to 14 days before they find themselves again.

@Extati
Copy link

Extati commented Feb 21, 2025

I ran the new version since release? Just funny why they are unavailable or is it just me? I will wipe the hole integration now, delete all old sensors and try version 3.0.0 again. Just saw the we didn't purchased any power doing night and day, and I would assume it already would have done that?

@woopstar
Copy link
Owner Author

I ran the new version since release? Just funny why they are unavailable or is it just me? I will wipe the hole integration now, delete all old sensors and try version 3.0.0 again. Just saw the we didn't purchased any power doing night and day, and I would assume it already would have done that?

The power sensors are unavailable when they are not measuring.

If they are reporting 0.0 as state, it will be part of the calculations giving wrong energy calculations. So they are intentionally unavailable to make sure counts / measurements stops in the particular hour.

You should look into the Energy Avg sensors. They should start to have value as time passes.

@Extati
Copy link

Extati commented Feb 21, 2025

I ran the new version since release? Just funny why they are unavailable or is it just me? I will wipe the hole integration now, delete all old sensors and try version 3.0.0 again. Just saw the we didn't purchased any power doing night and day, and I would assume it already would have done that?

The power sensors are unavailable when they are not measuring.

If they are reporting 0.0 as state, it will be part of the calculations giving wrong energy calculations. So they are intentionally unavailable to make sure counts / measurements stops in the particular hour.

You should look into the Energy Avg sensors. They should start to have value as time passes.

Yes, but after 3 days the day 1 sensor and day 3 still showed 0 - I can also see in the log, that it is schedule 1 that has a little bit of data, and not schedule 2 - I don't know where the error is. I will try to run it a day or two more, but I don't think it will help.

This is the log so far..

hsem.log

Edit: This is the day 1 sensor that shows "Ukendt / Unknown" under measurements?

Tracked entity
sensor.hsem_house_consumption_energy_22_23_utility_meter
Average
1
Hour start
22
Hour end
23
Last updated
21. februar 2025 kl. 22.20.55
Unique ID
hsem_house_consumption_energy_avg_22_23_1d
Measurements
Ukendt

@Extati
Copy link

Extati commented Feb 22, 2025

Update: The log is now going haywire, is already over 10 MB, after a couple of hours, it started to log almost every second.
As you can see, it calculate not to charge the battery, despite there is a small demand and the battery is at 0.

Also all day 1 sensores still shows 0.0 - Version 2.2.0 started filling the sensors a bid after each hours.
Do you need me to do or post anything else, please just let me know.

Edit: It has now made another log file. The first one has over 90.000 lines of debug code already.

First log:
hsem.log
New log:
hsem.log

@woopstar
Copy link
Owner Author

Update: The log is now going haywire, is already over 10 MB, after a couple of hours, it started to log almost every second.
As you can see, it calculate not to charge the battery, despite there is a small demand and the battery is at 0.

Also all day 1 sensores still shows 0.0 - Version 2.2.0 started filling the sensors a bid after each hours.
Do you need me to do or post anything else, please just let me know.

Edit: It has now made another log file. The first one has over 90.000 lines of debug code already.

First log:
hsem.log
New log:
hsem.log

Great. I'll have a look.

Can you also send me the content of home-assistant.log, and also from developer tools search for HSEM and send me a screenshot of the HSEM sensors with its attributes.

@Extati
Copy link

Extati commented Feb 22, 2025

Sure.

Log is here:

home-assistant.log

Screenshots of some of the sensors. Let me know if you need specific ones. As you can see, the utility_meter shows something, but the energy_avg sensor all days are 0.0

Image Image Image Image

Again, really appreciate the support you put into this.

@Extati
Copy link

Extati commented Feb 22, 2025

Also found another thing, as you can see in the log, my schedule 2 is set to be from 17:00 to 23:59 - But when the time hit 23:00 it stop using from the battery, and as you can see in the log, it no longer set a recommendation. despite the time still should be in the schedule 2?

Also the integration has now run for over 24 hours, but it still shows 0.0 in the "days" sensor, and in the log, schedule 2 don't get any info.

hsem.log

@woopstar
Copy link
Owner Author

woopstar commented Feb 23, 2025

@Extati

I think I've found the issue. From the average sensor attributes, you see the tracked entity. This utility meter should exist. Can you verify that?

But I also see that Measurements are "Ukendt," and this is a bug.

Can you manually try to change this in your HA installation, as I think you can do so:

Open the file in the /config folder:

custom_components/hsem/custom_sensors/avg_sensor.py

Go to the line: 176, that contains:

if utility_meter_value is not None and self._measurements is not None:
    self._measurements[current_date.isoformat()] = round(
        float(utility_meter_value), 2
    )

And change it to:

if self._measurements is None:
    self._measurements = {}

if utility_meter_value is not None:
    self._measurements[current_date.isoformat()] = round(
        float(utility_meter_value), 2
    )

Then restart HA. Then you should be able to see the measurements variable contains data, as you can see from this screenshot:

Image

@Extati
Copy link

Extati commented Feb 23, 2025

Yes I see the tracked entity from the utility_meter on each hour.

I changed the code you send me and now all the "day" sensors show data - Yay!

After the restart the battery also is charging now - And make sense as I right now charge my EV and sun is really not there to fill out the battery before 17 - So I assume it works!?

What about the stop of battery usage happening at 23 and not on 23:59 as I have specific in the schedule 2?

A BIG thanks so far for finding the error.

@woopstar
Copy link
Owner Author

Yes I see the tracked entity from the utility_meter on each hour.

I changed the code you send me and now all the "day" sensors show data - Yay!

After the restart the battery also is charging now - And make sense as I right now charge my EV and sun is really not there to fill out the battery before 17 - So I assume it works!?

What about the stop of battery usage happening at 23 and not on 23:59 as I have specific in the schedule 2?

A BIG thanks so far for finding the error.

Awesome. I'll prepare a fix for release.

In regards to the schedules, they actually don't work with minutes yet 😆 I'll start looking into fixing that as I have the same issue. My schedule is also 17.00-23.59

I'm also considering to make a fix so you can schedule 17.00-00.00 for instance. Or 17.00-03.00

@Extati
Copy link

Extati commented Feb 23, 2025

Awesome. I'll prepare a fix for release.

In regards to the schedules, they actually don't work with minutes yet 😆 I'll start looking into fixing that as I have the same issue. My schedule is also 17.00-23.59

I'm also considering to make a fix so you can schedule 17.00-00.00 for instance. Or 17.00-03.00

Haha, okay - It make sense why it stops at 23:00 then 😄

It would be really great it we could set it from 17:00 - 0:00 that would cover most of the "high" prices.

Great work as always, and appreciate the quick fix and support you put into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed skip-changelog
Projects
None yet
Development

No branches or pull requests

3 participants