Giter VIP home page Giter VIP logo

homeassistant-truenas's People

Contributors

andreclemente avatar cyr-ius avatar dimand avatar getoliverleon avatar imgbotapp avatar stynoo avatar tomaae avatar uhtredthebold avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

homeassistant-truenas's Issues

Em0 RX/TX does not work[Bug]

DEm0 RX and Em0 TX appears at 0.

Em0 RX and Em0 TX appears at 0, and does not change when the EM0 values are changing on the TrueNAS interface.

How to reproduce the issue

Expected behavior

Screenshots

Software versions

  • Home Assistant version: 2022.6.6
  • TrueNAS integration version: 1.1
  • TrueNAS version: TrueNAS-13.0-RELEASE

Diagnostics data

Traceback/Error logs

Additional context

[Bug] Compatibility with legacy freenas boot pool

This is an old(er) system, installed during the FreeNAS days.
The boot pool is called freenas-boot what is most likely causing this issue.
This does work very well on a new(er) TrueNAS Scale system.

# zfs list | grep boot
freenas-boot                                                   29.1G  28.5G       64K  none
freenas-boot/.system                                            762M  28.5G     3.06M  legacy
freenas-boot/.system/configs-bd646a760d754b2abf350a01716f52a4   128M  28.5G      128M  legacy
freenas-boot/.system/cores                                       25K  1024M       25K  legacy
freenas-boot/.system/rrd-bd646a760d754b2abf350a01716f52a4       618M  28.5G      618M  legacy
freenas-boot/.system/samba4                                    1.50M  28.5G      120K  legacy
freenas-boot/.system/services                                    28K  28.5G       28K  legacy
freenas-boot/.system/syslog-bd646a760d754b2abf350a01716f52a4   11.1M  28.5G     11.1M  legacy
freenas-boot/.system/webui                                       27K  28.5G       27K  legacy
freenas-boot/ROOT                                              28.2G  28.5G       29K  none
freenas-boot/ROOT/11.3-RELEASE                                  242K  28.5G     1.00G  /
freenas-boot/ROOT/11.3-U1                                       250K  28.5G     1.00G  /
freenas-boot/ROOT/11.3-U2                                       248K  28.5G     1.01G  /
freenas-boot/ROOT/11.3-U3.1                                     272K  28.5G     1.01G  /
freenas-boot/ROOT/11.3-U3.2                                     281K  28.5G     1.01G  /
freenas-boot/ROOT/11.3-U4                                       287K  28.5G     1.01G  /
freenas-boot/ROOT/11.3-U4.1                                     270K  28.5G     1.01G  /
freenas-boot/ROOT/11.3-U5                                       286K  28.5G     1.02G  /
freenas-boot/ROOT/12.0-U1                                       186K  28.5G     1.16G  /
freenas-boot/ROOT/12.0-U1.1                                     216K  28.5G     1.16G  /
freenas-boot/ROOT/12.0-U2                                       194K  28.5G     1.16G  /
freenas-boot/ROOT/12.0-U2.1                                     193K  28.5G     1.16G  /
freenas-boot/ROOT/12.0-U3.1                                     174K  28.5G     1.16G  /
freenas-boot/ROOT/12.0-U4                                       170K  28.5G     1.18G  /
freenas-boot/ROOT/12.0-U4.1                                     176K  28.5G     1.18G  /
freenas-boot/ROOT/12.0-U5.1                                     174K  28.5G     1.18G  /
freenas-boot/ROOT/12.0-U6                                       204K  28.5G     1.18G  /
freenas-boot/ROOT/12.0-U6.1                                     206K  28.5G     1.18G  /
freenas-boot/ROOT/12.0-U7                                       208K  28.5G     1.20G  /
freenas-boot/ROOT/12.0-U8                                       234K  28.5G     1.20G  /
freenas-boot/ROOT/12.0-U8.1                                     209K  28.5G     1.20G  /
freenas-boot/ROOT/13.0-RELEASE                                  198K  28.5G     1.29G  /
freenas-boot/ROOT/13.0-U1                                       202K  28.5G     1.29G  /
freenas-boot/ROOT/13.0-U1.1                                    28.2G  28.5G     1.29G  /
freenas-boot/ROOT/FreeNAS-12.0-RELEASE                          180K  28.5G     1.07G  /
freenas-boot/grub                                              6.85M  28.5G     6.85M  legacy

[Bug] TrueNAS Scale duplicating Devices when adding multiple integrations

Describe the issue

When I add my two TrueNAS Scale instances to the homeassistant integration. The first integration of "AlphaNAS" creates AlphaNAS Disks, AlphaNAS Services, etc as Devices. When adding the second "BetaNAS" as another integration , it creates AlphaNAS Disks, AlphaNAS Services, AlphaNAS Disks, AlphaNAS Datasets, and BetaNAS System under the BetaNAS integration. When it should be BetaNAS Disks, etc. All but the System Devices seem to merge together between the two integrations and this is really annoying behaviour.

Expected behaviour

The two Devices should be seperate and not weirdly "merged" devices.

Software versions

  • Home Assistant version: HA 2022.7.7
  • TrueNAS integration version: v1.1.1
  • TrueNAS version: TrueNAS-SCALE-22.02.2.1

[Feature] Alerts

Is your feature request related to a problem? Please describe.

No

Describe the solution you'd like

