Git Product home page Git Product logo

ha-ferroamp's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ha-ferroamp's Issues

Sensors not working

Hi

Since 28/3 my sensors are not updating. I sent in a ticket to Ferroamp and they enabled MQTT again as I thought that they might have disabled it during some update. But it is still not working. Do you know of any issues?
See attached pictures for examples.

Best Regards

Monewalker

ferroampsensor
ferroampsensors2

Sensor Cost?

What are these sensors?

image

sensor.energyhub_14_external_energy_consumed_cost
sensor.energyhub_14_external_energy_consumed_cost

Can't find any references in source for these.

Battery entities not able to choose in Energy Dashboard

Hi.

I am not able to setup these two in energy dashboard. They don’t even show up as entities in the list when choosing battery consumption or production. Are they defined in correct way?

Battery Energy Produced
Battery Energy Consumed

TIA
—Andreas

Deprecation warning

Just fyi :)
2022-06-02 10:46:21 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that uses deprecated async_get_registry to access device registry, use async_get instead. Please report issue to the custom component author for ferroamp using this method at custom_components/ferroamp/init.py, line 57: device_registry = await dr.async_get_registry(hass)

Frequent log error

Getting the below error in log.

Logger: homeassistant.util.logging
Source: util/logging.py:114
First occurred: 14 april 2022 14:40:57 (89436 occurrences)
Last logged: 09:38:30

