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

Error setting up consumables in 2.0.0b5 #113

Closed
ccMatrix opened this issue May 3, 2024 · 13 comments
Closed

Error setting up consumables in 2.0.0b5 #113

ccMatrix opened this issue May 3, 2024 · 13 comments

Comments

@ccMatrix
Copy link

ccMatrix commented May 3, 2024

Cartridges cannot be setup in version 2.0.0b5
Printer: HP Officejet 5740 e-All-in-One Printer series
Home Assistant: 2024.5.0

Logger: homeassistant.util.logging
Source: util/logging.py:98
First occurred: 18:16:55 (12 occurrences)
Last logged: 19:51:34

Exception in _on_device_discovered when dispatching 'signal_hpprinter_device_discovered': ('76206a04580ac4f3cbd6f3608a971357', 'Consumable.1', {'consumable_label_code': 'K', 'consumable_life_state_consumable_state': 'newGenuineHP', 'consumable_life_state_brand': 'HP', 'consumable_station': '1', 'consumable_type_enum': 'inkCartridge', 'capacity_max_capacity': '0', 'consumable_percentage_level_remaining': '80', 'consumable_selectibility_number': '62', 'consumable_unique_id': '000000000000004be5399cf9de96914f'}, {'device_type': 'Consumable', 'properties': {'consumable_label_code': {'path': 'ConsumableLabelCode'}, 'consumable_life_state_consumable_state': {'path': 'ConsumableLifeState.ConsumableState', 'platform': 'binary_sensor', 'on_values': ['ok', 'newGenuineHP'], 'device_class': 'plug'}, 'consumable_life_state_brand': {'path': 'ConsumableLifeState.Brand'}, 'consumable_station': {'path': 'ConsumableStation', 'platform': 'sensor'}, 'consumable_type_enum': {'path': 'ConsumableTypeEnum', 'platform': 'sensor', 'device_class': 'enum', 'options': ['ink', 'inkCartridge', 'printhead', 'toner']}, 'installation_date': {'path': 'Installation.Date', 'platform': 'sensor', 'device_class': 'date'}, 'capacity_max_capacity': {'path': 'Capacity.MaxCapacity'}, 'consumable_percentage_level_remaining': {'path': 'ConsumablePercentageLevelRemaining', 'platform': 'sensor', 'unit_of_measurement': '%', 'exclude': {'consumable_type_enum': 'printhead'}}, 'consumable_selectibility_number': {'path': 'ConsumableSelectibilityNumber'}, 'manufacturer_name': {'path': 'Manufacturer.Name'}, 'manufacture_at': {'path': 'Manufacturer.Date', 'platform': 'sensor', 'device_class': 'date', 'exclude': {'consumable_type_enum': 'printhead'}}, 'serial_number': {'path': 'SerialNumber'}, 'product_number': {'path': 'ProductNumber'}, 'warranty_expiration_date': {'path': 'Warranty.ExpirationDate', 'platform': 'sensor', 'device_class': 'date', 'exclude': {'consumable_type_enum': 'printhead'}}, 'consumable_unique_id': {'path': 'ConsumableUniqueID'}}}) Traceback (most recent call last): File "/config/custom_components/hpprinter/managers/ha_coordinator.py", line 266, in _on_device_discovered handler(device_key, device_data, device_config) File "/config/custom_components/hpprinter/managers/ha_coordinator.py", line 165, in create_consumable_device cartridge_device_name = " ".join(device_name_parts) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: sequence item 1: expected str instance, NoneType found
Exception in _on_device_discovered when dispatching 'signal_hpprinter_device_discovered': ('76206a04580ac4f3cbd6f3608a971357', 'Consumable.None', {'marker_color': 'Black', 'consumable_raw_percentage_level_remaining': '84', 'refilled_count_counterfeit_refilled_count': '0', 'refilled_count_genuine_refilled_count': '0'}, {'device_type': 'Consumable', 'properties': {'consumable_station': {'path': 'ConsumableStation'}, 'marker_color': {'path': 'MarkerColor'}, 'estimated_pages_remaining': {'path': 'EstimatedPagesRemaining', 'platform': 'sensor', 'unit_of_measurement': 'pages', 'exclude': {'consumable_type_enum': 'printhead'}}, 'consumable_state': {'path': 'ConsumableState'}, 'consumable_raw_percentage_level_remaining': {'path': 'ConsumableRawPercentageLevelRemaining'}, 'supply_serial_number': {'path': 'SupplySerialNumber.#text'}, 'refilled_count_counterfeit_refilled_count': {'path': 'RefilledCount.CounterfeitRefilledCount.#text', 'platform': 'sensor', 'unit_of_measurement': 'refills', 'icon': 'mdi:format-color-fill'}, 'refilled_count_genuine_refilled_count': {'path': 'RefilledCount.GenuineRefilledCount', 'platform': 'sensor', 'unit_of_measurement': 'refills', 'icon': 'mdi:format-color-fill'}}}) Traceback (most recent call last): File "/config/custom_components/hpprinter/managers/ha_coordinator.py", line 266, in _on_device_discovered handler(device_key, device_data, device_config) File "/config/custom_components/hpprinter/managers/ha_coordinator.py", line 161, in create_consumable_device device_name_parts.append(cartridge_type.capitalize()) ^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'capitalize'
Exception in _on_device_discovered when dispatching 'signal_hpprinter_device_discovered': ('3b39aa175df9d32f91206d5458e6bbcc', 'Consumable.0', {'consumable_label_code': 'CMY', 'consumable_life_state_consumable_state': 'newGenuineHP', 'consumable_life_state_brand': 'HP', 'consumable_station': '0', 'consumable_type_enum': 'inkCartridge', 'capacity_max_capacity': '0', 'consumable_percentage_level_remaining': '70', 'consumable_selectibility_number': '62', 'consumable_unique_id': '00000000000000c8b2c6e9e7c3991132'}, {'device_type': 'Consumable', 'properties': {'consumable_label_code': {'path': 'ConsumableLabelCode'}, 'consumable_life_state_consumable_state': {'path': 'ConsumableLifeState.ConsumableState', 'platform': 'binary_sensor', 'on_values': ['ok', 'newGenuineHP'], 'device_class': 'plug'}, 'consumable_life_state_brand': {'path': 'ConsumableLifeState.Brand'}, 'consumable_station': {'path': 'ConsumableStation', 'platform': 'sensor'}, 'consumable_type_enum': {'path': 'ConsumableTypeEnum', 'platform': 'sensor', 'device_class': 'enum', 'options': ['ink', 'inkCartridge', 'printhead', 'toner']}, 'installation_date': {'path': 'Installation.Date', 'platform': 'sensor', 'device_class': 'date'}, 'capacity_max_capacity': {'path': 'Capacity.MaxCapacity'}, 'consumable_percentage_level_remaining': {'path': 'ConsumablePercentageLevelRemaining', 'platform': 'sensor', 'unit_of_measurement': '%', 'exclude': {'consumable_type_enum': 'printhead'}}, 'consumable_selectibility_number': {'path': 'ConsumableSelectibilityNumber'}, 'manufacturer_name': {'path': 'Manufacturer.Name'}, 'manufacture_at': {'path': 'Manufacturer.Date', 'platform': 'sensor', 'device_class': 'date', 'exclude': {'consumable_type_enum': 'printhead'}}, 'serial_number': {'path': 'SerialNumber'}, 'product_number': {'path': 'ProductNumber'}, 'warranty_expiration_date': {'path': 'Warranty.ExpirationDate', 'platform': 'sensor', 'device_class': 'date', 'exclude': {'consumable_type_enum': 'printhead'}}, 'consumable_unique_id': {'path': 'ConsumableUniqueID'}}}) Traceback (most recent call last): File "/config/custom_components/hpprinter/managers/ha_coordinator.py", line 266, in _on_device_discovered handler(device_key, device_data, device_config) File "/config/custom_components/hpprinter/managers/ha_coordinator.py", line 165, in create_consumable_device cartridge_device_name = " ".join(device_name_parts) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: sequence item 1: expected str instance, NoneType found
Exception in _on_device_discovered when dispatching 'signal_hpprinter_device_discovered': ('3b39aa175df9d32f91206d5458e6bbcc', 'Consumable.1', {'consumable_label_code': 'K', 'consumable_life_state_consumable_state': 'newGenuineHP', 'consumable_life_state_brand': 'HP', 'consumable_station': '1', 'consumable_type_enum': 'inkCartridge', 'capacity_max_capacity': '0', 'consumable_percentage_level_remaining': '80', 'consumable_selectibility_number': '62', 'consumable_unique_id': '000000000000004be5399cf9de96914f'}, {'device_type': 'Consumable', 'properties': {'consumable_label_code': {'path': 'ConsumableLabelCode'}, 'consumable_life_state_consumable_state': {'path': 'ConsumableLifeState.ConsumableState', 'platform': 'binary_sensor', 'on_values': ['ok', 'newGenuineHP'], 'device_class': 'plug'}, 'consumable_life_state_brand': {'path': 'ConsumableLifeState.Brand'}, 'consumable_station': {'path': 'ConsumableStation', 'platform': 'sensor'}, 'consumable_type_enum': {'path': 'ConsumableTypeEnum', 'platform': 'sensor', 'device_class': 'enum', 'options': ['ink', 'inkCartridge', 'printhead', 'toner']}, 'installation_date': {'path': 'Installation.Date', 'platform': 'sensor', 'device_class': 'date'}, 'capacity_max_capacity': {'path': 'Capacity.MaxCapacity'}, 'consumable_percentage_level_remaining': {'path': 'ConsumablePercentageLevelRemaining', 'platform': 'sensor', 'unit_of_measurement': '%', 'exclude': {'consumable_type_enum': 'printhead'}}, 'consumable_selectibility_number': {'path': 'ConsumableSelectibilityNumber'}, 'manufacturer_name': {'path': 'Manufacturer.Name'}, 'manufacture_at': {'path': 'Manufacturer.Date', 'platform': 'sensor', 'device_class': 'date', 'exclude': {'consumable_type_enum': 'printhead'}}, 'serial_number': {'path': 'SerialNumber'}, 'product_number': {'path': 'ProductNumber'}, 'warranty_expiration_date': {'path': 'Warranty.ExpirationDate', 'platform': 'sensor', 'device_class': 'date', 'exclude': {'consumable_type_enum': 'printhead'}}, 'consumable_unique_id': {'path': 'ConsumableUniqueID'}}}) Traceback (most recent call last): File "/config/custom_components/hpprinter/managers/ha_coordinator.py", line 266, in _on_device_discovered handler(device_key, device_data, device_config) File "/config/custom_components/hpprinter/managers/ha_coordinator.py", line 165, in create_consumable_device cartridge_device_name = " ".join(device_name_parts) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: sequence item 1: expected str instance, NoneType found
Exception in _on_device_discovered when dispatching 'signal_hpprinter_device_discovered': ('3b39aa175df9d32f91206d5458e6bbcc', 'Consumable.None', {'marker_color': 'Black', 'consumable_raw_percentage_level_remaining': '84', 'refilled_count_counterfeit_refilled_count': '0', 'refilled_count_genuine_refilled_count': '0'}, {'device_type': 'Consumable', 'properties': {'consumable_station': {'path': 'ConsumableStation'}, 'marker_color': {'path': 'MarkerColor'}, 'estimated_pages_remaining': {'path': 'EstimatedPagesRemaining', 'platform': 'sensor', 'unit_of_measurement': 'pages', 'exclude': {'consumable_type_enum': 'printhead'}}, 'consumable_state': {'path': 'ConsumableState'}, 'consumable_raw_percentage_level_remaining': {'path': 'ConsumableRawPercentageLevelRemaining'}, 'supply_serial_number': {'path': 'SupplySerialNumber.#text'}, 'refilled_count_counterfeit_refilled_count': {'path': 'RefilledCount.CounterfeitRefilledCount.#text', 'platform': 'sensor', 'unit_of_measurement': 'refills', 'icon': 'mdi:format-color-fill'}, 'refilled_count_genuine_refilled_count': {'path': 'RefilledCount.GenuineRefilledCount', 'platform': 'sensor', 'unit_of_measurement': 'refills', 'icon': 'mdi:format-color-fill'}}}) Traceback (most recent call last): File "/config/custom_components/hpprinter/managers/ha_coordinator.py", line 266, in _on_device_discovered handler(device_key, device_data, device_config) File "/config/custom_components/hpprinter/managers/ha_coordinator.py", line 161, in create_consumable_device device_name_parts.append(cartridge_type.capitalize()) ^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'capitalize'

