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

Add support for grid voltage tracking #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Klievan
Copy link

@Klievan Klievan commented May 26, 2021

Added the keys for the grid voltage in the SAJ inverters.

This can be useful for debugging problems along with the local grid operators. When the grid-voltage becomes too high the solar-panels shut off. This happens regularly where I live. It would be nice to be able to log the voltage so this data can be shared with the needed parties if issues arise.

Added the keys for the grid voltage in the SAJ inverters.
@danielszilagyi
Copy link

danielszilagyi commented Jun 6, 2021

Hi,

I think your code is not correct. I wanted to achieve the same, I think these are the correct lines, but I haven't got past this, I don't have experience in Python. Assumed this change would bring the sensors into Home Assistant right away (I modified the code inside the Docker container and HUP'd the HA process)

Anyway, the line voltage values are around the current power value in status.php - counting from zero are the 25th, 27th and 29th items. So I think these would be the correct lines in the Python code (not sure what 11 is for), they need to be divided by 10 also:

            Sensor("v-l1", 31, 25, "/10", "vac_l1", "V", True),
            Sensor("v-l2", 32, 27, "/10", "vac_l2", "V", True),
            Sensor("v-l3", 33, 29, "/10", "vac_l3", "V", True),

My guess is that the first number is a unique ID and the second one is obviously the index which csv column to check in the stats.php, but as I mentioned I'm not a coder, so some validation would be useful.
It would be much appreciated if this feature would be integrated.

Thanks,
Daniel

@danielszilagyi
Copy link

Hi,

I think your code is not correct. I wanted to achieve the same, I think these are the correct lines, but I haven't got past this, I don't have experience in Python. Assumed this change would bring the sensors into Home Assistant right away (I modified the code inside the Docker container and HUP'd the HA process)

Anyway, the line voltage values are around the current power value in status.php - counting from zero are the 25th, 27th and 29th items. So I think these would be the correct lines in the Python code (not sure what 11 is for), they need to be divided by 10 also:

            Sensor("v-l1", 31, 25, "/10", "vac_l1", "V", True),
            Sensor("v-l2", 32, 27, "/10", "vac_l2", "V", True),
            Sensor("v-l3", 33, 29, "/10", "vac_l3", "V", True),

My guess is that the first number is a unique ID and the second one is obviously the index which csv column to check in the stats.php, but as I mentioned I'm not a coder, so some validation would be useful.
It would be much appreciated if this feature would be integrated.

Thanks,
Daniel

I'm pretty sure that's not the right way to post this, but I hope someone, probably the maintainer will read this.

In addition to the above 3 lines in pysaj's __init.py, the Home Assistant SAJ integration's sensor.py also needs to be changed like this:

--- sensor.py.orig 2021-06-07 23:07:40.125099310 +0200
+++ sensor.py 2021-06-07 19:28:02.592746427 +0200
@@ -22,6 +22,7 @@
TEMP_CELSIUS,
TEMP_FAHRENHEIT,
TIME_HOURS,

  • VOLT,
    )
    from homeassistant.core import CALLBACK_TYPE, callback
    from homeassistant.exceptions import PlatformNotReady
    @@ -41,6 +42,7 @@
    "kg": MASS_KILOGRAMS,
    "kWh": ENERGY_KILO_WATT_HOUR,
    "W": POWER_WATT,
  • "V": VOLT,
    "°C": TEMP_CELSIUS,
    }

After adding this and restarting HA I had the voltage sensors in my environment. But I implemented reading the sensors based on https://community.home-assistant.io/t/saj-solar-inverter/111932/47 and added json based sensors for the same at the same time, as a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants