GamerClassN7 / HA_Desktop_Companion

App which is using native HA Api to comunicate and report data to HA
50 stars 5 forks source link

[HADC_REBORN]System.Management.ManagementException: Invalid class #83

Closed samkatakouzinos closed 1 month ago

samkatakouzinos commented 1 month ago

Describe the Bug

The below never stops repeating.

[07/21/2024-21:54.08][3][HADC_REBORN]System.Management.ManagementException: Invalid class at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode) [07/21/2024-21:54.08][0]OUTPUT: 204977815552 [07/21/2024-21:54.08][0]ERROR: Invalid class [07/21/2024-21:54.08][3][HADC_REBORN]System.IO.IOException: Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request.. ---> System.Net.Sockets.SocketException (995): The I/O operation has been aborted because of either a thread exit or an application request. --- End of inner exception stack trace --- at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)

Steps to Reproduce

Run app

Expected Behaviour

To not fail

Version

1.0.0.4

samkatakouzinos commented 1 month ago

Configuration yaml attached. TXT extension for github to accept as upload.

configuration.yaml.txt

GamerClassN7 commented 1 month ago

Hello, Thank you for using my app!! :)

can i ask you on which HW you are running the app ?

Also would e possible to upload the log file ?

samkatakouzinos commented 1 month ago

Device name xxxx Processor AMD Ryzen 7 3800X 8-Core Processor 4.20 GHz Installed RAM 32.0 GB Device ID xxxx Product ID 00330-80000-00000-AA726 System type 64-bit operating system, x64-based processor Pen and touch Touch support with 10 touch points

Edition Windows 10 Pro Version 22H2 Installed on xxxx OS build 19045.4651 Experience Windows Feature Experience Pack 1000.19060.1000.0

log_07_23_2024.log

GamerClassN7 commented 1 month ago

@samkatakouzinos is your computer a Desktop PC ? since error indicates that your device don't have battery but you are trying to utilize battery sensor in your configuration.yaml

GamerClassN7 commented 1 month ago

if this is the case you should remove following sensors from your config file

- platform: wmic
    wmic_class: Win32_Battery
    wmic_selector: EstimatedChargeRemaining
    wmic_namespace: root\CIMV2
    name: Battery Level
    unique_id: battery_level
    icon: "mdi:battery"
    unit_of_measurement: "%"
    device_class: battery
    entity_category: "diagnostic"
    update_interval: 16
    accuracy_decimals: 0

  - platform: wmic
    wmic_class: Win32_Battery
    wmic_selector: BatteryStatus
    wmic_namespace: root\CIMV2
    name: Battery State
    unique_id: battery_state
    icon: "mdi:battery-minus"
    entity_category: "diagnostic"
    value_map: "Unknown|Discharging|On AC|Fully Charged|Low|Critical|Charging|Charging and High|Charging and Low|Charging and Critical|Undefined|Partially Charged"

  - platform: wmic
    wmic_class: BatteryStatus
    wmic_selector: PowerOnline
    wmic_namespace: root\wmi
    name: Is Charging
    unique_id: is_charging
    icon: "mdi:power-plug-off"
    device_class: plug
GamerClassN7 commented 1 month ago

@samkatakouzinos is the error gone after correction of the configuration error ?

GamerClassN7 commented 1 month ago

Closing due to no response considered as resolved reopen if not :)