Breina / idrac_power_monitor

HomeAssistant integration to monitor the power of a server through its iDrac's Redfish API
17 stars 17 forks source link

issues adding multiple dell servers #11

Closed smitch35 closed 1 month ago

smitch35 commented 4 months ago

I recently updated to the newest version and now if I add all 4 of my servers I only get some reporting info from a couple and never all four and it will randomly change which ones it polls from.

Is this something you've run across or is there a best practice for adding multiple dell servers to this integration?

Thanks,

Breina commented 4 months ago

Ah I am a single-server plebian and didn't run into this. Checking it out.

Breina commented 4 months ago

Can you please enable debug logging and check how often you see Refreshing sensors in the logs? You should see it once per server per interval that you configured (5 minutes by default). If values are the same, I don't refresh the entity.

Arhkos commented 4 months ago

Same issue for me.

2 x R630 and reports are mixed

Difference in entity reported image

In one entity all sensor are doubled because its report sensor of serveur 1 and 2 image

Only one entity is show in my integration pannel image

smitch35 commented 4 months ago

I'm guessing since it sees each device as 'the same device' that's what's causing the issue image

Breina commented 4 months ago

Good report! I see what's going on, let me fix that for you! :)

Breina commented 4 months ago

Can you please do this?

curl --location --request GET 'https://HOST/redfish/v1/Chassis/System.Embedded.1' \ --header 'Authorization: Basic BASIC_TOKEN'

Replacing HOST and BASIC_TOKEN. Basic token should be base64 encoded yourusername:yourpassword.

To differentiate devices, the model and serial are used for uniqueness. I am guessing that there's a problem parsing the SerialNumber from the response of the above REST call.


The last screenshot shows a different issue, I fixed that (not yet released).

smitch35 commented 4 months ago

I may be doing something wrong . I'm getting this [image: image.png]

and this: [image: image.png]

On Thu, Feb 22, 2024 at 9:45 AM Breina @.***> wrote:

Can you please do this?

curl --location --request GET ' https://HOST/redfish/v1/Chassis/System.Embedded.1' \ --header 'Authorization: Basic BASIC_TOKEN'

Replacing HOST and BASIC_TOKEN. Basic token should be base64 encoded https://www.base64encode.org/ yourusername:yourpassword.

To differentiate devices, the model and serial are used for uniqueness. I am guessing that there's a problem parsing the SerialNumber from the response of the above REST call.

The last screenshot shows a different issue, I fixed that (not yet released).

— Reply to this email directly, view it on GitHub https://github.com/Breina/idrac_power_monitor/issues/11#issuecomment-1959603206, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEYJZ5J2FB57TS6UKZJHVDYU5KZTAVCNFSM6AAAAABDRZZAY6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJZGYYDGMRQGY . You are receiving this because you authored the thread.Message ID: @.***>

Arhkos commented 4 months ago

curl didnt work because insecure certificat (its a selfsigned from the idrac) but i can access to https://HOST/redfish/v1/Chassis/System.Embedded.1 with my webbrowser. Did the result of this helping ? If yes I can paste it

smitch35 commented 4 months ago

Yes I can get the output in a browser and it does see the serial number it seems [image: image.png]

[image: image.png]

On Thu, Feb 22, 2024 at 10:20 AM Arhkos @.***> wrote:

curl didnt work because insecure certificat (its a selfsigned from the idrac) but i can access to https://HOST/redfish/v1/Chassis/System.Embedded.1 with my webbrowser. Did the result of this helping ? If yes I can paste it

— Reply to this email directly, view it on GitHub https://github.com/Breina/idrac_power_monitor/issues/11#issuecomment-1959673444, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEYJZ3LPZZYH325W3AT6UDYU5O4HAVCNFSM6AAAAABDRZZAY6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJZGY3TGNBUGQ . You are receiving this because you authored the thread.Message ID: @.***>

Arhkos commented 4 months ago

@smitch35 image from email didnt work :D

smitch35 commented 4 months ago

Sorry!

image

image

Breina commented 4 months ago

Ok thanks for the data guys!

Breina commented 4 months ago

Alright I'm not exactly sure, but can you please test this release?

https://github.com/Breina/idrac_power_monitor/releases/tag/v1.2.2alpha

You may need to completely remove all config entries and entities first.

smitch35 commented 4 months ago

Testing will update with results