Exception in ehub_event_received when handling msg on 'extapi/data/ehub': '{"wloadconsq": {"L2": "22297530351747", "L3": "23128929514531", "L1": "15106482872539"}, "iloadd": {"L2": "0.120", "L3": "-0.416", "L1": "-0.061"}, "wextconsq": {"L2": "19975740691464", "L3": "20570665882684", "L1": "13471409102115"}, "ppv": {"val": "9173.195"}, "iext": {"L2": "12.596", "L3": "12.867", "L1": "12.439"}, "iloadq": {"L2": "0.173", "L3": "-0.100", "L1": "0.525"}, "iace": {"L2": "0.000", "L3": "0.000", "L1": "0.000"}, "ul": {"L2": "230.956", "L3": "231.420", "L1": "231.171"}, "pinvreactive": {"L2": "269.952", "L3": "273.113", "L1": "284.425"}, "ts": {"val": "2022-04-30T07:37:29UTC"}, "ploadreactive": {"L2": "19.597", "L3": "-68.074", "L1": "-9.971"}, "state": {"val": "4101"}, "wloadprodq": {"L2": "3677347997", "L3": "5058439197", "L1": "3783842710"}, "pinv": {"L2": "-2905.948", "L3": "-2939.932", "L1": "-2933.173"}, "iextq": {"L2": "-17.621", "L3": "-18.066", "L1": "-17.419"}, "pext": {"L2": "-2877.695", "L3": "-2956.296", "L1": "-2847.355"}, "wextprodq": {"L2": "2197000372066", "L3": "2134889525966", "L1": "2756603170887"}, "wpv": {"val": "14004333677939"}, "winvconsq": {"L2": "58709692914", "L3": "37641033192", "L1": "122371452668"}, "pextreactive": {"L2": "289.550", "L3": "205.039", "L1": "274.454"}, "udc": {"neg": "-380.526", "pos": "381.101"}, "sext": {"val": "8762.339"}, "iextd": {"L2": "1.773", "L3": "1.253", "L1": "1.679"}, "ild": {"L2": "1.653", "L3": "1.669", "L1": "1.740"}, "pload": {"L2": "28.253", "L3": "-16.364", "L1": "85.818"}, "ilq": {"L2": "-17.794", "L3": "-17.966", "L1": "-17.944"}, "winvprodq": {"L2": "4387765307717", "L3": "4530226752292", "L1": "4384214075035"}, "il": {"L2": "12.639", "L3": "12.758", "L1": "12.750"}}' Traceback (most recent call last): File "/config/custom_components/ferroamp/sensor.py", line 137, in ehub_event_received update_sensor_from_event(event, ehub, store) File "/config/custom_components/ferroamp/sensor.py", line 131, in update_sensor_from_event sensor.add_event(event) File "/config/custom_components/ferroamp/sensor.py", line 623, in add_event self.process_events(now) File "/config/custom_components/ferroamp/sensor.py", line 630, in process_events if self.update_state_from_events(temp): File "/config/custom_components/ferroamp/sensor.py", line 752, in update_state_from_events pct = int(float(self.state) / 10) * 10 ValueError: could not convert string to float: 'unknown'
Exception in ehub_event_received when handling msg on 'extapi/data/ehub': '{"wloadconsq": {"L2": "22297543917058", "L3": "23128938050085", "L1": "15106489483673"}, "iloadd": {"L2": "-1.136", "L3": "-0.414", "L1": "1.444"}, "wextconsq": {"L2": "19975740691464", "L3": "20570665882684", "L1": "13471409102115"}, "ppv": {"val": "9184.925"}, "iext": {"L2": "10.836", "L3": "12.909", "L1": "11.000"}, "iloadq": {"L2": "2.647", "L3": "-0.101", "L1": "2.847"}, "iace": {"L2": "0.000", "L3": "0.000", "L1": "0.000"}, "ul": {"L2": "230.502", "L3": "230.921", "L1": "230.577"}, "pinvreactive": {"L2": "268.118", "L3": "271.708", "L1": "282.227"}, "ts": {"val": "2022-04-30T07:37:55UTC"}, "ploadreactive": {"L2": "-185.156", "L3": "-67.600", "L1": "235.433"}, "state": {"val": "4101"}, "wloadprodq": {"L2": "3677347997", "L3": "5058604594", "L1": "3783842710"}, "pinv": {"L2": "-2910.341", "L3": "-2943.063", "L1": "-2932.483"}, "iextq": {"L2": "-15.209", "L3": "-18.125", "L1": "-15.139"}, "pext": {"L2": "-2478.908", "L3": "-2959.555", "L1": "-2468.301"}, "wextprodq": {"L2": "2197062373972", "L3": "2134957641965", "L1": "2756672866318"}, "wpv": {"val": "14004563184133"}, "winvconsq": {"L2": "58709692914", "L3": "37641033192", "L1": "122371452668"}, "pextreactive": {"L2": "82.962", "L3": "204.107", "L1": "517.660"}, "udc": {"neg": "-380.522", "pos": "381.046"}, "sext": {"val": "8015.026"}, "iextd": {"L2": "0.509", "L3": "1.250", "L1": "3.175"}, "ild": {"L2": "1.645", "L3": "1.664", "L1": "1.731"}, "pload": {"L2": "431.433", "L3": "-16.492", "L1": "464.182"}, "ilq": {"L2": "-17.856", "L3": "-18.024", "L1": "-17.986"}, "winvprodq": {"L2": "4387840874949", "L3": "4530303238448", "L1": "4384290381611"}, "il": {"L2": "12.677", "L3": "12.799", "L1": "12.782"}}' Traceback (most recent call last): File "/config/custom_components/ferroamp/sensor.py", line 137, in ehub_event_received update_sensor_from_event(event, ehub, store) File "/config/custom_components/ferroamp/sensor.py", line 131, in update_sensor_from_event sensor.add_event(event) File "/config/custom_components/ferroamp/sensor.py", line 623, in add_event self.process_events(now) File "/config/custom_components/ferroamp/sensor.py", line 630, in process_events if self.update_state_from_events(temp): File "/config/custom_components/ferroamp/sensor.py", line 752, in update_state_from_events pct = int(float(self.state) / 10) * 10 ValueError: could not convert string to float: 'unknown'
Exception in ehub_event_received when handling msg on 'extapi/data/ehub': '{"wloadconsq": {"L2": "22297545643431", "L3": "23128938050085", "L1": "15106491331476"}, "iloadd": {"L2": "-1.135", "L3": "-0.414", "L1": "1.442"}, "wextconsq": {"L2": "19975740691464", "L3": "20570665882684", "L1": "13471409102115"}, "ppv": {"val": "9185.514"}, "iext": {"L2": "10.851", "L3": "12.910", "L1": "10.988"}, "iloadq": {"L2": "2.643", "L3": "-0.101", "L1": "2.843"}, "iace": {"L2": "0.000", "L3": "0.000", "L1": "0.000"}, "ul": {"L2": "230.920", "L3": "230.659", "L1": "230.408"}, "pinvreactive": {"L2": "269.257", "L3": "270.747", "L1": "281.205"}, "ts": {"val": "2022-04-30T07:37:59UTC"}, "ploadreactive": {"L2": "-185.329", "L3": "-67.524", "L1": "234.935"}, "state": {"val": "4101"}, "wloadprodq": {"L2": "3677347997", "L3": "5058670655", "L1": "3783842710"}, "pinv": {"L2": "-2915.945", "L3": "-2941.355", "L1": "-2929.194"}, "iextq": {"L2": "-15.215", "L3": "-18.135", "L1": "-15.136"}, "pext": {"L2": "-2484.383", "L3": "-2957.828", "L1": "-2466.003"}, "wextprodq": {"L2": "2197072304835", "L3": "2134969473089", "L1": "2756682738432"}, "wpv": {"val": "14004608404988"}, "winvconsq": {"L2": "58709692914", "L3": "37641033192", "L1": "122371452668"}, "pextreactive": {"L2": "83.929", "L3": "203.223", "L1": "516.140"}, "udc": {"neg": "-380.545", "pos": "381.070"}, "sext": {"val": "8015.244"}, "iextd": {"L2": "0.514", "L3": "1.246", "L1": "3.168"}, "ild": {"L2": "1.649", "L3": "1.660", "L1": "1.726"}, "pload": {"L2": "431.563", "L3": "-16.473", "L1": "463.190"}, "ilq": {"L2": "-17.858", "L3": "-18.034", "L1": "-17.979"}, "winvprodq": {"L2": "4387852532188", "L3": "4530315003509", "L1": "4384302101529"}, "il": {"L2": "12.691", "L3": "12.800", "L1": "12.769"}}' Traceback (most recent call last): File "/config/custom_components/ferroamp/sensor.py", line 137, in ehub_event_received update_sensor_from_event(event, ehub, store) File "/config/custom_components/ferroamp/sensor.py", line 131, in update_sensor_from_event sensor.add_event(event) File "/config/custom_components/ferroamp/sensor.py", line 623, in add_event self.process_events(now) File "/config/custom_components/ferroamp/sensor.py", line 630, in process_events if self.update_state_from_events(temp): File "/config/custom_components/ferroamp/sensor.py", line 752, in update_state_from_events pct = int(float(self.state) / 10) * 10 ValueError: could not convert string to float: 'unknown'
Exception in ehub_event_received when handling msg on 'extapi/data/ehub': '{"wloadconsq": {"L2": "22297563515019", "L3": "23128947679830", "L1": "15106501056370"}, "iloadd": {"L2": "5.837", "L3": "-5.036", "L1": "-0.079"}, "wextconsq": {"L2": "19975740691464", "L3": "20570665882684", "L1": "13471409102115"}, "ppv": {"val": "9191.379"}, "iext": {"L2": "8.307", "L3": "6.768", "L1": "12.509"}, "iloadq": {"L2": "8.910", "L3": "9.280", "L1": "0.528"}, "iace": {"L2": "0.000", "L3": "0.000", "L1": "0.000"}, "ul": {"L2": "229.878", "L3": "229.521", "L1": "230.824"}, "pinvreactive": {"L2": "268.205", "L3": "268.437", "L1": "285.304"}, "ts": {"val": "2022-04-30T07:38:25UTC"}, "ploadreactive": {"L2": "948.794", "L3": "-817.322", "L1": "-12.894"}, "state": {"val": "4101"}, "wloadprodq": {"L2": "3677347997", "L3": "5058952426", "L1": "3783842710"}, "pinv": {"L2": "-2905.713", "L3": "-2937.068", "L1": "-2948.029"}, "iextq": {"L2": "-8.966", "L3": "-8.817", "L1": "-17.534"}, "pext": {"L2": "-1457.408", "L3": "-1430.963", "L1": "-2861.851"}, "wextprodq": {"L2": "2197130115307", "L3": "2135036611934", "L1": "2756749391479"}, "wpv": {"val": "14004838123153"}, "winvconsq": {"L2": "58709692914", "L3": "37641033192", "L1": "122371452668"}, "pextreactive": {"L2": "1216.999", "L3": "-548.885", "L1": "272.410"}, "udc": {"neg": "-380.540", "pos": "381.036"}, "sext": {"val": "6350.372"}, "iextd": {"L2": "7.487", "L3": "-3.382", "L1": "1.669"}, "ild": {"L2": "1.650", "L3": "1.654", "L1": "1.748"}, "pload": {"L2": "1448.305", "L3": "1506.106", "L1": "86.179"}, "ilq": {"L2": "-17.876", "L3": "-18.097", "L1": "-18.062"}, "winvprodq": {"L2": "4387928214263", "L3": "4530391490324", "L1": "4384378479487"}, "il": {"L2": "12.703", "L3": "12.853", "L1": "12.824"}}' Traceback (most recent call last): File "/config/custom_components/ferroamp/sensor.py", line 137, in ehub_event_received update_sensor_from_event(event, ehub, store) File "/config/custom_components/ferroamp/sensor.py", line 131, in update_sensor_from_event sensor.add_event(event) File "/config/custom_components/ferroamp/sensor.py", line 623, in add_event self.process_events(now) File "/config/custom_components/ferroamp/sensor.py", line 630, in process_events if self.update_state_from_events(temp): File "/config/custom_components/ferroamp/sensor.py", line 752, in update_state_from_events pct = int(float(self.state) / 10) * 10 ValueError: could not convert string to float: 'unknown'
Exception in ehub_event_received when handling msg on 'extapi/data/ehub': '{"wloadconsq": {"L2": "22297571761607", "L3": "23128956293894", "L1": "15106501479659"}, "iloadd": {"L2": "7.491", "L3": "-6.385", "L1": "-0.086"}, "wextconsq": {"L2": "19975740691464", "L3": "20570665882684", "L1": "13471409102115"}, "ppv": {"val": "9194.053"}, "iext": {"L2": "8.024", "L3": "5.679", "L1": "12.531"}, "iloadq": {"L2": "11.452", "L3": "11.996", "L1": "0.532"}, "iace": {"L2": "0.000", "L3": "0.000", "L1": "0.000"}, "ul": {"L2": "229.003", "L3": "229.053", "L1": "230.692"}, "pinvreactive": {"L2": "267.670", "L3": "267.080", "L1": "283.836"}, "ts": {"val": "2022-04-30T07:38:30UTC"}, "ploadreactive": {"L2": "1213.014", "L3": "-1034.146", "L1": "-14.029"}, "state": {"val": "4101"}, "wloadprodq": {"L2": "3677347997", "L3": "5058952426", "L1": "3783842710"}, "pinv": {"L2": "-2899.997", "L3": "-2941.283", "L1": "-2949.769"}, "iextq": {"L2": "-6.457", "L3": "-6.164", "L1": "-17.551"}, "pext": {"L2": "-1045.579", "L3": "-998.352", "L1": "-2862.987"}, "wextprodq": {"L2": "2197136383354", "L3": "2135042685032", "L1": "2756763720037"}, "wpv": {"val": "14004866664001"}, "winvconsq": {"L2": "58709692914", "L3": "37641033192", "L1": "122371452668"}, "pextreactive": {"L2": "1480.684", "L3": "-767.066", "L1": "269.807"}, "udc": {"neg": "-380.546", "pos": "381.029"}, "sext": {"val": "6029.114"}, "iextd": {"L2": "9.144", "L3": "-4.736", "L1": "1.654"}, "ild": {"L2": "1.653", "L3": "1.649", "L1": "1.740"}, "pload": {"L2": "1854.417", "L3": "1942.931", "L1": "86.782"}, "ilq": {"L2": "-17.909", "L3": "-18.160", "L1": "-18.083"}, "winvprodq": {"L2": "4387942728899", "L3": "4530406177488", "L1": "4384393231338"}, "il": {"L2": "12.713", "L3": "12.900", "L1": "12.849"}}' Traceback (most recent call last): File "/config/custom_components/ferroamp/sensor.py", line 137, in ehub_event_received update_sensor_from_event(event, ehub, store) File "/config/custom_components/ferroamp/sensor.py", line 131, in update_sensor_from_event sensor.add_event(event) File "/config/custom_components/ferroamp/sensor.py", line 623, in add_event self.process_events(now) File "/config/custom_components/ferroamp/sensor.py", line 630, in process_events if self.update_state_from_events(temp): File "/config/custom_components/ferroamp/sensor.py", line 752, in update_state_from_events pct = int(float(self.state) / 10) * 10 ValueError: could not convert string to float: 'unknown'