It would be great to have notifications (errors, task completion, etc). They could be informative and also be the basis for automations.

Describe alternatives you've considered

I've used a rest sensor for alerts but it often gives errors as the api returns empty json if there are none. I know that the api exposes notification dismissal too, but not sure how that would be implemented.

Additional context

[Feature] total volume space and disc information

Is your feature request related to a problem? Please describe.

Hi folks, can be possible to have the total volume space sensor (or attribute), and and attribute on a disk sensor related to the pool that is member??

Describe the solution you'd like

Add some new sensor or attribute of the total pool space and attribute on the disk sensor related to the pool

Describe alternatives you've considered

Additional context

[Bug]TrueNas Datasets does not delete unavailable Datasets

Describe the issue

Hi,
I can see that integration does not deleting old datasets which are no more available in TrueNAS Below is a photo. Because it is not deleting it I have more than 1000 sensors

How to reproduce the issue

Juset go into TrueNAS Datasets section

Expected behavior

It will be good that unavailable datasets will be deleted from the list

Screenshots

image

Software versions

  • Home Assistant version: 2022.6.7
  • TrueNAS integration version: v1.1.1
  • TrueNAS version: TrueNAS-SCALE-22.02.1

Diagnostics data

config_entry-truenas-bfa43443e83bcd003ff195e0d480d8c7.json.txt

Traceback/Error logs

Additional context

[Bug] Hard disk temperature read fail.

Describe the issue

Some disk drive temperature information is missing or 0.

How to reproduce the issue

Steps to reproduce the behavior:
I removed some drive from the pool and set it online again (not the temperature read fail one), but same pool. The Ada0 is not upgrading temperature.

Expected behavior

Screenshots

I run my shell awk script to get de hdd temperature, and works well.

_#! /bin/sh

for i in $(sysctl -n kern.disks)
do
DevTemp=smartctl -a /dev/$i | awk '/Temperature_Celsius/{print $0}' | awk '{print $10 "C"}'
DevSerNum=smartctl -a /dev/$i | awk '/Serial Number:/{print $0}' | awk '{print $3}'
DevName=smartctl -a /dev/$i | awk '/Device Model:/{print $0}' | awk '{print $3}'
echo $i $DevTemp $DevSerNum $DevName
done_

With this result (right one):
root@Temido[~]# ./disktemps.sh
ada5 48C K42249R001653 Lexar
ada4 25C Z52B666K ST2000VN004-2E4164
ada3 33C ZFL37NA3 ST2000DM008-2FR102
ada2 27C WD-WCC4M3LGH3 WDC
ada1 27C Z52BBEF6 ST2000VN004-2E4164
ada0 25C 5YD1DRGT ST2000DL003-9VT166

Captura de pantalla 2022-04-14 a les 1 32 11
A Truenas Integration Screenshoot appears as 0 (also in developer tools).

Software versions

  • Home Assistant version:
  • TrueNAS integration version:
  • TrueNAS version:

Diagnostics data

Traceback/Error logs

Additional context

[Feature] renaming poorly defined SMBIOS in devices

Is your feature request related to a problem? Please describe.

My home-built TrueNAS reports as a "To Be Filled by O.E.M". That's kind of annoying.

Describe the solution you'd like

I'd like to be able to overwrite such silly strings with ... I dunno, some combination of the motherboard type, CPU type, enclosure, ... arbitrary text, really.

Describe alternatives you've considered

N/A

Additional context

dmidecode reports thusly:

System Information
        Manufacturer: To Be Filled By O.E.M.
        Product Name: To Be Filled By O.E.M.
        Version: To Be Filled By O.E.M.
        Serial Number: To Be Filled By O.E.M.
        UUID: f4c28570-b58b-0000-0000-000000000000
        Wake-up Type: Power Switch
        SKU Number: To Be Filled By O.E.M.
        Family: To Be Filled By O.E.M.

Handle 0x0002, DMI type 2, 15 bytes
Base Board Information
        Manufacturer: ASRock
        Product Name: J4105-ITX
        Version:                       
        Serial Number: XXXXXXXXXXXXXXX
        Asset Tag:                       
        Features:
                Board is a hosting board
                Board is replaceable
        Location In Chassis:                       
        Chassis Handle: 0x0003
        Type: Motherboard
        Contained Object Handles: 0

Handle 0x0003, DMI type 3, 22 bytes
Chassis Information
        Manufacturer: To Be Filled By O.E.M.
        Type: Desktop
        Lock: Not Present
        Version: To Be Filled By O.E.M.
        Serial Number: To Be Filled By O.E.M.
        Asset Tag: To Be Filled By O.E.M.
        Boot-up State: Safe
        Power Supply State: Safe
        Thermal State: Safe
        Security Status: None
        OEM Information: 0x00000000
        Height: Unspecified
        Number Of Power Cords: 1
        Contained Elements: 0
        SKU Number: To Be Filled By O.E.M.

Screenshot_2022-04-17_18-56-36

[Bug] failed during setup

Describe the issue

Failed to set up intergration

How to reproduce the issue

  1. add intergration
  2. select truenas
  3. add ip address and api key
  4. use ssl is disabled
  5. verify ssl cert is disabled
  6. submit
  7. box says "success"
  8. on the intergrations page says truenas "failed to set up" "check the logs"

