-
Notifications
You must be signed in to change notification settings - Fork 43
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
Adding support for Multiple Input PCS (0xA5) #200
Comments
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. |
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. |
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. |
Thank you nao-pon san. I have taken your edge version and directly copied to config/custom_component (after taking backup). Again thank you very much for late night work ! |
Hi Nao-Pon san, I could capture the current status :
Actual Nichicon panel, the amount of electricity generated is 2.0 Kw. This is not displayed in any of the 3 entities above. Charging power matches perfectly with 充電 on Battery symbol. |
@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. |
@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 ? 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. Your input on using the pychonet library to feed value to HA will be greatly appreciated. |
I was relieved to see that some of the data was retrieved using the code I implemented. If we can figure out the specifications for retrieving data similar to that of Nichicon control panel, I think it should be possible to retrieve it with a bit of ingenuity. |
Hi @mjoach It will be great if you can share information on how or use pychonet to query all inputs to PCS, and how did you feed the information to Homeassistant. Appreciate your help ! |
@nao-pon and @SudarshanKulakrni, I'm sorry for the late reply, life got in the way. I have been testing the edge version for the past couple of days and it is pulling the data from my PCS correctly, thank you for that! This is, however, where things get somewhat complicated. I noticed that the 3 values reported by the PCS 1) update only when the battery is in a state different than standby 2) do not include the information about the energy consumption of the household itself (just the information about battery charging/discharging). This heavily limits its usefulness as I assume that most users of this system expect to be able to monitor their energy consumption continuously and this is not provided by these fields. However, when querying Echonet devices on my network, I can see that this Multiple Input PCS, in addition to the 0xe0,0xe3,0xe7 attributes also allows to read attributes 0xf5 and 0xf6. I wasn't able to find any documentation about them, so by observing what is going on I could see that:
These are the values normally observed on the LCD monitor of the system. 0xf6 is another 16 byte field, where:
Now, I think the first questions would be, are these quirks specific to this particular device or is it a newer part of the standard? And if they are not part of the standard, is there a way to manually configure fetching them in HASS? Finally, @SudarshanKulakrni if you want to skip ahead and try it with your system, I have uploaded my code to feed this data to HASS here: TL;DR for @nao-pon: |
Hi @mjoach That is a wonderful finding on 0xF5 and xF6 ! Genius indeed. |
@SudarshanKulakrni, so in case this was unclear, Pychonet is the underlying Python library that this HASS addon relies on. The code I shared with you is just a Python program that is entirely independent from HASS and uses Pychonet library directly to poll the PCS. You can run it on anything that can run Python. I am running it on my Ubuntu home server that is also hosting my Home Assistant installation, as this is the natural choice. Just run the Python program and keep it on 24/7. The only curveball is, however, that rather than install Pychonet via pip, you will have to pull the repository code, modify the line I shared in my previous message and use this altered version until a better approach is devised. |
@mjoach Thank you for letting us know the useful information! The quickest way to deal with quirks of each manufacturer is to hard-code them, but there is a concern that this will become unmanageable later, so I think we should think carefully about the specifications and make them extensible. Please give me a little more time. |
Thank you so much @mjoach for going out of way to write the program. The code you provided in NichiconPCS2MQTT.py is able to connect to the Broker. I can see the log from this program and log on MQTT on HASS. However the code fails in EchonetInstance.py, with following traceback, it shows the carets on final line appear below [self._eojgc]. I must be missing something. Have you come across this issue ? Traceback (most recent call last):
File "/home/sudarshan/Downloads/nichicon/NichiconTribridPCS-main/NichiconPCS2MQTT.py", line 206, in <module>
asyncio.run(main(sys.argv))
~~~~~~~~~~~^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.13/asyncio/runners.py", line 194, in run
return runner.run(main)
~~~~~~~~~~^^^^^^
File "/usr/lib64/python3.13/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/usr/lib64/python3.13/asyncio/base_events.py", line 721, in run_until_complete
return future.result()
~~~~~~~~~~~~~^^
File "/home/sudarshan/Downloads/nichicon/NichiconTribridPCS-main/NichiconPCS2MQTT.py", line 152, in main
pcs = Factory(pcs_IP, server, 0x02, 0xA5, 1)
File "/usr/local/lib/python3.13/site-packages/pychonet-2.6.13-py3.13.egg/pychonet/__init__.py", line 84, in Factory
return EchonetInstance(host, eojgc, eojcc, eojci, server)
File "/usr/local/lib/python3.13/site-packages/pychonet-2.6.13-py3.13.egg/pychonet/EchonetInstance.py", line 56, in __init__
self._epc_data = self._api._state[self._host]["instances"][self._eojgc][
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
KeyError: 2
|
I have merged the PR that addressed the standard Multiple Input PCS. I will also create a new ticket to address the manufacturer's quirks. |
It's new PR. |
You can try it with the edge version of my repository. Could you please confirm that it works? |
Hi @nao-pon さん、 Thank you so much for working on this ! With yesterday's code change I have started getting 2 new entities
However values for both the entities are shown as "Unknown". Attaching the entities that are displayed for the PCS. |
I tried to fix the quirks by referring to https://github.com/mjoach/NichiconTribridPCS/blob/main/NichiconPCS2MQTT.py. Please re-download edge and try again. |
hello @nao-pon .
私の環境ですと、edgeを利用して再ダウンロード後、エンティティがデバイスを再登録しても出てこない状態です。 |
@yuina1056 Is the PCS manufacturer Nichicon? This does not apply to any other manufacturer than Nichicon, but in any case, if you could attach a debug log showing how the HA starts up completely, i can determine whether it is possible to support the product. |
We are currently debugging and testing in #209. If you are able to join, please join us there. |
This is the debug log at startup. Thank you for your help. |
I had ChatGPT format the relevant part. Looking at "getmap", unfortunately, it seems that the data at 0xF5 and 0xF6 cannot be obtained on this model. {
"eojcc": 0xA5,
"eojci": 0x01,
"eojgc": 0x02,
"getmap": [
0x80, 0x81, 0x82, 0x83, 0x86, 0x88, 0x89, 0x8A, 0x8C, 0x8D,
0x93, 0x97, 0x98, 0x9D, 0x9E, 0x9F, 0xD0, 0xE0, 0xE3, 0xE7, 0xE8
],
"host": "192.168.0.5",
"host_product_code": null,
"manufacturer": "Nichicon",
"name": null,
"ntfmap": [0x80, 0x81, 0x88],
"setmap": [0x81, 0x93, 0x97, 0x98],
"uid": "00006c30303030313930343442393346",
"uidi": "00006c30303030313930343442393346-2-165-1"
} |
Thank you for confirming. |
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.
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!
The text was updated successfully, but these errors were encountered: