tomaae / homeassistant-truenas

TrueNAS integration for Home Assistant
Apache License 2.0
183 stars 16 forks source link

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

Open mrsaxenanitin opened 6 months ago

mrsaxenanitin commented 6 months ago

Proposed change

Type of change

Additional information

Checklist

mrsaxenanitin commented 6 months ago

image

googanhiem commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

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

tomaae commented 5 months ago

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?

mrsaxenanitin commented 5 months ago

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 commented 5 months ago

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
tomaae commented 5 months ago

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 commented 5 months ago

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

mrsaxenanitin commented 5 months ago

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 commented 5 months ago

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.

tomaae commented 5 months ago

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 commented 5 months ago

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

Deldion commented 4 months ago

Glad to see you're back at it @tomaae