Software versions

  • Home Assistant version: Home Assistant Core 2022.6.6
  • TrueNAS integration version: v1.0.2
  • TrueNAS version: core TrueNAS-13.0-RELEASE

Traceback/Error logs

This error originated from a custom integration.
Logger: homeassistant.config_entries
Source: custom_components/truenas/truenas_controller.py:231
Integration: TrueNAS (documentation, issues)
First occurred: 8:55:59 PM (2 occurrences)
Last logged: 8:56:20 PM
Error setting up entry TrueNAS for truenas
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 339, in async_setup
result = await component.async_setup_entry(hass, self)
File "/config/custom_components/truenas/init.py", line 29, in async_setup_entry
await controller.async_update()
File "/config/custom_components/truenas/truenas_controller.py", line 115, in async_update
await self.hass.async_add_executor_job(self.get_systemstats)
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/truenas/truenas_controller.py", line 231, in get_systemstats
max(tmp_graph[i]["aggregations"]["mean"]), 1
TypeError: '>' not supported between instances of 'NoneType' and 'NoneType'

Additional context

I have had it working but moved my truenas to a vm and the intergration failed, so i tried to do the intergration again

[Bug]

Describe the issue

此错误来自自定义集成。

Logger: custom_components.truenas.config_flow
Source: custom_components/truenas/config_flow.py:76
Integration: truenas (documentation, issues)
First occurred: 22:18:38 (1 occurrences)
Last logged: 22:18:38

TrueNAS connection error (no_response)

How to reproduce the issue

Expected behavior

Screenshots

Software versions

  • Home Assistant version: Home Assistant 2022.8.7
    Supervisor 2022.08.5
    Operating System 8.5
    前端版本: 20220802.0 - latest
  • TrueNAS integration version:
    v1.2.3
  • TrueNAS version: TrueNAS-SCALE-22.02.3

Diagnostics data

Traceback/Error logs

Additional context

网页捕获_2-9-2022_214017_192 168 50 75

It is not possible to ping truenas in Home Assistant

[Bug] Integration not working with TrueNAS running in VM

Seems that the intergration isn't able to get data from Truenas. Have made multiple attempts with multiple API keys and doesn't seem to fetch the data from the application

Version
core-2022.3.7
supervisor-2022.03.5
TrueNAS v1.0.1

TrueNAS (IP) unable to fetch data (500)
TrueNAS (IP) unable to fetch data (401)
TrueNAS (IP) unable to fetch data (no_respose)
TrueNAS (IP) unable to fetch data (no_respose)
TrueNAS (IP) unable to fetch data (no_respose)

Failed to set up integration

Describe the issue
Plugin fails to start with message: Failed to set up

How to reproduce the issue
Install like normal. Additional context may provide more insights.

Software versions
Home Assistant: 2022.12.3

TrueNAS integration version: v1.2.3
TrueNAS version: TrueNAS-SCALE-22.02.4

Diagnostics data
N/A

Traceback/Error logs
Logger: homeassistant.config_entries
Source: custom_components/truenas/truenas_controller.py:388
Integration: TrueNAS (documentation, issues)
First occurred: 10:49:57 AM (1 occurrences)
Last logged: 10:49:57 AM

Error setting up entry NAS for truenas
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 372, in async_setup
result = await component.async_setup_entry(hass, self)
File "/config/custom_components/truenas/init.py", line 29, in async_setup_entry
await controller.async_update()
File "/config/custom_components/truenas/truenas_controller.py", line 124, in async_update
await self.hass.async_add_executor_job(self.get_systemstats)
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/truenas/truenas_controller.py", line 388, in get_systemstats
max(list(filter(None, tmp_graph[i]["aggregations"]["mean"]))), 1
ValueError: max() arg is an empty sequence

Additional context
I am running an AMD Ryzen 5 5600G with Radeon Graphics on my system. The Linux Kernel that Scale is using doesn't have support for temperature https://bit.ly/3PnmYzA I am wondering if the "get_systemstats" in the log is corresponding with this missing temperature? Is there a way to ignore this missing stat if it is indeed the issue?

[Bug] boot-pool is unavailable on TrueNAS Scale

Describe the issue

boot-pool is unavailable on TrueNAS Scale

How to reproduce the issue

  1. Install via HACS
  2. Add the integration
  3. Note that "boot-pool" entities show as "Unavailable"

Expected behavior

boot-pool entities should be available similar to other ZFS pools

Screenshots

image

Software versions

  • Home Assistant version: 2022.12.8
  • TrueNAS integration version: 1.2.3
  • TrueNAS version: scale 22.12.0

Diagnostics data

Traceback/Error logs

Additional context

This problem existed before the upgrade to 2022.12.0 aka Bluefin. The boot-pool entities were working when using TrueNAS Core, but I have also removed and re-added the integration since migrating from core to scale.

[Feature] Add sensor(s) for memory usage

Describe the solution you'd like

Add a sensor for memory usage %, cached memory usage, and ZFS cache

Describe alternatives you've considered

Single memory usage sensory with cached and ZFS cache as attributes

Home Assistant integration devices list contains old version devices [Bug]

Describe the issue

In the Home Assistant integration, the devices are duplicate.
One with Firmware: TrueNAS-13.0-RELEASE
Another with Firmware: TrueNAS-13.0-U1.1

How to reproduce the issue

Go to Prameters > Devices > TrueNAS