ValueError: could not convert string to float: 'e0'

2020-06-13 12:29:45 DEBUG (SyncWorker_36) [custom_components.ferroamp.sensor] {'event': {'soc': {'val': 11.6}, 'temp': {'val': 35.164}, 'wbatcons': {'val': 105440088352}, 'ubat': {'val': 414.308}, 'ibat': {'val': -0.9}, 'relaystatus': {'val': '1'}, 'faultcode': {'val': 'e0'}, 'ts': {'val': '2020-06-13T10:29:45UTC'}, 'id': {'val': '*****'}, 'wbatprod': {'val': 98451395555}}}

Ferroamp integration broke on 2021.8 upgrade

I only see this in the logs:
2021-08-04 16:56:31 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration ferroamp which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

Service calls

When making a service call to control a battery the request is being published continuously to the MQTT topic resulting in the response "Other transaction in progress". This also seems to apply to the request for checking the version of the external API, this could be done with a lower frequency, probably 60s or more.

For each request the the response message should be checked for the corresponding "transId" and if the status is "ack" or not before retrying after a given time.

Possible memory leak

I have installed Debian 11 server latest version, installed HA Core (latest) , HACS, MQTT and ha-ferroamp.
As soon as I enable ha-ferroamp and starts to receive data the server memory slowly decreases until HA crashes., rate is about 1 kb per minute.
To test this I have another instance of HA running with a lot of sensors, this server has been running flawless for about a year.
I installed and enabled ha-ferroamp on this server, as soon as I did this the memory slowly decreases.
There are two components involved, MQTT and ha-ferroamp. I am not sure where the memory is allocated and not released, it could be MQTT or it could be ha-ferroamp.
There are no errors in the logs (I have not enabled debug logs yet).
Versions used:
Home Assistant 2023.3.6
Frontend 20230309.1 - latest