Details from web ui:
image

Here is the XML contents for the Consumables
consumables_xml_output.zip

@ccMatrix
Copy link
Author

ccMatrix commented May 3, 2024

Debug log output:

2024-05-03 19:38:00.813 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_coordinator] Initializing coordinator
2024-05-03 19:38:00.834 INFO (MainThread) [homeassistant.components.sensor] Setting up hpprinter.sensor
2024-05-03 19:38:00.836 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up hpprinter.binary_sensor
2024-05-03 19:38:00.837 INFO (MainThread) [custom_components.hpprinter.managers.ha_coordinator] Start loading hpprinter integration, Entry ID: 3b39aa175df9d32f91206d5458e6bbcc
2024-05-03 19:38:01.214 DEBUG (MainThread) [custom_components.hpprinter.managers.rest_api] Request to https://printer.htpc.zone:443/Prefetch?type=dtree
2024-05-03 19:38:01.261 DEBUG (MainThread) [custom_components.hpprinter.managers.rest_api] Request to https://printer.htpc.zone:443/DevMgmt/ProductConfigDyn.xml
2024-05-03 19:38:01.328 DEBUG (MainThread) [custom_components.hpprinter.managers.rest_api] Request to https://printer.htpc.zone:443/DevMgmt/ConsumableConfigDyn.xml
2024-05-03 19:38:01.460 DEBUG (MainThread) [custom_components.hpprinter.managers.rest_api] Request to https://printer.htpc.zone:443/DevMgmt/ProductUsageDyn.xml
2024-05-03 19:38:01.889 DEBUG (MainThread) [custom_components.hpprinter.managers.rest_api] Request to https://printer.htpc.zone:443/IoMgmt/Adapters
2024-05-03 19:38:01.908 DEBUG (MainThread) [custom_components.hpprinter.managers.rest_api] Request to https://printer.htpc.zone:443/ePrint/ePrintConfigDyn.xml
2024-05-03 19:38:01.928 DEBUG (MainThread) [custom_components.hpprinter.managers.rest_api] Request to https://printer.htpc.zone:443/DevMgmt/NetAppsSecureDyn.xml
2024-05-03 19:38:01.941 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_config_manager] Translations requested, Key: component.hpprinter.entity.sensor.manufacture_at.name, Entity: manufacture_at, Value: Manufacture Date
2024-05-03 19:38:01.942 DEBUG (MainThread) [custom_components.hpprinter.common.base_entity] Setting up sensor 1 entities, Keys: hpprinter_main_sensor_manufacture_at
2024-05-03 19:38:01.946 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_config_manager] Translations requested, Key: component.hpprinter.entity.binary_sensor.registration_state.name, Entity: registration_state, Value: ePrint Registered
2024-05-03 19:38:01.947 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_config_manager] Translations requested, Key: component.hpprinter.entity.binary_sensor.cloud_services_switch_status.name, Entity: cloud_services_switch_status, Value: ePrint Status
2024-05-03 19:38:01.948 DEBUG (MainThread) [custom_components.hpprinter.common.base_entity] Setting up binary_sensor 2 entities, Keys: hpprinter_main_binary_sensor_registration_state, hpprinter_main_binary_sensor_cloud_services_switch_status
2024-05-03 19:38:04.462 ERROR (MainThread) [homeassistant.util.logging] Exception in _on_device_discovered when dispatching 'signal_hpprinter_device_discovered': ('3b39aa175df9d32f91206d5458e6bbcc', 'Consumable.0', {'consumable_label_code': 'CMY', 'consumable_life_state_consumable_state': 'newGenuineHP', 'consumable_life_state_brand': 'HP', 'consumable_station': '0', 'consumable_type_enum': 'inkCartridge', 'capacity_max_capacity': '0', 'consumable_percentage_level_remaining': '70', 'consumable_selectibility_number': '62', 'consumable_unique_id': '00000000000000c8b2c6e9e7c3991132'}, {'device_type': 'Consumable', 'properties': {'consumable_label_code': {'path': 'ConsumableLabelCode'}, 'consumable_life_state_consumable_state': {'path': 'ConsumableLifeState.ConsumableState', 'platform': 'binary_sensor', 'on_values': ['ok', 'newGenuineHP'], 'device_class': 'plug'}, 'consumable_life_state_brand': {'path': 'ConsumableLifeState.Brand'}, 'consumable_station': {'path': 'ConsumableStation', 'platform': 'sensor'}, 'consumable_type_enum': {'path': 'ConsumableTypeEnum', 'platform': 'sensor', 'device_class': 'enum', 'options': ['ink', 'inkCartridge', 'printhead', 'toner']}, 'installation_date': {'path': 'Installation.Date', 'platform': 'sensor', 'device_class': 'date'}, 'capacity_max_capacity': {'path': 'Capacity.MaxCapacity'}, 'consumable_percentage_level_remaining': {'path': 'ConsumablePercentageLevelRemaining', 'platform': 'sensor', 'unit_of_measurement': '%', 'exclude': {'consumable_type_enum': 'printhead'}}, 'consumable_selectibility_number': {'path': 'ConsumableSelectibilityNumber'}, 'manufacturer_name': {'path': 'Manufacturer.Name'}, 'manufacture_at': {'path': 'Manufacturer.Date', 'platform': 'sensor', 'device_class': 'date', 'exclude': {'consumable_type_enum': 'printhead'}}, 'serial_number': {'path': 'SerialNumber'}, 'product_number': {'path': 'ProductNumber'}, 'warranty_expiration_date': {'path': 'Warranty.ExpirationDate', 'platform': 'sensor', 'device_class': 'date', 'exclude': {'consumable_type_enum': 'printhead'}}, 'consumable_unique_id': {'path': 'ConsumableUniqueID'}}})
Traceback (most recent call last):
  File "/config/custom_components/hpprinter/managers/ha_coordinator.py", line 266, in _on_device_discovered
    handler(device_key, device_data, device_config)
  File "/config/custom_components/hpprinter/managers/ha_coordinator.py", line 165, in create_consumable_device
    cartridge_device_name = " ".join(device_name_parts)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: sequence item 1: expected str instance, NoneType found

2024-05-03 19:38:04.507 ERROR (MainThread) [homeassistant.util.logging] Exception in _on_device_discovered when dispatching 'signal_hpprinter_device_discovered': ('3b39aa175df9d32f91206d5458e6bbcc', 'Consumable.1', {'consumable_label_code': 'K', 'consumable_life_state_consumable_state': 'newGenuineHP', 'consumable_life_state_brand': 'HP', 'consumable_station': '1', 'consumable_type_enum': 'inkCartridge', 'capacity_max_capacity': '0', 'consumable_percentage_level_remaining': '80', 'consumable_selectibility_number': '62', 'consumable_unique_id': '000000000000004be5399cf9de96914f'}, {'device_type': 'Consumable', 'properties': {'consumable_label_code': {'path': 'ConsumableLabelCode'}, 'consumable_life_state_consumable_state': {'path': 'ConsumableLifeState.ConsumableState', 'platform': 'binary_sensor', 'on_values': ['ok', 'newGenuineHP'], 'device_class': 'plug'}, 'consumable_life_state_brand': {'path': 'ConsumableLifeState.Brand'}, 'consumable_station': {'path': 'ConsumableStation', 'platform': 'sensor'}, 'consumable_type_enum': {'path': 'ConsumableTypeEnum', 'platform': 'sensor', 'device_class': 'enum', 'options': ['ink', 'inkCartridge', 'printhead', 'toner']}, 'installation_date': {'path': 'Installation.Date', 'platform': 'sensor', 'device_class': 'date'}, 'capacity_max_capacity': {'path': 'Capacity.MaxCapacity'}, 'consumable_percentage_level_remaining': {'path': 'ConsumablePercentageLevelRemaining', 'platform': 'sensor', 'unit_of_measurement': '%', 'exclude': {'consumable_type_enum': 'printhead'}}, 'consumable_selectibility_number': {'path': 'ConsumableSelectibilityNumber'}, 'manufacturer_name': {'path': 'Manufacturer.Name'}, 'manufacture_at': {'path': 'Manufacturer.Date', 'platform': 'sensor', 'device_class': 'date', 'exclude': {'consumable_type_enum': 'printhead'}}, 'serial_number': {'path': 'SerialNumber'}, 'product_number': {'path': 'ProductNumber'}, 'warranty_expiration_date': {'path': 'Warranty.ExpirationDate', 'platform': 'sensor', 'device_class': 'date', 'exclude': {'consumable_type_enum': 'printhead'}}, 'consumable_unique_id': {'path': 'ConsumableUniqueID'}}})
Traceback (most recent call last):
  File "/config/custom_components/hpprinter/managers/ha_coordinator.py", line 266, in _on_device_discovered
    handler(device_key, device_data, device_config)
  File "/config/custom_components/hpprinter/managers/ha_coordinator.py", line 165, in create_consumable_device
    cartridge_device_name = " ".join(device_name_parts)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: sequence item 1: expected str instance, NoneType found