Expected behavior

Only get one device per category. The one from the current version on the TrueNAS installation.

Screenshots

image
image
image

Software versions

  • Home Assistant version: HA 2022.8.5
  • TrueNAS integration version: HACS 1.2.1
  • TrueNAS version: TrueNAS-13.0-U1.1

Diagnostics data

Traceback/Error logs

Additional context

Sending commands

Hello! Sorry if this isn't best way to do this. I have a poweredge server that I run SCALE on directly, and I manually set fan speeds based on situations to control noise thresholds. This is done via an ipmitool shell command. Is it possible to use this integration to send a command for the machine run in its shell? The webui for SCALE doesn't seem to like mobile devices in the CLI. If not, no big. Just thought I'd ask!

[Bug] Need to rreload integration after truenas reboot.

Describe the issue

I am using a HASS button to call the truenas shutdown entity. But when the server is turned back on the integration does not reconnect to the API and the button no longer works unless I reload the integration.

How to reproduce the issue

Steps to reproduce the behavior:

  1. Turn off truenas pc
  2. Turn on truenas pc
  3. API no longer connected.

Expected behavior

I expect the truenas API to reconnect with HASS

Software versions

  • Home Assistant version: HA 2022.9.6
  • TrueNAS integration version: v1.2.3
  • TrueNAS version: SCALE-22.02.3

Datasheet usage not showing in HomeAssistant

Hey, just setup TrueNAS and saw your Integration via HACS in HomeAssistant.
But my HA cannot read the datasheet usage.

for my current test setup i have "pool1" with datasheets (pics, vids,music,...) HomeAssistant Sensor for the Pool is correct and showing in Homeassistant. when i delete oder copy files it shows up, but not for the Subfolders. (sensor.truenas_datasets_home_nas_backups)

Any Idea?

sry for my bad english, it is not my native language

[Pool healty sensor fail]

I have 3 pools at my TrueNAS. All of those appears OK at TrueNAS gui.

The healthy sensor of one of these pools appears as OFF.

Any known issue?

How to reproduce the issue

Expected behavior

Captura de pantalla 2022-04-19 a les 23 52 27
Captura de pantalla 2022-04-19 a les 23 51 55

Screenshots

Software versions

  • Home Assistant version:
  • TrueNAS integration version:
  • TrueNAS version:

Diagnostics data

Traceback/Error logs

Additional context

[Feature] Add switches to the integration to e.g. shutdown / reboot

Describe the solution you'd like

The TrueNAS integration should add switches to the home asisstant to stop / reboot the system and maybe also to start stop VMs, Serives and the like.

Describe alternatives you've considered

Alternatively it would be possible to use IMPI tools (for server hardware) to stop (even start) the server.
Also it could be possible to use the TrueNAS restful API to trigger these actions - the API documentation is a bit fuzzy though.

Additional context

This all is in remote management of all server from a central plattform, using HA as prosumer management tool.
Starting the server would also be cool, maybe using something trivial like WakeOnLan (even if I would prefer IPMI, but there is also not HA integration for IPMI :/ ---but I made a request).

Frequent high CPU usage on TrueNAS

First of all I'm really happy that someone finally created a TrueNAS integration to Home Assistant. I'm using FreeNAS and then Truenas for almost 4 years already and I always missed an integration for it and then, it finally had..

So the issue is that I realized that, regular as clockwork every 60 seconds the CPU usage spikes (see picture below) quite a lot, additionally to it's normal usage.
image
Of course I googled, and tried everything to make it stop, deleted snapshots etc. I tried to systematically stop every plugin, jail but nothing stopped it. I later noticed that during HA restart it behaves differently and after restarting HA the 60 sec intervals shift.
So I tried to disable the integrations which have any relation to my NAS and I noticed that when I disable the TrueNAS integration these spikes stop appearing again.
image
Later of course I tried again, enabling it and then disabling it and when its enabled, the minutely spikes are appearing and when it's diasbled, there are no more spikes.
image

I'm not really sure why this is happening but I'm sure that I don't want an information gathering integration to spike my NAS to a 16% CPU usage every minute when it's idling CPU usage is around 5%, which also affects power consumtion. Since I disabled the integration the power consumption decreased by about 2-3W which is a very low consumption but it's significant enough compared to it's idling consumption.
If this is an adverse effect to the integration then I must learn how to live without it but if it's a bug and can be fixed I would be more happy to use it again. Maybe it's only affects me like this, I don't know.

Software versions

  • Home Assistant version: HA 2023.1.7
  • TrueNAS integration version: I don't know how to check it
  • TrueNAS version: TrueNAS-12.0-U8

[Bug] Show scrub start/stop/remaining as timestamp instead of epoch

Is your feature request related to a problem? Please describe.

image

Describe the solution you'd like

Would like to see the times represented as HH:MM, something like output of zpool status

  scan: scrub in progress since Wed Apr 20 01:11:03 2022
        22.7T scanned at 640M/s, 21.9T issued at 617M/s, 28.1T total
        0B repaired, 77.75% done, 02:57:25 to go

Describe alternatives you've considered

n/a

Additional context

n/a

[Feature]

Is your feature request related to a problem? Please describe.

Need a way to get list of disks in a pool

Describe the solution you'd like

a new attribute for pool status listing the disks

Describe alternatives you've considered

Additional context