HACS:
Integration version: | 1.31.0
Frontend version: | 20220906112053
Downloaded repositories: | 4

Debian GNU/Linux 11 (bullseye)

Python 3.10.10.

EnergyHub Extapi Version = 1.2.1

My python skills are limited, I am a PHP-coder, I have not read up how variables are allocated in python or their sizes.
It could be that my EnergyHub is manufactured in 2023 and has the latest firmware in it, Ferroamp could have changes something so that data is somewhat different than before.

I will enable debug logging for HA to see if I can get anything useful out of it.
I have the data from the memory sensor if needed.

RuntimeError: Attribute hass is None for Entity after HA upgrade to 0.112.0

After upgrading to Home assistant 0.112 this error appears after first sensor update. Something seems to have changed regarding the hass object.

For each sensor this error is logged and values are not updated.

    update_sensor_from_event(event, sensors, store)
  File "custom_components/ferroamp/sensor.py", line 125, in update_sensor_from_event
    store[sensor.name].set_event(event)
  File "custom_components/ferroamp/sensor.py", line 217, in set_event
    self.update_event(event)
  File "custom_components/ferroamp/sensor.py", line 227, in update_event
    self.async_write_ha_state()
  File "home-assistant/homeassistant/helpers/entity.py", line 283, in async_write_ha_state
    raise RuntimeError(f"Attribute hass is None for {self}")
RuntimeError: Attribute hass is None for <Entity External Voltage: 708>

Add grid frequency

Grid frequency should also be available as a sensor.

Name: gridfreq 
Example: {“val”:<str_fl>} 
Unit: Hz

No history for SSO Relay Status in history-graph

Thanks for a great integration, works like a charm!

I would like to show a history-graphs ideally a bars for various state sensors but i can't get it to work properly.

I've been mucking around with SSO Relay Status (and SSO Fault Code) with configurations like below.

Seems there is no state history for this sensor, is this expected behaviour?

Am I missing something? Im pretty new to HA.

type: history-graph
entities:
  - entity: sensor.energyhub_14_sso_21020540_relay_status
  - entity: sensor.energyhub_14_sso_21020540_relay_status
  - entity: sensor.energyhub_14_sso_21030452_relay_status
  - entity: sensor.energyhub_14_sso_21030613_relay_status
hours_to_show: 24000
refresh_interval: 1

image

Thanks again!

Names for the load balancing sensors

