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

Allow retrieving values for unknown EPC codes #76

Open
mjoach opened this issue Nov 1, 2024 · 0 comments
Open

Allow retrieving values for unknown EPC codes #76

mjoach opened this issue Nov 1, 2024 · 0 comments

Comments

@mjoach
Copy link

mjoach commented Nov 1, 2024

Hi, this is partially related but a distinct issue from the one I opened in the HASS integration repository. I'm new to the Echonet, so apologies if I am confusing some concepts or nomenclature.

I am trying to extract instantaneous energy consumption values from the Multiple Input PCS device (0x02A5) and I realized that it actually hides this information behind an EPC code that is reported by the device but listed as Unknown (0xF5). I had no luck finding any documentation for it in Echonet specs yet, so I am suspecting it may be a device-specific custom field.

Now, the issue is that if I call update() method on the EchonetInstance with the said unlisted 0xF5 code, I will get an empty result, unless this EPC code is explicitly added to epc.py for this device class. This, however, may not be a great idea if it is indeed a manufacturer-specific EPC. So I am wondering if perhaps the update() method should instead be changed to allow for returning responses as long as the EPC code is part of the discovered valid EPC codes? Currently, I got it work by adding the final elif at the bottom, though perhaps it could just entirely replace the elif above it?

** EchonetInstance.py, line 210: **

                elif epc in list(
                    EPC_CODE[self._eojgc][self._eojcc].keys()
                ):  # return hex value if EPC code exists in class but no function found
                    returned_json_data.update(
                        {
                            epc: self._api._state[self._host]["instances"][self._eojgc][
                                self._eojcc
                            ][self._eojci][epc].hex()
                        }
                    )

               #----- added to handle undeclared EPCs ---------
                elif epc in self.getGetProperties(): #return hex value for EPC codes that are Unknown but reported by device
                    returned_json_data.update(
                        {
                            epc: self._api._state[self._host]["instances"][self._eojgc][
                                self._eojcc
                            ][self._eojci][epc].hex()
                        }
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

1 participant