I have multiple pools with different disk types and I am trying to monitor disk temperature per pool

[Bug] TrueNAS sometimes returns null value for cputemp

Using debug logging I get this error when attempting to connect the integration for the first time:

This error originated from a custom integration.

Logger: homeassistant.config_entries
Source: custom_components/truenas/truenas_controller.py:231
Integration: TrueNAS (documentation, issues)
First occurred: 9:44:57 AM (2 occurrences)
Last logged: 10:13:00 AM

Error setting up entry TrueNAS for truenas
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 335, in async_setup
result = await component.async_setup_entry(hass, self)
File "/config/custom_components/truenas/init.py", line 29, in async_setup_entry
await controller.async_update()
File "/config/custom_components/truenas/truenas_controller.py", line 115, in async_update
await self.hass.async_add_executor_job(self.get_systemstats)
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/truenas/truenas_controller.py", line 231, in get_systemstats
max(tmp_graph[i]["aggregations"]["mean"]), 1
TypeError: '>' not supported between instances of 'NoneType' and 'float'

[Bug] max fails with empty list

Describe the issue

Plugin fails to start with message: Failed to set up

How to reproduce the issue

  1. Install
  2. Add integration
  3. Enter:
  • Name
  • Host IP
  • API Key
  • Use SSL
  • Verify SSL certificate
  1. Click Submit

Expected behavior

Screenshots

image
image

Software versions

- Home Assistant version:
Home Assistant: 2022.11.2
Supervisor: 2022.10.2
Operating System: 9.3
Frontend: 20221108.0 - latest

  • HACS version: 1.28.3
  • TrueNAS integration version: v1.2.3 -->
  • TrueNAS version: TrueNAS-SCALE-22.02.4

Diagnostics data

N/A

Traceback/Error logs

This error originated from a custom integration.

Logger: homeassistant.config_entries
Source: custom_components/truenas/truenas_controller.py:388
Integration: TrueNAS (documentation, issues)
First occurred: 11:45:49 AM (1 occurrences)
Last logged: 11:45:49 AM

Error setting up entry TrueNAS for truenas
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 365, in async_setup
result = await component.async_setup_entry(hass, self)
File "/config/custom_components/truenas/init.py", line 29, in async_setup_entry
await controller.async_update()
File "/config/custom_components/truenas/truenas_controller.py", line 124, in async_update
await self.hass.async_add_executor_job(self.get_systemstats)
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/truenas/truenas_controller.py", line 388, in get_systemstats
max(list(filter(None, tmp_graph[i]["aggregations"]["mean"]))), 1
ValueError: max() arg is an empty sequence

Additional context

Looks like this is another case of not sanitizing input values before performing operations on them.

Home Assistant Set-Up Error

Thanks for this integration! I'm running my TrueNAS on a HP server, so have been using the messier iLO integration. This looks very promising!

Describe the issue

I followed the steps to install the integration through HACS. Include the name, ip address and API. After successfully taking the information, the TrueNAS integration says "Failed to set up. Check the logs." When I check the logs, I get:

2022-08-10 08:20:01.467 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration truenas which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-08-10 08:20:18.554 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry TrueNAS for truenas
File "/config/custom_components/truenas/init.py", line 29, in async_setup_entry
File "/config/custom_components/truenas/truenas_controller.py", line 116, in async_update
File "/config/custom_components/truenas/truenas_controller.py", line 273, in get_systemstats

Software versions

-Home Assistant 2022.8.3

  • TrueNAS integration version:1.1.1 (latest)
  • TrueNAS version: TrueNAS-12.0-U8.1

Shout if you have any other questions.

Tx,
Jean

[Jira Tracker] TrueNAS API reports error 500 when sensor on TrueNAS side is not working

ok, I will only use another branch based on author's advice.

strange I have 2 TrueNAS Scale servers on different Proxmox servers. 1 is reporting correctly in HA and one I'm still getting a 500.