The two sensors for load balancing have the word "reactive" in their names. However, I'm quite sure it should be "active", which can be seen by the character "q" included in the parameter names from the EnergyHub (iavblq_3p and iavblq).

Extapi Version is not updating

It seems that the value for the sensor Ferroamp Extapi Version is not updating its value in the latest release.
image
If i manually set this value to 1.2.0 as example and restart HA the value is not changed.

Nothing changes if I try to publish a MQTT package
image

Minor features

Really nice work ! Thanx for sharing this!
I'll try to help you with the development of this module in the future if needed.

I found some minor features
no icon:
Apparent power
ESO 19110078 State of Charge

Name change?:
ESM %ID% SOH to ESM %ID% State of Health

Sensor value: Unknown
System State of Charge
System State of Health
Total rated capacity of all batteries
ferroamp

Suggestion: Separate sensors for phase load

Hi,
Would first of start to say what an amazing integration, got my energyhub last week. So great work!!
One suggestion from me would be to have separate sensors for each current load, as i would like to monitor my main fuses :)

What do you think about that? :)

Brg
Robin

Entity id already exists error logging

After first startup of this integration, entities are added even though they are already in home assistant, which results in the logging below:

Entity id already exists - ignoring: sensor.ferroamp_sso_pv_string_power

I guess we should check if entity already is in home assistant before calling async_add_entities?

Issue with v1.10.2

I installed latest version two days ago and the fix for v1.10.2 (743cb44) is causing issues with the statistics.

For two days the daily production utility "daily" meter have been completely off. Today showing ~5MWh instead of 40-50kWh.

Checking on the data I can see both days I have had one value reported from Ferroamp that have been off by 18% and 22%, both happening within 15mins around 1400hrs both days.

Attached image shows total energy produced reported around 27MWh, then there is one erroneous at 22MWh, from there on the daily is then at 4.7MWh rather than the ~45kWh.

image

If this fix is to handle an actual reset, why not block down to 90% rather than the current 10% (also it appears to be actually less than 10%). A reset is 100% after all! :)

So, the assumption that wrong data only is 10% less is not accurate.

Grid current doesn’t show correct values

Not sure if this is an error from ferroamp api or this integration but the entity grid current with attributes L1-L3 doesn’t show the same values as the ferroamp portal. Grid power seems to be correct.

Not sure how to check the values coming out of the api but maybe someone can check if the values coming from api is correct or not?

[FR] separated L1, L2 & L3 load

I just received my ferroamp energyhub & integrated straight away with the help of this project - first I just want to thank you for the great work - works beautifully.

One thing I'm missing that I'm capturing through Tibber integration today is the Ampere load on each individual main fuse - L1, L2 & L3 - all I can find is a total load - but I'm interesting to see them separate over time.

Would be great if adding that would be possible as 3 separate sensors

Add sensor for measurement "iavbl"

Measurements iavblq_3p and iavblq are currently exposed as sensors. However, CTEK Chargestorm 2 (SW ccu_R3.11.18.2) is using the measurement iavbl for its integration with the EnergyHub.

Also, note that iavblq_3p and iavblq are calculated as main fuse minus peak current, which is really strange (and useless?), since main fuse is a RMS value (RMS value - peak value).

On the other hand, iavbl is calculated as main fuse minus RMS current, which makes sense (RMS value - RMS value).

So is anyone actually using iavblq_3p and iavblq?

sensor.ferroamp_external_energy_produced is not strictly increasing

The sensor.ferroamp_external_energy_produced has suddenly started to oscillate between two values (723.4 and 723.5). It makes the Energy Dashboard in HA look weird.
image
Maybe this is a bug in the EnergyHub, but would it be possible for the integration to ensure that the values delivered are strictly increasing?

Maybe not so easy to achieve, without causing other problems...

sensor.ferroamp_total_solar_energy suddenly decreasing in value

The new Energy feature of HA is great, but it heavily depends on the inputs to be "state_class":"total_increasing".

I had a sudden drop in the sensor.ferroamp_total_solar_energy (from 532.2 to 443.5), which messed up the Energy feature.

From the database, select * from states where entity_id="sensor.ferroamp_total_solar_energy";

6724537|sensor|sensor.ferroamp_total_solar_energy|532.2|{"state_class":"total_increasing","unit_of_measurement":"kWh","friendly_name":"Total Solar Energy","icon":"mdi:solar-power","device_class":"energy"}|7436277|2021-09-14 07:10:12.056101|2021-09-14 07:10:12.056101|2021-09-14 07:10:12.056101|6724087
6724760|sensor|sensor.ferroamp_total_solar_energy|443.5|{"state_class":"total_increasing","unit_of_measurement":"kWh","friendly_name":"Total Solar Energy","icon":"mdi:solar-power","device_class":"energy"}|7436523|2021-09-14 07:13:14.061745|2021-09-14 07:13:14.061745|2021-09-14 07:13:14.061745|6724537
6724796|sensor|sensor.ferroamp_total_solar_energy|532.2|{"state_class":"total_increasing","unit_of_measurement":"kWh","friendly_name":"Total Solar Energy","icon":"mdi:solar-power","device_class":"energy"}|7436563|2021-09-14 07:13:45.058075|2021-09-14 07:13:45.058075|2021-09-14 07:13:45.058075|6724760

What could be the cause of this?

I have 2 SSOs, and both of the sensor.ferroamp_sso_XXX_total_energy look ok. At this time they had the values 307.3 kWh and 224.9 kWh. So none of them were 443.5 kWh

