homeassistant-truenas icon indicating copy to clipboard operation
homeassistant-truenas copied to clipboard

More information in the System section and also update the api call

Open mrsaxenanitin opened this issue 11 months ago • 14 comments

Proposed change

Type of change

  • [*] Bugfix
  • [*] New feature
  • [ ] Code quality improvements to existing code or addition of tests
  • [ ] Documentation

Additional information

Checklist

  • [ ] The code change is tested and works locally.
  • [ ] The code has been formatted using Black.
  • [ ] Tests have been added to verify that the new code works.
  • [ ] Documentation added/updated if required.

mrsaxenanitin avatar Mar 15 '24 11:03 mrsaxenanitin

image

mrsaxenanitin avatar Mar 15 '24 11:03 mrsaxenanitin

Testing this pull, very nice work. Not sure if this is due to testing other changes to this integration but this update has created a new device, which is called "System" instead of "TrueNAS System". Otherwise it fixes a couple of the sensors.

googanhiem avatar Mar 20 '24 10:03 googanhiem

Also the polling interval might be too high. I turned it on at the red arrow in this pic.

image

On my weak system its taking up quite a few cpu cycles, getting all the data across.

EDIT: I reduced the update interval and its made a significant reduction on the cpu impact. Every 60s seems good enough for home assistant data needs. update_interval=timedelta(seconds=60),

googanhiem avatar Mar 21 '24 16:03 googanhiem

Found another issue, its not parsing the disk identifiers correctly. Should be showing 2318BV401352, but instead its using this in the entity_id field {serial_lunid}2318BV401352 or instead of 0xb2ba8014 it shows {serial}0xb2ba8014

Think its to do with this pull https://github.com/tomaae/homeassistant-truenas/pull/131

googanhiem avatar Mar 22 '24 13:03 googanhiem

Adding sensors for each memory value like that just needlessly adds load to HA database. It should be all under Memory attributes like they were before. Swap can be there too. Changes you made made to API values, would actually break the integration. Which truenas version are you using?

tomaae avatar Mar 23 '24 14:03 tomaae

Which truenas version are you using?

Thanks @tomaae for your reply. I am very new to the github and i only written code for my personal purpose.

I am happy that you reviewed it and appreciate your changes.

I am currently using the Beta version 24.04 and yesterday updated to RC1.

I am happy to see your updated repo.

Great work.

mrsaxenanitin avatar Mar 23 '24 15:03 mrsaxenanitin

Which truenas version are you using?

Thanks @tomaae for your reply. I am very new to the github and i only written code for my personal purpose.

I am happy that you reviewed it and appreciate your changes.

I am currently using the Beta version 24.04 and yesterday updated to RC1.

I am happy to see your updated repo.

Great work.

Just one feature request if its possible.

  1. Button to Start/Stop the VM's

mrsaxenanitin avatar Mar 23 '24 15:03 mrsaxenanitin

ah, I see. they are changing something again in new scale. will have to install it somewhere to see whats going on there.

you can start and stop VMs already, there is a service for it. You can create button from service if you need, just careful of missclick :)

tomaae avatar Mar 23 '24 15:03 tomaae

Most of these is now implemented, except swap. I will leave this PR in draft for now, may want to add swap too.

tomaae avatar Apr 03 '24 17:04 tomaae

Most of these is now implemented, except swap. I will leave this PR in draft for now, may want to add swap too. There are few things I wanted to highlight: I am running TrueNAS Version: Dragonfish-24.04-RC.1 We need to remove extra comma from the params to make it work: if self._is_scale and self._version_major >= 23: tmp_params = { "graphs": [ {"name": "load"}, {"name": "cputemp"}, {"name": "cpu"}, {"name": "arcsize"}, {"name": "arcactualrate"}, {"name": "memory"} ], "reporting_query": { "start": "-90", "end": "-30", "aggregate": True } } Rest everything seems to work perfectly

mrsaxenanitin avatar Apr 04 '24 03:04 mrsaxenanitin

Can you please add a toggle for the VM to Start/Stop? This will help everyone to automate the VM from Home Assistant enhancing the functionality of your integration to multi-fold.

mrsaxenanitin avatar Apr 04 '24 03:04 mrsaxenanitin

Most of these is now implemented, except swap. I will leave this PR in draft for now, may want to add swap too. There are few things I wanted to highlight: I am running TrueNAS Version: Dragonfish-24.04-RC.1 We need to remove extra comma from the params to make it work: if self._is_scale and self._version_major >= 23: tmp_params = { "graphs": [ {"name": "load"}, {"name": "cputemp"}, {"name": "cpu"}, {"name": "arcsize"}, {"name": "arcactualrate"}, {"name": "memory"} ], "reporting_query": { "start": "-90", "end": "-30", "aggregate": True } } Rest everything seems to work perfectly

what do you mean?

tomaae avatar Apr 04 '24 06:04 tomaae

Can you please add a toggle for the VM to Start/Stop? This will help everyone to automate the VM from Home Assistant enhancing the functionality of your integration to multi-fold.

Like I said, that is already possible. image

tomaae avatar Apr 04 '24 06:04 tomaae

Glad to see you're back at it @tomaae

Deldion avatar Apr 16 '24 16:04 Deldion