On Thu, Feb 22, 2024 at 12:52 PM Breina @.***> wrote:

Alright I'm not exactly sure, but can you please test this release?

https://github.com/Breina/idrac_power_monitor/releases/tag/v1.2.2alpha

You may need to completely remove all config entries and entities first.

— Reply to this email directly, view it on GitHub https://github.com/Breina/idrac_power_monitor/issues/11#issuecomment-1959965135, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEYJZ7BRTDXLDTNN74OCRTYU6AWXAVCNFSM6AAAAABDRZZAY6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJZHE3DKMJTGU . You are receiving this because you were mentioned.Message ID: @.***>

smitch35 commented 4 months ago

So it looks better but there's some oddities

image As you can see its still not grabbing everything after the first server is added

image

power usage is almost working. The power buttons worked for each device but only server 1 has actually updated it's power usage that it's on giving it a higher wattage.

Not sure if i did this right I just pulled downe the tar in the custom_compoenents section, untarred it, named idrac_power to idrac_power_backup and the alpha to idrac_power and restarted HA

Breina commented 4 months ago

Just to rule out some stuff, could you please remove the integration completely, restart, then remove all of its (now disabled) entities, then add the integration once again. I'm still not sure why it's doing it like this.

smitch35 commented 4 months ago

This looks like it may be working image

It's slowly but surely grabbing everything image

smitch35 commented 4 months ago

Everything looks good to me button rpesses working, temps loading, fans loading. Also you can now say this works on idrac 7 as well lol.

image

Breina commented 4 months ago

Awesome! Thanks for testing! :)

taylor-mcdonald commented 3 months ago

I know this is marked as closed, but I'm having a similar problem when adding my second R720. Both are iDrac 7 enterprise. Even though it looks like two devices in the picture, there is only one device and the entities get all mixed up. Any ideas on how to fix?

image

smitch35 commented 3 months ago

First thing I think is make sure your on the latest version. Also I had to rename entites as I added devices to keep them traight.

taylor-mcdonald commented 3 months ago

I am on version 1.2.2 and did rename entities of the first 720 before adding the second. All the entities for the second still get lumped under the first device.

Does this part show more than one device for you? image

smitch35 commented 3 months ago

image

I will say it does look like this may be broken since updating Home assistant.

cbrherms commented 2 months ago

I have run in to the same issue also with 3 separate machines of various models on v1.2.2 with HA 2024.4.3. Appears all entities are associated with the final server added.

Breina commented 2 months ago

Can you guys please check the device serial is filled in properly?

image

If it's not, that means that entities from a previous version persisted. This is because the unique ID had been updated, which I try to avoid as much as possible.

Please try this procedure;

  1. Remove the integration
  2. Restart
  3. Remove all the old entities that are now no longer provided by the integration
  4. Restart
  5. Re-add the integration
taylor-mcdonald commented 2 months ago

I confirmed that the serial number pulled during the integration setup, matches the initial server I added. Although, the only place I can see that serial number listed anywhere is by going to https://host/redfish/v1/Chassis/System.Embedded.1.

I followed the listed procedure and ended up back with the same result (the number of entities are different, but there is only one overall device even though two are shown) image

Breina commented 2 months ago

Alright lads, I managed to reproduce it through mocking and fixed the issue in v1.2.3.

Please report back. :)

cbrherms commented 2 months ago

Alright lads, I managed to reproduce it through mocking and fixed the issue in v1.2.3.

Please report back. :)

Yup, can confirm creating separate devices now.

Did play around with it a bit over the weekend and came to the same conclusion that it was because of the identifiers added to the device on creation/update, specifically because each one had ('domain', DOMAIN) added as an identifier tuple

Though, I don't think the tuple really works as a 2 part label:value kind of pairing where the first part is describing what the value is, so should probably instead be set by identifiers={(DOMAIN, serial)}, so that the integration's domain is added as an identifier of what created it in the same way that other integrations do.

Also, two of the entities are created with identical unique id's, will pop a wee PR with these two changes.

taylor-mcdonald commented 2 months ago

Thanks for the fix. I now have 2 devices. Were the fans part of the entities that were grabbed before? I don't see them now. Also, using the Power On control gives this pop-up, but the servers turn on fine.

image

Breina commented 2 months ago

@taylor-mcdonald Please upgrade to v1.2.6 and put some logs in here, I'll have a look.