I have manually fixed the statistics table to fix the Energy view. So I'm not in a urgent need for help, but it would be nice to avoid this in the future.

Remove integration name from entity name

I'm thinking we want to skip the integration name as part of the entity name. Looking at other integrations, it seems like you don't usually include that. It's still clear from entity id and integration name where it comes from. If it's desirable, we could put it in the config flow - "Prefix entity names with integration name" as a checkbox or possibly a text field. But I'm not sure this is needed? The entity id still shows which integration is't part of, should you have multiple Energy Hubs configured.

image

So for example we should just use Consumption Powerinstead of Ferroamp Consumption Power as default name of the entities.

Question: How to keep history for external voltage for each phase?

Wouldn't it be nice to have a a separate sensor for external voltage for each phase for history purposes?

Correct me if i'm wrong, In the current implementation, per phase values are implemented as state attributes and are not recorded.

Phase history is helpful when trying to understand if SSO/EH fault codes are related to grid voltage.

Im using a workaround is to create a template sensor to grab phase voltage..

1.4.0 fix/update not working.

Just upgraded from 1.2 to 1.4, the fix for #76 is breaking the upgrade. For some reason most of my aggregating entities (like total_solar_energy etc) fail to be loaded, they have the value "unknown" after upgrade. Looks ok in the data stream, so must be lost in the conversion somehow, but this causes the new code to break:

val = round(temp / count / 3600000000, self._precision)
            if self._attr_native_value is None or self._attr_state_class != STATE_CLASS_TOTAL_INCREASING or val > float(self._attr_native_value):
                self._attr_native_value = val
                if self._precision == 0:
                    self._attr_native_value = int(self._attr_native_value)
                return True
            else:
                return False

as the "float(self._attr_native_value)" fails when not able to convert "unknown" to a float.

I am having fairly frequent issues with the issue this fix is suppose to fix, unfortunately my python skills are lacking to more than for troubleshooting. :) I reverted the if statement to get it working and now values are showing correctly again.

results after upgrading:
Pasted Graphic

  • Exception in ehub_event_received when handling msg on 'extapi/data/ehub': '{"wloadconsq": {"L2": "11798853816863", "L3": "10979673467307", "L1": "6638586388368"}, "iloadd": {"L2": "2.53", "L3": "1.55", "L1": "0.45"}, "wextconsq": {"L2": "7946365464096", "L3": "6802679818174", "L1": "4436621595469"}, "ppv": {"val": "0.00"}, "iext": {"L2": "3.40", "L3": "2.37", "L1": "1.16"}, "iloadq": {"L2": "3.07", "L3": "2.01", "L1": "0.75"}, "iace": {"L2": "0.00", "L3": "0.00", "L1": "0.00"}, "ul": {"L2": "235.77", "L3": "235.20", "L1": "235.82"}, "pinvreactive": {"L2": "138.37", "L3": "138.04", "L1": "140.07"}, "ts": {"val": "2021-11-03T01:00:16UTC"}, "ploadreactive": {"L2": "421.79", "L3": "257.78", "L1": "75.04"}, "state": {"val": "4101"}, "wloadprodq": {"L2": "19096447874", "L3": "17230314640", "L1": "20651676996"}, "iavbl": {"L2": "9997.77", "L3": "9998.52", "L1": "9999.42"}, "pinv": {"L2": "13.34", "L3": "13.30", "L1": "11.67"}, "iextq": {"L2": "3.15", "L3": "2.09", "L1": "0.82"}, "pext": {"L2": "525.15", "L3": "347.59", "L1": "136.73"}, "wbatcons": {"val": "4392639457542"}, "wextprodq": {"L2": "4370649133629", "L3": "3826985300093", "L1": "5595077240829"}, "wpv": {"val": "42994805534500"}, "winvconsq": {"L2": "95153962670", "L3": "116709288236", "L1": "108896629155"}, "pextreactive": {"L2": "560.16", "L3": "395.82", "L1": "215.11"}, "udc": {"neg": "-375.42", "pos": "375.79"}, "sext": {"val": "1632.59"}, "pbat": {"val": "0.00"}, "iextd": {"L2": "3.36", "L3": "2.38", "L1": "1.29"}, "iavblq_3p": {"val": "9996.85"}, "wbatprod": {"val": "5241033780070"}, "iavblq": {"L2": "9996.85", "L3": "9997.91", "L1": "9999.18"}, "ild": {"L2": "0.83", "L3": "0.83", "L1": "0.84"}, "pload": {"L2": "511.81", "L3": "334.29", "L1": "125.06"}, "ilq": {"L2": "0.08", "L3": "0.08", "L1": "0.07"}, "winvprodq": {"L2": "8079790981513", "L3": "7900565770117", "L1": "7761650195025"}, "il": {"L2": "0.62", "L3": "0.62", "L1": "0.63"}}' Traceback (most recent call last): File "/config/custom_components/ferroamp/sensor.py", line 140, in ehub_event_received update_sensor_from_event(event, ehub, store) File "/config/custom_components/ferroamp/sensor.py", line 134, in update_sensor_from_event sensor.add_event(event) File "/config/custom_components/ferroamp/sensor.py", line 626, in add_event self.process_events(now) File "/config/custom_components/ferroamp/sensor.py", line 633, in process_events if self.update_state_from_events(temp): File "/config/custom_components/ferroamp/sensor.py", line 856, in update_state_from_events or val > float(self._attr_native_value): ValueError: could not convert string to float: 'unknown'

Add support for controlling battery charge/discharge

Here are MQTT endpoints for manually controlling battery charging. These should be exposed as home assistant service or similar.

extapi/control/request
extapi/control/response
extapi/control/result

Examples of request payloads from Ferroamp API doc

Charging with 5000W:

extapi/control/request {"transId":"1",cmd":{"name":"charge","arg":"5000"}}

Discharging with 12 kW:

extapi/control/request {"transId": "1508459760", "cmd":{"name":"discharge","arg":" 12000"}}

Returning control of batteries to system

extapi/control/request {"transId": "989C6E5C-2CC1-11CA-A044-08002B1BB4F5", "cmd": {"name": "auto"}}

Example Responses

{"status": "ack", "msg": "sending cmd to ESOs", "transId": “1”}
{"status": "nak", "msg": "Other transaction in progress", "transId": “128”}
{"status": "nak", "msg": "Max allowed power is 24000 W", "transId": “311”}

Control Status = unavailable after HA restart

Hi
just a minor issue.
After a HA reboot the sensor of "control status" is incorrectly set to "unavailable"
image

By setting the system to any state like auto this issue is then manually solved.

sensor version = v1.12.0
Home Assistant = 2023.4.4
Supervisor = 2023.04.0
Operating System = 9.5
Frontend = 20230411.1 - latest

My workaround for this is by adding a HomeAssistant startup automation like below

alias: Home Assistant - Startup
description: ""
trigger:
  - platform: homeassistant
    event: start
condition: []
action:
  - service: ferroamp.autocharge
    data:
      target: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
mode: single

Non-numeric value

Just noticed this in my log:

Sensor sensor.ferroamp_available_rms_current_for_load_balancing has device class current, state class measurement and unit A thus indicating it has a numeric value; however, it has the non-numeric value: unknown (<class 'str'>); Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.

Ampere on each phase

Hello
Is it possible to add ampere on each phase sensors? I assume it’s available through the api?

Thanks

Standard data types and data length

Hi
I have been busy with other stuff so it took me some time to respond to @argoyle call for tests. and hope that @henricm agrees that it is time to fix this issue.
I have tested new version and it seems to work but there is some issues that was blocking me from using it and that is related to data types standard because I need more accurate numbers in my FA integration in HA

The old version of the code is now blocked after core-2021.5.5 due to missing key and not following the HA code standard so it is time to do something about it and summer time and more to off work coding :)

