echonetlite_homeassistant
echonetlite_homeassistant copied to clipboard
using echonetlite
Hi, Thanks for doing this project - i really love it. I live in japan and it makes it easy to use smart devices with home assistant.
i have the following devices integrated with echonetlite
- Panasonic eolia aircons (2)
- rinnai water heaters
- my refrigerator
- panasonic advance lighting (9 lights)
- huawei solar panels
I got lots of chatty warnings - if it would be helpful for anyone to see these warnings to help improve the code, please let me know.
i'm also interested in trying to figure out how to get my smart meter data from my huawei solar system - it seems the data is missing in echonetlite, but it's present in the huawei smart logger.
i gave a sampling of some of the warnings below.
2023-11-30 12:06:22.992 WARNING (MainThread) [py.warnings] /config/custom_components/echonetlite/sensor.py:450: RuntimeWarning: coroutine 'ServiceRegistry.async_call' was never awaited
self._hass.services.async_call(
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/pychonet/echonetapiclient.py", line 115, in echonetMessageReceived
if epc not in self._state[host]["instances"][seojgc][seojcc][seojci] or self._state[host]["instances"][seojgc][seojcc][seojci][epc] != opc["EDT"]:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
KeyError: 15
2023-11-30 12:05:18.937 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/pychonet/echonetapiclient.py", line 115, in echonetMessageReceived
if epc not in self._state[host]["instances"][seojgc][seojcc][seojci] or self._state[host]["instances"][seojgc][seojcc][seojci][epc] != opc["EDT"]:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
KeyError: 15
2023-11-30 12:05:18.938 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/pychonet/echonetapiclient.py", line 115, in echonetMessageReceived
if epc not in self._state[host]["instances"][seojgc][seojcc][seojci] or self._state[host]["instances"][seojgc][seojcc][seojci][epc] != opc["EDT"]:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
KeyError: 15
2023-11-30 12:05:20.476 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/pychonet/echonetapiclient.py", line 115, in echonetMessageReceived
if epc not in self._state[host]["instances"][seojgc][seojcc][seojci] or self._state[host]["instances"][seojgc][seojcc][seojci][epc] != opc["EDT"]:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
KeyError: 15
2023-11-30 12:05:20.477 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/pychonet/echonetapiclient.py", line 115, in echonetMessageReceived
if epc not in self._state[host]["instances"][seojgc][seojcc][seojci] or self._state[host]["instances"][seojgc][seojcc][seojci][epc] != opc["EDT"]:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
KeyError: 15
2023-11-30 12:05:22.991 WARNING (MainThread) [py.warnings] /config/custom_components/echonetlite/sensor.py:450: RuntimeWarning: coroutine 'ServiceRegistry.async_call' was never awaited
self._hass.services.async_call(
2023-11-30 12:05:36.938 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/pychonet/echonetapiclient.py", line 115, in echonetMessageReceived
if epc not in self._state[host]["instances"][seojgc][seojcc][seojci] or self._state[host]["instances"][seojgc][seojcc][seojci][epc] != opc["EDT"]:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
KeyError: 15
2023-11-30 12:05:52.990 WARNING (MainThread) [py.warnings] /config/custom_components/echonetlite/sensor.py:450: RuntimeWarning: coroutine 'ServiceRegistry.async_call' was never awaited
self._hass.services.async_call(
2023-11-30 12:06:22.992 WARNING (MainThread) [py.warnings] /config/custom_components/echonetlite/sensor.py:450: RuntimeWarning: coroutine 'ServiceRegistry.async_call' was never awaited
self._hass.services.async_call(
I am 90% certain this is largely due to receiving a packet from some echonetlite object which is using a group code 0x0F, which is the custom group code. Its not something I have seen before, so I might have to put some sort of improved error handling around it, so at least we can figure out what we can do with it.
I think I might have calmed down the chatter, but I dont actually have any way of confirming. Can you please change manifest.json "pychonet==2.3.18" change to "pychonet @ git+https://github.com/scottyphillips/pychonet.git@master" and let me know if you are still getting the error messages
Also, I am very interested to know what your experience is like with the refrigerator. Are you able to let me know what sensors are enabled?
the integration can't start when i have my manifest.json look like this
[core-ssh config]$ cat /homeassistant/custom_components/echonetlite/manifest.json { "domain": "echonetlite", "name": "ECHONET Lite", "issue_tracker": "https://github.com/scottyphillips/echonetlite_homeassistant/issues", "config_flow": true, "documentation": "https://www.github.com/scottyphillips/echonetlite_homeassistant", "requirements": [ "pychonet==pychonet @ git+https://github.com/scottyphillips/pychonet.git@master" ], "dependencies": [], "codeowners": [ "@scottyphillips", "@nao-pon" ], "version": "3.7.7", "iot_class": "local_polling" }
when i try to add an entry i get this
oh sorry i see my mistake
looks like this one is still happening
2023-12-16 14:49:07.951 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/pychonet/echonetapiclient.py", line 89, in echonetMessageReceived
self._state[host]["instances"][seojgc][seojcc][seojci][
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
KeyError: 5
2023-12-16 14:49:07.988 WARNING (MainThread) [py.warnings] /config/custom_components/echonetlite/sensor.py:450: RuntimeWarning: coroutine 'ServiceRegistry.async_call' was never awaited
self._hass.services.async_call(
the refrigerator wasn't interesting. i don't think there was even a temperature sensor. the sensor i was looking for was power usage or operation status. but it didn't have either of those either.
the biggest problem was that the process of enabling the wifi requires you to setup their app and and the process of setting up their app enables some sensor on the refrigerator where it talks to you all the time. it detects presence in front of the refrigerator and then says hello or recommeneds recipes or something. and nothing worked to turn off the announcements.
Change
"requirements": [ "pychonet==pychonet @ @.***" ],
To
"requirements": [ "pychonet @ @.***" ],
Sent from my iPhone
On 16 Dec 2023, at 4:52 pm, mayberryjp @.***> wrote:
looks like this one is still happening
2023-12-16 14:49:07.951 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/pychonet/echonetapiclient.py", line 89, in echonetMessageReceived self._state[host]["instances"][seojgc][seojcc][seojci][
KeyError: 5
2023-12-16 14:49:07.988 WARNING (MainThread) [py.warnings] /config/custom_components/echonetlite/sensor.py:450: RuntimeWarning: coroutine 'ServiceRegistry.async_call' was never awaited
self._hass.services.async_call(
—
Reply to this email directly, view it on GitHub<https://github.com/scottyphillips/echonetlite_homeassistant/issues/148#issuecomment-1858731233>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGHQNDD7WA2RGYRS72E3663YJUZHVAVCNFSM6AAAAABAAPOUTWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJYG4ZTCMRTGM>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
> 2023-12-16 14:49:07.951 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
> Traceback (most recent call last):
> File "/usr/local/lib/python3.11/site-packages/pychonet/echonetapiclient.py", line 89, in echonetMessageReceived
> self._state[host]["instances"][seojgc][seojcc][seojci][
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
> KeyError: 5
> 2023-12-16 14:49:07.988 WARNING (MainThread) [py.warnings] /config/custom_components/echonetlite/sensor.py:450: RuntimeWarning: coroutine 'ServiceRegistry.async_call' was never awaited
> self._hass.services.async_call(
@nao-pon - looks like we are receiving packets from unknown nodes but previously discovered IP addresses. I suppressed 0x0F because that is the vendor specific group code, but in this case 0x05 (Management/control-related device class group) we might have to configure another callback function to handle it?
@mayberryjp ive made a little adjustment to the error handling to try to flesh out what is going on. Can you reboot home assistant and see if you are seeing expanded error messages with more details?
this device is my rinnai water heater
2023-12-16 19:08:44.490 DEBUG (MainThread) [custom_components.echonetlite] ECHONETLite Message Received from 192.168.50.54 - Raw data is b'\x10\x81\x01\xdb\x0f\x02\x01\x0e\xf0\x01s\x01\xd3\x01\x00'
2023-12-16 19:08:44.490 DEBUG (MainThread) [custom_components.echonetlite] ECHONETLite Message Received from 192.168.50.54 - Processed data is {'EHD1': 16, 'EHD2': 129, 'TID': 475, 'SEOJGC': 15, 'SEOJCC': 2, 'SEOJCI': 1, 'DEOJGC': 14, 'DEOJCC': 240, 'DEOJCI': 1, 'ESV': 115, 'OPC': [{'EPC': 211, 'PDC': 1, 'EDT': b'\x00'}]}
2023-12-16 19:08:44.490 DEBUG (MainThread) [custom_components.echonetlite] ECHONETLite Message Received from 192.168.50.54 - tid_data is None
2023-12-16 19:08:44.490 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/pychonet/echonetapiclient.py", line 115, in echonetMessageReceived
if epc not in self._state[host]["instances"][seojgc][seojcc][seojci] or self._state[host]["instances"][seojgc][seojcc][seojci][epc] != opc["EDT"]:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
KeyError: 15
there are other messages from the same device that seem to not be causing errors
here's a dump of a bunch of debugging logs 192.168.50.13 -> panasonic advanced link hub 192.168.50.38 -> fusion solar huawei smart logger 192.168.51.123 -> sharp refrigerator 192.168.50.18 -> panasonic eolia aircon 192.168.50.15 -> aircon #2 192.168.50.54 -> rinnai
Did you reload home assistant? The KeyError: 15 message should be gone, and any other KeyError messages like KeyError 5 should see a different error message.
yes i reloaded two or three times. i can arrange a screen share session on Teams and give you screen control if you want to look some time.
Anything in the Home Assistant GUI logs under settings -> log?
im not sure you are correctly pulling the master pychonet, ill have to look at a release tomorrow. Are the changes to the manifest file still applied?
"requirements": [
"pychonet @ git+https://github.com/scottyphillips/pychonet.git@master"
],
same stuff but here's a copy. bunch of things i need to clean up that look unrelated https://drive.google.com/file/d/1W0MyGI9wlSFoegcyv-uK1aRFfUarLKH_/view?usp=drive_link
[core-ssh config]$ cat /homeassistant/custom_components/echonetlite/manifest.json { "domain": "echonetlite", "name": "ECHONET Lite", "issue_tracker": "https://github.com/scottyphillips/echonetlite_homeassistant/issues", "config_flow": true, "documentation": "https://www.github.com/scottyphillips/echonetlite_homeassistant", "requirements": [ "pychonet @ git+https://github.com/scottyphillips/pychonet.git@master" ], "dependencies": [], "codeowners": [ "@scottyphillips", "@nao-pon" ], "version": "3.7.7", "iot_class": "local_polling" }
[core-ssh config]$ ha core stats blk_read: 0 blk_write: 0 cpu_percent: 1.95 memory_limit: 4115681280 memory_percent: 14.59 memory_usage: 600522752 network_rx: 0 network_tx: 0 [core-ssh config]$ ha core info arch: amd64 audio_input: null audio_output: null backups_exclude_database: false boot: true image: ghcr.io/home-assistant/qemux86-64-homeassistant ip_address: 172.30.32.1 machine: qemux86-64 port: 443 ssl: true update_available: false version: 2023.12.3 version_latest: 2023.12.3 watchdog: true
@mayberryjp
I have pushed a new version can you please update your manifest.json to:
"requirements": [
"pychonet==2.4.2"
],
reboot home assistant, and let me know if anything changes with the error messages
i think the error stopped.
2023-12-16 20:40:08.944 DEBUG (MainThread) [custom_components.echonetlite] ECHONETLite Message Received from 192.168.50.54 - Processed data is {'EHD1': 16, 'EHD2': 129, 'TID': 227, 'SEOJGC': 2, 'SEOJCC': 114, 'SEOJCI': 1, 'DEOJGC': 5, 'DEOJCC': 255, 'DEOJCI': 1, 'ESV': 114, 'OPC': [{'EPC': 128, 'PDC': 1, 'EDT': b'1'}, {'EPC': 144, 'PDC': 1, 'EDT': b'B'}, {'EPC': 208, 'PDC': 1, 'EDT': b'B'}, {'EPC': 145, 'PDC': 2, 'EDT': b'\x00\x00'}, {'EPC': 209, 'PDC': 1, 'EDT': b"'"}, {'EPC': 225, 'PDC': 1, 'EDT': b'*'}, {'EPC': 226, 'PDC': 1, 'EDT': b'B'}, {'EPC': 227, 'PDC': 1, 'EDT': b'B'}, {'EPC': 212, 'PDC': 1, 'EDT': b'\x0c'}, {'EPC': 228, 'PDC': 1, 'EDT': b'B'}]} 2023-12-16 20:40:08.944 DEBUG (MainThread) [custom_components.echonetlite] ECHONETLite Message Received from 192.168.50.54 - tid_data is {} 2023-12-16 20:40:09.044 DEBUG (MainThread) [custom_components.echonetlite] ECHONETLite Message Received from 192.168.50.54 - Raw data is b'\x10\x81\x00\xe5\x02r\x01\x05\xff\x01r\x03\xd5\x01\x0c\xee\x02\x00\xc8\xef\x01B' 2023-12-16 20:40:09.044 DEBUG (MainThread) [custom_components.echonetlite] ECHONETLite Message Received from 192.168.50.54 - Processed data is {'EHD1': 16, 'EHD2': 129, 'TID': 229, 'SEOJGC': 2, 'SEOJCC': 114, 'SEOJCI': 1, 'DEOJGC': 5, 'DEOJCC': 255, 'DEOJCI': 1, 'ESV': 114, 'OPC': [{'EPC': 213, 'PDC': 1, 'EDT': b'\x0c'}, {'EPC': 238, 'PDC': 2, 'EDT': b'\x00\xc8'}, {'EPC': 239, 'PDC': 1, 'EDT': b'B'}]} 2023-12-16 20:40:09.044 DEBUG (MainThread) [custom_components.echonetlite] ECHONETLite Message Received from 192.168.50.54 - tid_data is {}
some debug messages
hmm maybe i spoke too soon
Hi, you dont need to spam the comments with log files, please just attach as a text file next time. Its a different error message anyway. I will have to get @nao-pon to look at it as it concerns code he implemented for icon logic.
@property
def native_value(self) -> StateType:
.
.
.
def _push_icon_to_frontent(self):
self._hass.services.async_call(
"homeassistant",
"set_entity_icon",
{
"entity_id": self.entity_id,
"icon_path": self._sensor_attributes[CONF_ICON],
},
blocking=True,
)
This is causing error message:
2023-12-16 20:34:38.102 WARNING (MainThread) [py.warnings] /config/custom_components/echonetlite/sensor.py:450: RuntimeWarning: coroutine 'ServiceRegistry.async_call' was never awaited
How is this done for other integrations?
Would there be a big penalty if we changed the service call to the synchronous self._hass.services.call
? My understanding of the current code is we are waiting for the service call anyway with 'blocking'
That part of self._hass.services.async_call
is the work of @leonunix, not me.
- https://github.com/scottyphillips/echonetlite_homeassistant/commit/1043cd73db1a6423c84a2e551cd74eeeee06d824
I'm not sure if this service call is really necessary, but if you want to be notified of icon changes, you might just need to call schedule_update_ha_state()
instead of calling this service.
- https://developers.home-assistant.io/docs/core/entity/#subscribing-to-updates
Apologies @nao-pon . I think the purpose of the code is to show the battery icon charging or not charging. I don't have a battery system so difficult for me to test.
@mayberryjp I have disabled the problem code for now. Please update to the latest master and test
@leonunix please come up with an alternative logic to implement your dynamic icon updates. Maybe try self._hass.services.call
or schedule_update_ha_state()
as suggested.
I'm trying to change it to update the icon and then call sync_schedule_update_ha_state()
if the data is updated.
I committed to master.
@mayberryjp , @scottyphillips , @leonunix Could you please verify?
This is probably fixed in version 3.8.0, so I will close it. Thanks! 👍