2024-05-03 19:38:04.556 ERROR (MainThread) [homeassistant.util.logging] Exception in _on_device_discovered when dispatching 'signal_hpprinter_device_discovered': ('3b39aa175df9d32f91206d5458e6bbcc', 'Consumable.None', {'marker_color': 'Black', 'consumable_raw_percentage_level_remaining': '84', 'refilled_count_counterfeit_refilled_count': '0', 'refilled_count_genuine_refilled_count': '0'}, {'device_type': 'Consumable', 'properties': {'consumable_station': {'path': 'ConsumableStation'}, 'marker_color': {'path': 'MarkerColor'}, 'estimated_pages_remaining': {'path': 'EstimatedPagesRemaining', 'platform': 'sensor', 'unit_of_measurement': 'pages', 'exclude': {'consumable_type_enum': 'printhead'}}, 'consumable_state': {'path': 'ConsumableState'}, 'consumable_raw_percentage_level_remaining': {'path': 'ConsumableRawPercentageLevelRemaining'}, 'supply_serial_number': {'path': 'SupplySerialNumber.#text'}, 'refilled_count_counterfeit_refilled_count': {'path': 'RefilledCount.CounterfeitRefilledCount.#text', 'platform': 'sensor', 'unit_of_measurement': 'refills', 'icon': 'mdi:format-color-fill'}, 'refilled_count_genuine_refilled_count': {'path': 'RefilledCount.GenuineRefilledCount', 'platform': 'sensor', 'unit_of_measurement': 'refills', 'icon': 'mdi:format-color-fill'}}})
Traceback (most recent call last):
  File "/config/custom_components/hpprinter/managers/ha_coordinator.py", line 266, in _on_device_discovered
    handler(device_key, device_data, device_config)
  File "/config/custom_components/hpprinter/managers/ha_coordinator.py", line 161, in create_consumable_device
    device_name_parts.append(cartridge_type.capitalize())
                             ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'capitalize'