I have been using the data types below and want you align with the ide so I wont make a PR of is as of now (you can do it if you agree with the change, I have added a link to a updated script below.

The data standard that I recommend is listed below
Integer
W - same as before
°C - No need for decimals to fill up the database. (2 dec before)
V - same as before
VA - same as before
Wh - same as before

Float with one decimal
% - Its just not enough accurate (INT before)
kWh - Logging energy usage per dag (INT before)
A - No need for decimals to fill up the database. (2 dec before)
kW - No need for decimals to fill up the database. (2 dec before)

I made a version of the sensor.py today that fixed the issues above and fixed som naming standard stuff etc.
https://github.com/danielolsson100/ha-ferroamp/blob/danielolsson100-patch-1/custom_components/ferroamp/sensor.py

output example
image
image

Clean up of the instruction to install

Hi,
I got several issues after applying the 2021.8 update.
And the Ferroamp integration doesn't work anymore.

And when I cleaned out the custom_component and follows your guide it doesn't match

Add scan_interval to the scrape documentation

I did notice that there are a new section in the documentation for checking if Ferroamp releases a new firmware version. That is great.
But.....
Default for the scrape function is to poll every 10:th minute and that is way abusive as the release rate of Ferroamp is quite low.
Add scan_interval with the value of 86400 so that polling is done once a day, or once a week with 604800.

scrape:
  - resource: https://support.ferroamp.com/sv-SE/support/solutions/47000522529
    timeout: 10
    scan_interval: 86400
    sensor:
      - name: Ferroamp Latest Version
        select: '.file-card > .fw-no-bullet > li'
        icon: mdi:counter
        index: 0
        value_template: >

System state sensor shown as integer

System state is shown as integer i graphs.

Is there any way of translating these into actual state, Running, Stopped, Fault mode etc?

Or is the documentation lacking?

8 char naming standard of ESM

It seems that FA is using the last 8 values in the ID of the sensors as serial number identifier for ESM / ESO / SSO
I suggest to align this with the same 8 char standard as the SSO change in #31

So that it also applies to the ESM module as described below
In my case the sensor name is "sensor.ferroamp_esm_es01z000019440006_status" as of now.
and I would like to change it to "sensor.ferroamp_esm_19440006_status" for good naming consistency and design.
and perhaps save the "es01z0000" as model info for now.

Note that the output from MQTT needs to be trimmed before because it has some blanc spaces in the end of the ID/val string
{
"status": {
"val": "3"
},
"soc": {
"val": "71.300"
},
"soh": {
"val": "98.100"
},
"ts": {
"val": "2021-07-06T08:28:13UTC"
},
"ratedCapacity": {
"val": "10200.000"
},
"ratedPower": {
"val": "7000.000"
},
"id": {
"val": "ES01Z000019440006 "
}
}

Setup sanity check fails with "MQTT integration is not available"

As I'm new to Home Assistant I can't determine what's the main reason behind this, what's wrong/different with my configuration and why the sanity check (introduced in 704919c) fails. Maybe the filtering by mqtt.DOMAIN is to optimistic?

A little research though shows that I get two entries during the setup from async_entries, the second (I think) is the one that is expected and not the one at index [0].

First entry

{"entry_id": "3207631bce4bed1e1bc8a5aed05053e1", "version": 1, "domain": "mqtt", "title": "MQTT", "data": {}, "options": {}, "pref_disable_new_entities": false, "pref_disable_polling": false, "source": "ignore", "unique_id": null, "disabled_by": null}

Second entry

{"entry_id": "9da04d74c231c5c8e1de355bb8d9a006", "version": 1, "domain": "mqtt", "title": "192.168.???.???", "data": {"broker": "192.168.???.???", "port": 1883, "username": "???", "password": "???", "keepalive": 60, "tls_insecure": true, "protocol": "3.1.1", "transport": "tcp", "discovery": true, "discovery_prefix": "homeassistant", "birth_message": {"topic": "homeassistant/status", "payload": "online", "qos": 0, "retain": false}, "will_message": {"topic": "homeassistant/status", "payload": "offline", "qos": 0, "retain": false}}, "options": {}, "pref_disable_new_entities": false, "pref_disable_polling": false, "source": "user", "unique_id": null, "disabled_by": null}

Incorrectly trying to migrate ESM entity names

When handling ESM events, there seem to be some issue with the migrate_entities for ESMs which have id consisting only of numbers.

This error occurs when the ESM event is parsed:

 2021-07-24 11:08:06 ERROR (MainThread) [homeassistant.util.logging] Exception in esm_event_received when handling msg on 'extapi/data/esm': '{"status": {"val": "3"}, "soc": {"val": "17.700"}, "parentesoid": {"val": "20030049"}, "soh": {"val": "98.800"}, "ts": {"val": "2021-07-24T09:08:06UTC"}, "ratedCapacity": {"val": "10200.000"}, "id": {"val": "20030049"}}'
Traceback (most recent call last):
  File "/Users/henric/.homeassistant/custom_components/ferroamp/sensor.py", line 328, in esm_event_received
    migrate_entities(
  File "/Users/henric/.homeassistant/custom_components/ferroamp/sensor.py", line 508, in migrate_entities
    entity_registry.async_update_entity(
  File "/Users/henric/Projekt/home-assistant/homeassistant/helpers/entity_registry.py", line 390, in async_update_entity
    return self._async_update_entity(
  File "/Users/henric/Projekt/home-assistant/homeassistant/helpers/entity_registry.py", line 463, in _async_update_entity
    raise ValueError(
ValueError: Unique id 'ferroamp_esm_20030049-status' is already in use by 'sensor.ferroamp_esm_20030049_status'

I saw this when switched from a really old version. However, even then I remove the ESM entities, this error occurs so it probably appears on a fresh install too.

It seems like this regex is matching an entity id consisting of only numbers:
REGEX_ESM_ID = re.compile(r"^(.+?)?-?(\d{8})\s*$")
https://github.com/henricm/ha-ferroamp/blob/master/custom_components/ferroamp/const.py#L29

Not sure if that is intended or should it only match when id also contains other characters as described in #35?

Also, is it intentionally that we use -status instead of _status as suffix?

MQTT - Mosquitto broker

Hi, I have installed Ferroamp, and everything seems to work so far. It has found my local IP. My challenge is to set up Configuring Bridges in my Mosquitto broker. Mosquito are already set up and serves the tasmota. I have received the name and password from ferroamp to my Energy MQTT broker. Is it possible for someone to make an example of how this can be set up and where this is done?

SSO naming standard alignment between models

Hi
The Gen2 SSO have to long names with model info AND Serial number and that should perhaps be removed.
image
Example:
SSO-Gen1: FA SSO 19110137 PV String Power
SSO-Gen2: FA SSO PS00990-A04-S21030569 PV String Power
please remove the Part number: "PS00990-A04-S" (and use the last 8 chars in string) in sensor name for SSO sensor types for a more aligned standard between different SSO types.

Problem after upgrading Ferroamp to version 5.2.2

After Ferroamp support upgraded my system I’m not getting any updates on these values EnergyHub External Energy Consumed and EnergyHub External Energy Produced so the energy dashboard are not showing any consumption or production.

HA updated to 0.115.6, error unit_percantage.

Hi!

I updated home assistant to 0.115.6 today and now i get this message after restart.

"File "/config/custom_components/ferroamp/sensor.py", line 14, in
from homeassistant.const import (
ImportError: cannot import name 'UNIT_PERCENTAGE' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)"

Control maximum export from HA

I don't know if it's okay to make a feature request as an issue so please remove it if not.

Currently we have a new problem with negative electric prices when the sunshine as best.
I have contacted Ferroamp but now their support email is closed.

They have a feature on their portal to limit the export of electricity, but i don't know if it's available to mqtt. Anyhow i will keep trying to contact them, as the new electricity prices makes it necessary to limit the export of solar energy.

I suggest that is this repository could include that option.

I will add info here if I receive an answer from Ferroamp.

Kind regards
Ludvig Derning

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.