2022-04-11 11:24:07 DEBUG (SyncWorker_5) [custom_components.truenas.truenas_api] TrueNAS 192.168.1.101 query: system/info, get, {}
2022-04-11 11:24:07 DEBUG (SyncWorker_5) [custom_components.truenas.truenas_api] TrueNAS 192.168.1.101 query response: {'version': 'TrueNAS-SCALE-22.02.0.1', 'buildtime': {'$date': 1647930354000}, 'hostname': 'PCC-NAS2.localhost', 'physmem': 12552777728, 'model': 'AMD Phenom(tm) 9550 Quad-Core Processor', 'cores': 4, 'physical_cores': 4, 'loadavg': [0.04, 0.1, 0.04], 'uptime': '2:44:00.515940', 'uptime_seconds': 9840.515940204, 'system_serial': 'Not Specified', 'system_product': 'Standard PC (i440FX + PIIX, 1996)', 'system_product_version': 'pc-i440fx-6.1', 'license': None, 'boottime': {'$date': 1649680807088}, 'datetime': {'$date': 1649690647604}, 'birthday': None, 'timezone': 'America/Toronto', 'system_manufacturer': 'QEMU', 'ecc_memory': True}
2022-04-11 11:24:07 DEBUG (SyncWorker_5) [custom_components.truenas.apiparser] Processing source [{'version': 'TrueNAS-SCALE-22.02.0.1', 'buildtime': {'$date': 1647930354000}, 'hostname': 'PCC-NAS2.localhost', 'physmem': 12552777728, 'model': 'AMD Phenom(tm) 9550 Quad-Core Processor', 'cores': 4, 'physical_cores': 4, 'loadavg': [0.04, 0.1, 0.04], 'uptime': '2:44:00.515940', 'uptime_seconds': 9840.515940204, 'system_serial': '**REDACTED**', 'system_product': 'Standard PC (i440FX + PIIX, 1996)', 'system_product_version': 'pc-i440fx-6.1', 'license': None, 'boottime': {'$date': 1649680807088}, 'datetime': {'$date': 1649690647604}, 'birthday': None, 'timezone': 'America/Toronto', 'system_manufacturer': 'QEMU', 'ecc_memory': True}]
2022-04-11 11:24:07 DEBUG (SyncWorker_5) [custom_components.truenas.apiparser] Processing entry {'version': 'TrueNAS-SCALE-22.02.0.1', 'buildtime': {'$date': 1647930354000}, 'hostname': 'PCC-NAS2.localhost', 'physmem': 12552777728, 'model': 'AMD Phenom(tm) 9550 Quad-Core Processor', 'cores': 4, 'physical_cores': 4, 'loadavg': [0.04, 0.1, 0.04], 'uptime': '2:44:00.515940', 'uptime_seconds': 9840.515940204, 'system_serial': '**REDACTED**', 'system_product': 'Standard PC (i440FX + PIIX, 1996)', 'system_product_version': 'pc-i440fx-6.1', 'license': None, 'boottime': {'$date': 1649680807088}, 'datetime': {'$date': 1649690647604}, 'birthday': None, 'timezone': 'America/Toronto', 'system_manufacturer': 'QEMU', 'ecc_memory': True}
2022-04-11 11:24:08 DEBUG (SyncWorker_6) [custom_components.truenas.truenas_api] TrueNAS 192.168.1.101 query: reporting/get_data, post, {'graphs': [{'name': 'load'}, {'name': 'cpu'}, {'name': 'arcsize'}, {'name': 'arcratio'}], 'reporting_query': {'start': 'now-90s', 'end': 'now-30s', 'aggregate': True}}
2022-04-11 11:24:08 WARNING (SyncWorker_6) [custom_components.truenas.truenas_api] TrueNAS 192.168.1.101 unable to fetch data (500)

Originally posted by @pcampan in #9 (comment)

[Question] TrueNAS Integration Polling

I noticed that the polling for TrueNas entity data doesn't occur very frequent.
If I manually reload the integration or restart HA, the TrueNas value updates.

Question.

  1. What's the current polling interval for the TrueNas integration?
  2. Can it be manually modified/configured?

[Feature] Ability to start or stop an app in trueNAS scale

Is your feature request related to a problem? Please describe.

Ability to start or stop an application in trueNAS scale via homeassistant automations

Describe the solution you'd like

the list of apps to be shown as entities. and ability to start or stop it

Describe alternatives you've considered

looks like there is a abilaity to start and top Jails (in truenas core) but I would like to be able to do this with truenas scale. THANKYOU!

Additional context

2023-01-22_06h56_40

[Bug] No Error, Just Fails

Describe the issue

How to reproduce the issue

Expected behavior

Screenshots

Software versions

  • Home Assistant version:
  • TrueNAS integration version:
  • TrueNAS version:

Diagnostics data

Traceback/Error logs

Additional context

[Bug]

I'm getting the following error when trying to connect to the server:

image

Software versions

  • Home Assistant version: HA 2022.11.1
  • TrueNAS integration version: v1.2.3
  • TrueNAS version: SCALE-22.02.4

TrueNAS Integration Missing data[Bug]

Describe the issue

When I (re)Install the TrueNAS integration then I see the datasets and the Pools. Not even 1 minute later the datsets and pools don't show anymore

How to reproduce the issue

Steps to reproduce the behavior:

  1. (re)Install the TrueNAS integration
  2. Open TrueNAS Datasets in Integration (all datasets are there => see screenshot)
  3. Wait +- 1 minute
  4. Open TrueNAS Datasets in Integration (all datasets are gone => see screenshot)
  5. Open

Expected behavior

I expected that the datasets should remain, same for the Pools.

Screenshots

Uploaded

Software versions

All fields in this sections are required.

Traceback/Error logs

Nothing in errorlogs

Additional context

Reinstalled HACS, jail, HA, Integration. Same problem again and again

[Question] How do I find the correct entity id in HA to use /shutdown ?

I have installed this extension and many entities and stats are made available to home-assistant. Nice work, many thanks for this. I'm keen to use the shutdown service, as part of a UPS style of automation, and when I create a button in HA to call a service, it wants an entity-id, however I'm not quite sure which of the many this should be directed at. I would appreciate a pointer. Many thanks

Unable to fetch data "update/check_available" (504)[Bug]

Describe the issue

When adding the integration, the only device found is System.
Also, around once per minute, all the entities in System are going unavailable and then they come back with a value of 0. They never get a valid value.

How to reproduce the issue

Install the integration version 1.2.1 or 1.2.3
Go and check the device and the entities in the integration page.

Expected behavior

Get all the devices (Disks, Datasets, ...).
The entities would not become unavailable and they would update their values.

Screenshots

Software versions

  • Home Assistant version: HA 2022.8.6
  • TrueNAS integration version: 1.2.1 and 1.2.3
  • TrueNAS version: CORE 13.0-U1.1

Diagnostics data

config_entry-truenas-aa21eccbe3d0182fdcbc5938b51657d8.json.txt

Traceback/Error logs

Cette erreur provient d'une intégration personnalisée

Logger: custom_components.truenas.truenas_api
Source: custom_components/truenas/truenas_api.py:99
Integration: TrueNAS (documentation, issues)
First occurred: 15:54:59 (60 occurrences)
Last logged: 16:26:05

TrueNAS 192.168.1.5 unable to fetch data "update/check_available" (504)

Additional context

Tested also with 1.1.1 and 1.2 and everything is fine.

[Bug] unable to fetch data (500)

Describe the issue

Plugin returns error message in logs, all entities in HA report as Unavailable.
However, when viewing the entity, the plugin does correctly get the motherboard and TrueNAS version

Screen Shot 2022-04-16 at 10 08 38 AM

How to reproduce the issue

  • Add plugin via HACs
  • restart HA
  • Generate API key in TrueNAS, copy
  • Configure IP/Hostname, API key in HomeAssistant for the TrueNAS machine
  • restart HA

Expected behavior

Entities should have some information populated.

Software versions

  • Home Assistant version: HA 22.3 on HAOS 2022.04.0
  • TrueNAS integration version: 1.0.2
  • TrueNAS version: Core 12.0-U6

Diagnostics data

This error originated from a custom integration.

Logger: custom_components.truenas.truenas_api
Source: custom_components/truenas/truenas_api.py:98
Integration: TrueNAS (documentation, issues)
First occurred: 10:02:20 AM (5 occurrences)
Last logged: 10:06:20 AM

TrueNAS 192.168.0.10 unable to fetch data (500)

Traceback/Error logs

Nothing corresponding in the TrueNAS messages log file

Additional context

I'm running HAOS in a virtual machine, on the TrueNAS box I'm trying to collect stats from.

[Bug] TrueNAS graphs not returning values

After update HA 2022.4.4 to 2022.4.5,error logged and component can't load.
log as:
Error setting up entry TrueNAS for truenas
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 335, in async_setup
result = await component.async_setup_entry(hass, self)
File "/config/custom_components/truenas/init.py", line 29, in async_setup_entry
await controller.async_update()
File "/config/custom_components/truenas/truenas_controller.py", line 115, in async_update
await self.hass.async_add_executor_job(self.get_systemstats)
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/truenas/truenas_controller.py", line 231, in get_systemstats
max(tmp_graph[i]["aggregations"]["mean"]), 1
TypeError: '>' not supported between instances of 'NoneType' and 'float'

[Feature] Add network throughput

Hi friends!

I use trueNas since it was named freenas. I build my own interface based on SNMP to keep it clear at my HA. Yours is Great!!
Mine just report some basic information, but please check it out cause its different and gives additional information, and can be useful for more friends like us.

Thank you all for your job! I add today your integration at my HA, and will keep both methods working for some time.

My interface gives me some valid information, than yours still does not do. I list it here to give you some Ideas!

HOSTNAME

  • platform: snmp
    name: "Temido Name"
    host: !secret temido_ip
    baseoid: 1.3.6.1.2.1.1.5.0
    community: !secret snmpcom
    version: "2c"
    scan_interval: 86400

DESCRIPTION

  • platform: snmp
    name: "Temido Descript"
    host: !secret temido_ip
    baseoid: 1.3.6.1.2.1.1.1.0
    community: !secret snmpcom
    version: "2c"
    scan_interval: 86400

CONTACT

  • platform: snmp
    name: "Temido Contact"
    host: !secret temido_ip
    baseoid: 1.3.6.1.2.1.1.4.0
    community: !secret snmpcom
    version: "2c"
    scan_interval: 86400

LOCATION

  • platform: snmp
    name: "Temido Location"
    host: !secret temido_ip
    baseoid: 1.3.6.1.2.1.1.6.0
    community: !secret snmpcom
    version: "2c"
    scan_interval: 86400

USERS

  • platform: snmp
    name: "Temido concurrent users"
    host: !secret temido_ip
    baseoid: .1.3.6.1.2.1.25.1.5.0
    community: !secret snmpcom
    version: "2c"
    scan_interval: 150

SSH LOGINS

  • platform: snmp
    name: "Temido W"
    host: !secret temido_ip
    community: !secret snmpcom
    version: "2c"
    baseoid: .1.3.6.1.2.1.25.1.21
    scan_interval: 300

Number of process

  • platform: snmp
    name: "Temido CPU process"
    host: !secret temido_ip
    baseoid: .1.3.6.1.2.1.25.1.6.0
    value_template: "{{(value)}}"
    community: !secret snmpcom
    version: "2c"
    scan_interval: 30