2024-05-03 19:38:04.557 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_config_manager] Translations requested, Key: component.hpprinter.entity.sensor.total_impressions.name, Entity: total_impressions, Value: Total pages
2024-05-03 19:38:04.558 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_config_manager] Translations requested, Key: component.hpprinter.entity.sensor.duplex_sheets.name, Entity: duplex_sheets, Value: Total double-sided pages
2024-05-03 19:38:04.559 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_config_manager] Translations requested, Key: component.hpprinter.entity.sensor.jam_events.name, Entity: jam_events, Value: Total jams
2024-05-03 19:38:04.559 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_config_manager] Translations requested, Key: component.hpprinter.entity.sensor.mispick_events.name, Entity: mispick_events, Value: Total miss picks
2024-05-03 19:38:04.560 DEBUG (MainThread) [custom_components.hpprinter.common.base_entity] Setting up sensor 4 entities, Keys: hpprinter_printer_sensor_total_impressions, hpprinter_printer_sensor_duplex_sheets, hpprinter_printer_sensor_jam_events, hpprinter_printer_sensor_mispick_events
2024-05-03 19:38:04.569 DEBUG (MainThread) [custom_components.hpprinter.common.base_entity] Setting up binary_sensor 0 entities, Keys: 
2024-05-03 19:38:04.571 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_config_manager] Translations requested, Key: component.hpprinter.entity.sensor.scan_images.name, Entity: scan_images, Value: Total pages
2024-05-03 19:38:04.571 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_config_manager] Translations requested, Key: component.hpprinter.entity.sensor.adf_images.name, Entity: adf_images, Value: Total pages from ADF
2024-05-03 19:38:04.572 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_config_manager] Translations requested, Key: component.hpprinter.entity.sensor.flatbed_images.name, Entity: flatbed_images, Value: Total pages from scanner glass
2024-05-03 19:38:04.572 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_config_manager] Translations requested, Key: component.hpprinter.entity.sensor.jam_events.name, Entity: jam_events, Value: Total jams
2024-05-03 19:38:04.573 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_config_manager] Translations requested, Key: component.hpprinter.entity.sensor.mispick_events.name, Entity: mispick_events, Value: Total miss picks
2024-05-03 19:38:04.574 DEBUG (MainThread) [custom_components.hpprinter.common.base_entity] Setting up sensor 5 entities, Keys: hpprinter_scanner_sensor_scan_images, hpprinter_scanner_sensor_adf_images, hpprinter_scanner_sensor_flatbed_images, hpprinter_scanner_sensor_jam_events, hpprinter_scanner_sensor_mispick_events
2024-05-03 19:38:04.584 DEBUG (MainThread) [custom_components.hpprinter.common.base_entity] Setting up binary_sensor 0 entities, Keys: 
2024-05-03 19:38:04.586 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_config_manager] Translations requested, Key: component.hpprinter.entity.sensor.total_impressions.name, Entity: total_impressions, Value: Total pages
2024-05-03 19:38:04.586 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_config_manager] Translations requested, Key: component.hpprinter.entity.sensor.adf_images.name, Entity: adf_images, Value: Total pages from ADF
2024-05-03 19:38:04.587 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_config_manager] Translations requested, Key: component.hpprinter.entity.sensor.flatbed_images.name, Entity: flatbed_images, Value: Total pages from scanner glass
2024-05-03 19:38:04.587 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_config_manager] Translations requested, Key: component.hpprinter.entity.sensor.monochrome_impressions.name, Entity: monochrome_impressions, Value: Total black-and-white pages
2024-05-03 19:38:04.588 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_config_manager] Translations requested, Key: component.hpprinter.entity.sensor.color_impressions.name, Entity: color_impressions, Value: Total color pages
2024-05-03 19:38:04.588 DEBUG (MainThread) [custom_components.hpprinter.common.base_entity] Setting up sensor 5 entities, Keys: hpprinter_copy_sensor_total_impressions, hpprinter_copy_sensor_adf_images, hpprinter_copy_sensor_flatbed_images, hpprinter_copy_sensor_monochrome_impressions, hpprinter_copy_sensor_color_impressions
2024-05-03 19:38:04.600 DEBUG (MainThread) [custom_components.hpprinter.common.base_entity] Setting up binary_sensor 0 entities, Keys: 
2024-05-03 19:38:04.601 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_config_manager] Translations requested, Key: component.hpprinter.entity.sensor.total_impressions.name, Entity: total_impressions, Value: Total pages
2024-05-03 19:38:04.602 DEBUG (MainThread) [custom_components.hpprinter.common.base_entity] Setting up sensor 1 entities, Keys: hpprinter_fax_sensor_total_impressions
2024-05-03 19:38:04.605 DEBUG (MainThread) [custom_components.hpprinter.common.base_entity] Setting up binary_sensor 0 entities, Keys: 
2024-05-03 19:38:04.606 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_coordinator] Finished fetching HP Printer data in 3.389 seconds (success: True)
2024-05-03 19:38:04.652 DEBUG (MainThread) [custom_components.hpprinter.managers.rest_api] Request to https://printer.htpc.zone:443/DevMgmt/ProductConfigDyn.xml
2024-05-03 19:38:04.950 DEBUG (MainThread) [custom_components.hpprinter.managers.rest_api] Request to https://printer.htpc.zone:443/DevMgmt/ConsumableConfigDyn.xml
2024-05-03 19:38:05.372 DEBUG (MainThread) [custom_components.hpprinter.managers.rest_api] Request to https://printer.htpc.zone:443/DevMgmt/ProductUsageDyn.xml
2024-05-03 19:38:05.550 DEBUG (MainThread) [custom_components.hpprinter.managers.rest_api] Request to https://printer.htpc.zone:443/IoMgmt/Adapters
2024-05-03 19:38:05.789 DEBUG (MainThread) [custom_components.hpprinter.managers.rest_api] Request to https://printer.htpc.zone:443/ePrint/ePrintConfigDyn.xml
2024-05-03 19:38:06.056 DEBUG (MainThread) [custom_components.hpprinter.managers.rest_api] Request to https://printer.htpc.zone:443/DevMgmt/NetAppsSecureDyn.xml
2024-05-03 19:38:06.085 DEBUG (MainThread) [custom_components.hpprinter.managers.ha_coordinator] Finished fetching HP Printer data in 4.143 seconds (success: True)

@elad-bar
Copy link
Owner

elad-bar commented May 7, 2024

released v2.0.0b6 with a fix for the issue, can you please check and report back?

thanks

@ccMatrix
Copy link
Author

ccMatrix commented May 7, 2024

I've updated and removed the printer with all devices and entities. Then set it up new. The cartridges were detected and created. They are both names just ink cartridge and I don't see which one is which. There is Station 0 and 1 but the XML does describe them with name K and CMY. Here are some screenshots:

Screenshot_20240507_192314_Home Assistant
Screenshot_20240507_192345_Home Assistant
Screenshot_20240507_192348_Home Assistant
Screenshot_20240507_192351_Home Assistant

However in the logs I still have an entry with the following error:

Logger: homeassistant.util.logging
Source: util/logging.py:98
First occurred: 19:21:29 (1 occurrences)
Last logged: 19:21:29

Exception in _on_device_discovered when dispatching 'signal_hpprinter_device_discovered': ('3b39aa175df9d32f91206d5458e6bbcc', 'Consumable.None', {'marker_color': 'Black', 'consumable_raw_percentage_level_remaining': '84', 'refilled_count_counterfeit_refilled_count': '0', 'refilled_count_genuine_refilled_count': '0'}, {'device_type': 'Consumable', 'properties': {'consumable_station': {'path': 'ConsumableStation'}, 'marker_color': {'path': 'MarkerColor'}, 'estimated_pages_remaining': {'path': 'EstimatedPagesRemaining', 'platform': 'sensor', 'unit_of_measurement': 'pages', 'exclude': {'consumable_type_enum': 'printhead'}}, 'consumable_state': {'path': 'ConsumableState'}, 'consumable_raw_percentage_level_remaining': {'path': 'ConsumableRawPercentageLevelRemaining'}, 'supply_serial_number': {'path': 'SupplySerialNumber.#text'}, 'refilled_count_counterfeit_refilled_count': {'path': 'RefilledCount.CounterfeitRefilledCount.#text', 'platform': 'sensor', 'unit_of_measurement': 'refills', 'icon': 'mdi:format-color-fill'}, 'refilled_count_genuine_refilled_count': {'path': 'RefilledCount.GenuineRefilledCount', 'platform': 'sensor', 'unit_of_measurement': 'refills', 'icon': 'mdi:format-color-fill'}}}) Traceback (most recent call last): File "/config/custom_components/hpprinter/managers/ha_coordinator.py", line 272, in _on_device_discovered handler(device_key, device_data, device_config) File "/config/custom_components/hpprinter/managers/ha_coordinator.py", line 161, in create_consumable_device device_name_parts.append(cartridge_type.capitalize()) ^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'capitalize'

