iloveicedgreentea / jvc_homeassistant

JVC Integration for Home Assistant
20 stars 4 forks source link

Recent Home assistant issue in creating entities JVC DLA-X5000 #27

Closed crewz closed 1 year ago

crewz commented 1 year ago

Hi - All was working fine until recent updates and i now get this error in home assistant any ideas?

2023-02-02 16:41:53.827 ERROR (MainThread) [homeassistant.components.remote] Error adding entities for domain remote with platform jvc_projectors Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 442, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 717, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 814, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 566, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 610, in _async_write_ha_state attr.update(self.extra_state_attributes or {}) File "/config/custom_components/jvc_projectors/remote.py", line 121, in extra_state_attributes if "NZ" in self._model_family: TypeError: argument of type 'NoneType' is not iterable

iloveicedgreentea commented 1 year ago

Okay I think the issue is your model family is not included. I will have to find that out. If you revert to the previous version what value do you have for model version?

iloveicedgreentea commented 1 year ago

I suspect its going to be None. I can't find the model code online so can you enable debug logs and send me debug logs after you add the below yaml, then restart home assistant, and wait about 3 minutes. Somewhere in there should be the model code in raw form and I can add it.

Add this to your configuration.yaml

logger:
  default: critical
  logs:
    custom_components.jvc_projectors: debug
crewz commented 1 year ago

Not sure i ever had a model number populated! will addable to config

crewz commented 1 year ago

Is this ok!

2023-02-02 17:24:35.961 DEBUG (SyncWorker_8) [custom_components.jvc_projectors.remote] Starting open connection 2023-02-02 17:24:35.961 INFO (SyncWorker_8) [custom_components.jvc_projectors.remote] Connecting to JVC Projector: 192.168.1.217:20554 2023-02-02 17:24:35.965 INFO (SyncWorker_8) [custom_components.jvc_projectors.remote] Connected to JVC Projector 2023-02-02 17:24:35.966 DEBUG (SyncWorker_8) [custom_components.jvc_projectors.remote] Handshaking 2023-02-02 17:24:35.966 DEBUG (SyncWorker_8) [custom_components.jvc_projectors.remote] b'PJ_OK' 2023-02-02 17:24:35.970 DEBUG (SyncWorker_8) [custom_components.jvc_projectors.remote] Handshake successful 2023-02-02 17:24:35.970 DEBUG (SyncWorker_8) [custom_components.jvc_projectors.remote] Command_type: b'?' 2023-02-02 17:24:35.973 DEBUG (SyncWorker_8) [custom_components.jvc_projectors.remote] Send command: b'?\x89\x01MD\n' 2023-02-02 17:24:35.974 DEBUG (SyncWorker_8) [custom_components.jvc_projectors.remote] Send ack: b'MD' 2023-02-02 17:24:35.974 DEBUG (SyncWorker_8) [custom_components.jvc_projectors.remote] do_command sending command: b'?\x89\x01MD\n' 2023-02-02 17:24:35.984 DEBUG (SyncWorker_8) [custom_components.jvc_projectors.remote] constructed ack_value: b'\x06\x89\x01MD\n' 2023-02-02 17:24:35.988 DEBUG (SyncWorker_8) [custom_components.jvc_projectors.remote] received msg from PJ: b'\x06\x89\x01MD\n' 2023-02-02 17:24:36.087 DEBUG (SyncWorker_8) [custom_components.jvc_projectors.remote] received message from PJ: b'@\x89\x01MDILAFPJ -- XHP1\n' 2023-02-02 17:24:36.087 DEBUG (SyncWorker_8) [custom_components.jvc_projectors.remote] MDILAFPJ -- XHP1 2023-02-02 17:24:36.087 DEBUG (SyncWorker_8) [custom_components.jvc_projectors.remote] Model code is None 2023-02-02 17:24:36.087 DEBUG (SyncWorker_8) [custom_components.jvc_projectors.remote] Handshake complete and we are connected

iloveicedgreentea commented 1 year ago

Yeah that should be good I will add that line now and update it so it wont crash in the future

iloveicedgreentea commented 1 year ago

Okay I fixed it in the library. Using the file editor add on can you manually try this out?

Open /config/custom_components/jvc_projectors/manifest.json

Change "jvc-projector-remote-improved2==3.4.5"

to be exactly "jvc-projector-remote-improved2==3.5.1"

Restart HA and open your logs, it should not have errors. Then try it out again and see if you get the right model.

crewz commented 1 year ago

Thats great - model code now shows X5000 and entities are recreated

Many thanks for the speedy fix

iloveicedgreentea commented 1 year ago

3.5.2 released. Remember to turn off debug logs also and restart

crewz commented 1 year ago

Ok and thanks again for your super fast response and fix!!!!!!

On 2 Feb 2023, at 18:31, ilan ponimansky @.***> wrote:

3.5.2 released. Remember to turn off debug logs also and restart

— Reply to this email directly, view it on GitHub https://github.com/iloveicedgreentea/jvc_homeassistant/issues/27#issuecomment-1414186914, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFZG6BPKP4VEUYUU564KZWTWVP4R3ANCNFSM6AAAAAAUPIQVKU. You are receiving this because you modified the open/close state.