DETAILED UPTIME

  • platform: snmp
    host: !secret temido_ip
    community: !secret snmpcom
    version: "2c"
    baseoid: .1.3.6.1.2.1.25.1.1.0
    name: TEMIDO Uptime
    scan_interval: 60
    value_template: >-
    {% set timetick = value | int %}
    {% set minutes = ((timetick % 360000) / 6000) | int%}
    {% set hours = ((timetick % 8640000) / 360000) | int %}
    {% set days = (timetick / 8640000) | int %}
    {%- if timetick < 6000 -%}
    Less than a minute
    {%- else -%}
    {%- if days > 0 -%}
    {%- if days == 1 -%}
    1 day
    {%- else -%}
    {{ days }} days
    {%- endif -%}
    {%- endif -%}
    {%- if hours > 0 -%}
    {%- if days > 0 -%}
    {{ ', ' }}
    {%- endif -%}
    {%- if hours == 1 -%}
    1 hr
    {%- else -%}
    {{ hours }} hrs
    {%- endif -%}
    {%- endif -%}
    {%- if minutes > 0 -%}
    {%- if days > 0 or hours > 0 -%}
    {{ ', ' }}
    {%- endif -%}
    {%- if minutes == 1 -%}
    1 min
    {%- else -%}
    {{ minutes }} min
    {%- endif -%}
    {%- endif -%}
    {%- endif -%}

ETH IN and OUT NETWORK SPEED

  • platform: snmp
    name: 'Temido Eth In'
    host: !secret temido_ip
    baseoid: 1.3.6.1.2.1.31.1.1.1.6.1
    #baseoid: 1.3.6.1.2.1.2.2.1.10.1
    community: !secret snmpcom
    version: '2c'

  • platform: snmp
    name: 'Temido Eth Out'
    host: !secret temido_ip
    baseoid: 1.3.6.1.2.1.31.1.1.1.10.1
    community: !secret snmpcom
    version: '2c'

  • platform: derivative
    name: 'Temido Eth In Stats'
    source: sensor.temido_eth_in
    unit_time: s
    unit: B

  • platform: derivative
    name: 'Temido Eth Out Stats'
    source: sensor.temido_eth_out
    unit_time: s
    unit: B

  • platform: template
    sensors:
    temido_eth_in_mbps:
    value_template: "{{ [((states('sensor.temido_eth_in_stats')|float(none))/1000000)|round(2, default=none),0]|max }}"
    unit_of_measurement: 'MBps'
    temido_eth_out_mbps:
    value_template: "{{ [((states('sensor.temido_eth_out_stats')|float(none))/1000000)|round(2, default=none),0]|max }}"
    unit_of_measurement: 'MBps'_

I let you here some screenshoots!

Best regards, and thank you all!

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

Captura de pantalla 2022-04-11 a les 6 51 32
Captura de pantalla 2022-04-11 a les 6 51 54
Captura de pantalla 2022-04-11 a les 6 52 10

Describe alternatives you've considered

Additional context

[Bug] No response from host

I am using TrueNAS 12.0.U1.1 and Home Assistant 2022.4.7
I could intall the integration via HACS, but when I try to connect to the TrueNas host I just get "No response from host". Is this a bug or maybe something missing in the installation description?

[Bug] No response from host

Describe the issue

Go to setup integration - Put in all relevent details and then it says no response from host
All details are triple checked to be correct

How to reproduce the issue

"No response from host"

Expected behavior

Screenshots

Software versions

  • Home Assistant version:
  • TrueNAS integration version:
  • TrueNAS version:

Diagnostics data

Traceback/Error logs

Additional context

Failed to Setup against Turenas Scale

Describe the issue

Unable to get the integration to my TrueNAS Scale to work.
Added the integration but error:
2022-05-22 10:45:13 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry truenas for truenas
File "/config/custom_components/truenas/init.py", line 29, in async_setup_entry
File "/config/custom_components/truenas/truenas_controller.py", line 115, in async_update
File "/config/custom_components/truenas/truenas_controller.py", line 231, in get_systemstats

How to reproduce the issue

Add Integrations
Fill in details:
Name = truenas
Host = 192.168.10.15 and also tried with name
API key = generated from my truenas system
Tried all combinations of 'Use SSL' and 'Verify SSL Certificates'

Expected behavior

Integration installs without error

Screenshots

N/A

Software versions

  • Home Assistant version: core-2022.5.5
  • TrueNAS integration version: v1.0.1
  • TrueNAS version: TrueNAS-SCALE-22.02.1

Diagnostics data

2022-05-22 10:45:11 INFO (MainThread) [homeassistant.setup] Setting up truenas
2022-05-22 10:45:11 INFO (MainThread) [homeassistant.setup] Setup of domain truenas took 0.0 seconds

This seems to indicate that the initial connection and reading is fine.

But then getting the systemstats seems to fail:
2022-05-22 10:45:13 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry truenas for truenas
File "/config/custom_components/truenas/init.py", line 29, in async_setup_entry
File "/config/custom_components/truenas/truenas_controller.py", line 115, in async_update
File "/config/custom_components/truenas/truenas_controller.py", line 231, in get_systemstats

[Bug] temperature sensors showing as wrong unit of measure

Describe the issue

All temperatures showing the Celsius value but with Fahrenheit unit of measure. Ie. If a disk is 40 C, it shows as 40 F. If I manually edit the sensor to show in Celsius, it converts 40 as if it were fahrenheit.

How to reproduce the issue

Expected behavior

The value of the sensor is correct but the unit of measure is wrong (should be Celsius, not fahrenheit)

Screenshots

Software versions

  • Home Assistant version:
  • TrueNAS integration version:
  • TrueNAS version:
    TrueNAS-SCALE-22.02.4

Diagnostics data

Traceback/Error logs

Additional context

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.