@ccMatrix
Copy link
Author

ccMatrix commented May 7, 2024

@elad-bar
Copy link
Owner

elad-bar commented May 7, 2024

thanks for the super quick and productive response
the error is fixed with v2.0.0b7

as for the issue with the ink, as I see the mapping of consumable data (getting it from 2 different resources from the printer) is not working well,
it seems that Black consumable has no station in one of the objects, as result of that you are not getting all details, will try to find a solution for that and update

@ccMatrix
Copy link
Author

ccMatrix commented May 7, 2024

The new 2.0.0b7 release now creates an additional device
Screenshot_20240507_200539_Home Assistant
No errors in the log anymore :)

I'm glad I could help. Looking forward to updates to the consumables mapping to get more info.

@elad-bar
Copy link
Owner

fixed in v2.0.0b9, pls check and update

thanks

@ccMatrix
Copy link
Author

With b9 I do receive both a Black and CyanMagentaYellow Device, Both just contain these Genuine Refilled and Counterfeit Refilled values. The two Inkcartridge entries are the same as before (they are named the same and just contains the info about Level, Status, Station and Type):
imageimage
image

@elad-bar
Copy link
Owner

can you pls share diagnostic file?

@ccMatrix
Copy link
Author

@elad-bar
Copy link
Owner

hope that this time it will work :)
released v2.0.0b10

@ccMatrix
Copy link
Author

Looks good now. It did create just 2 cartridges with the merged info from the old ones and name them with the cartridge name (Black or CyanMagentaYellow)

Screenshot_20240518_085645_Home Assistant
Screenshot_20240518_085648_Home Assistant
Screenshot_20240518_085652_Home Assistant

@elad-bar
Copy link
Owner

Finally :)
Thanks for the update and assistance making it work again

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

2 participants