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

Adding support for Multiple Input PCS (0xA5) #200

Open
mjoach opened this issue Oct 31, 2024 · 7 comments
Open

Adding support for Multiple Input PCS (0xA5) #200

mjoach opened this issue Oct 31, 2024 · 7 comments

Comments

@mjoach
Copy link

mjoach commented Oct 31, 2024

Hi and thank you for all this tremendous work, I was just blown away seeing multiple devices report themselves on my LAN!

I am currently trying to pull solar and battery data from a Nichicon system and it works flawlessly. However, as I found out, the relevant data about current electricity consumption is located only on the Multiple Input PCS (class code 0xA5). It is discovered correctly by the integration and a HASS entity is created, but the only data reported is the operation status. Notably, this device is already supported by pyechonet and I am able to poll attribute values from it without issues with a test pychonet program.

What I did so far is I tried adding this class with the attribute of interest (0xE7, Measured instantaneous amount of electricity) to my /homeassistant/custom_components/echonetlite/const.py, line 992, as shown below.

        0xA3: {  # Lighting system
            0xC0: {  # Set scene
                CONF_ICON: "mdi:palette",
                CONF_TYPE: DEVICE_CLASS_ECHONETLITE_LIGHT_SCENE,
                CONF_STATE_CLASS: SensorStateClass.MEASUREMENT,
                TYPE_NUMBER: {
                    CONF_MAXIMUM: 0xFD,
                    CONF_MAX_OPC: 0xC1,
                },
            },
        },
        
        0xA5: {  # Multiple Input PCS 
            0xE7: {
                CONF_TYPE: SensorDeviceClass.POWER,
                CONF_STATE_CLASS: SensorStateClass.MEASUREMENT,
            },
        },  

However, I did not observe any additional sensors for this entity appear in HASS, despite restarting HASS and removing and re-adding relevant Echonetlite devices.

What am I missing? What else is needed for attributes of this device to become sensors in HASS? For reference, here's the relevant specification for device class 0xA5 (see PDF page 500).
https://echonet.jp/wp/wp-content/uploads/pdf/General/Standard/Release/Release_P/Appendix_Release_P_E.pdf

Thank you in advance for any pointers!

@nao-pon
Copy link
Collaborator

nao-pon commented Dec 26, 2024

We need a class in pychonet that will convert the raw data into a useful value.

For example, HomeSolarPower.py.

And we need to define that class so that the Factory can use it.

https://github.com/scottyphillips/pychonet/blob/93e906055c98df43e48e7449cb3546979474e2fc/pychonet/__init__.py#L44C1-L77C6

@nao-pon
Copy link
Collaborator

nao-pon commented Dec 26, 2024

As mentioned in #205, battery storage and other factors will also be involved in a complex way.

It would be costly to digitize all parameters, so please let us know which parameters you would like to prioritize in order to make them useful for HA.

@nao-pon
Copy link
Collaborator

nao-pon commented Dec 26, 2024

Please try the edge version of my repository. I can't test it, but I've implemented the code.

You can install the edge version by registering as a custom repository in HACS. You can also revert to the original version at any time.

Rel.

@SudarshanKulakrni
Copy link

SudarshanKulakrni commented Dec 27, 2024

Thank you nao-pon san.
I am beginner to Homeassistant, yet to explore HACS and custom repositories.

I have taken your edge version and directly copied to config/custom_component (after taking backup).
Now it has started showing values for 0Xe7 (Measured instantaneous amount of electricity).
I will monitor this value today (looks like a sunny day :)) and will report you the result.

Again thank you very much for late night work !

@SudarshanKulakrni
Copy link

SolarPanel

Hi Nao-Pon san,

I could capture the current status :

  1. Coming from Battery : sensor.solar_measured_instantaneous_charging_discharging_electric_energy
  2. Coming from solar panels : sensor.solar_measured_instantaneous_amount_of_electricity_generated
  3. From PCS : sensor.solar_measured_instantaneous_amount_of_electricity

Actual Nichicon panel, the amount of electricity generated is 2.0 Kw. This is not displayed in any of the 3 entities above.
Its confusing as how Nichicon is calculating this value.

Charging power matches perfectly with 充電 on Battery symbol.

@mjoach
Copy link
Author

mjoach commented Dec 27, 2024

@nao-pon, thank you so much for providing a modified version, I will test it during the holidays.

@SudarshanKulakrni it seems we may have the same Nichicon system. I was able to get all the data from the Nichon panel you pictured, currently by using pychonet directly to query the Multiple Input PCS and feeding results to Home Assistant. However, the data about the instantaneous power consumed by the household appliances (i.e., excluding charging/discharging of the battery) is reported only in an extended field for which I did not find official Echonet specification and is perhaps manufacturer specific. I'll provide more information on that later.

@SudarshanKulakrni
Copy link

@mjoach san, Great to hear that we are using same systems and you were able to get all the data.

How did you use the pychonet directly ?
I mean are there any extra steps other than coping the files from custom_components\echonetlite provided by @nao-pon san.

Btw, another interesting find : There is a App called Echonetscanner for iPhone. If you are on same wifi network as the Solar system, you can see all the properties provided by the devices.
There are few undocumented properties. However, I could not figure out meaning of any of the others, and also could not find any property providing addition of inputs for PCS.

Your input on using the pychonet library to feed value to HA will be greatly appreciated.

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

No branches or pull requests

3 participants