Skip to content

floringhimie/Zyxel-NSA310-Home-Assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Home-Assistant Python Scripts

Python Scripts for Home-Assistant (http://www.home-assistant.io)

Zyxel-NSA310-Home-Assistant Monitoring

This is a python script to grab data from Zyxel NSA310 NAS and display in Home Asisstant as sensors. The script is connecting to the WEB UI and take:

  • CPU Usage

  • CPU Temp

  • HDD Health

  • HDD Usage

  • Memory Usage

    image

And create a JSON for Home Asistant Sensor: { "cpu_usage": 0, "cpu_temp": "42.00", "mem_usage": "22", "hdd_usage": "47", "hdd_health": "healthy" }

image

**** This is not an official integration.

Working Model and firmware version:

Model Name NSA310 Firmware Version V4.70(AFK.3)

Depending on your firmware version this script can be ajusted. What I saw on different version the link is different, for example mine is $IP/r49435/

image

Installation

  • If not exist, in /config/python_scripts/ create a file called nsa310_get_info.py
  • Copy the code inside.
  • Configure with config below.
  • Restart Home-Assistant.

Usage

To use this sensor add the following to your sensors.yaml file:

Example sensors.yaml entry

Please change the $IP $USERNAME $PASSWORD with your NSA ip, username and password used to login to the NSA.

- platform: command_line
  name: nsa310
  json_attributes:
    - cpu_usage
    - cpu_temp
    - mem_usage
    - hdd_usage
    - hdd_health
  command: python3 /config/python_scripts/nsa310_get_info.py $IP $USERNAME $PASSWORD
  value_template: '{{ value_json.cpu_usage }}'
  unit_of_measurement: "%"
  scan_interval: 60
  
  - platform: template  
  sensors:
    cpu_temp:
      friendly_name: 'NSA310 CPU Temp' 
      value_template: '{{ states.sensor.nsa310.attributes.cpu_temp }}'
      unit_of_measurement: "°C"
    mem_usage:
      friendly_name: 'NSA310 Memory Usage' 
      value_template: '{{ states.sensor.nsa310.attributes.mem_usage }}'
      unit_of_measurement: "%"
    hdd_usage:
      friendly_name: 'NSA310 HDD Usage' 
      value_template: '{{ states.sensor.nsa310.attributes.hdd_usage }}'
      unit_of_measurement: "%"  
    hdd_health:
      friendly_name: 'NSA310 HDD Health' 
      value_template: '{{ states.sensor.nsa310.attributes.hdd_health }}'

image

About

Python script to get data from Zyxel NSA310 Network attached storage and display in Home Assistant as sensors.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages