Hi there,
I finally setup snmp on Dream Machine Pro, but still have issues with:
- convert kbps to MB/s
- graphs are so slow not showing actual bandwidth usage.
- platform: unifi_status
host: xxx.xxx.xxx.xxx
port: 443
version: UDMP-unifiOS
username: USERNAME
password: PASSWORD
scan_interval: 1
monitored_conditions:
- www
- wan
- wlan
- lan
- alerts
- firmware
- platform: template
sensors:
unifi_status_wan_cpu:
friendly_name: "CPU"
unit_of_measurement: "%"
value_template: "{{ states.sensor.unifi_status_wan.attributes['gw_system-stats']['cpu'] }}"
unifi_status_wan_mem:
friendly_name: "Memory"
unit_of_measurement: "%"
value_template: "{{ states.sensor.unifi_status_wan.attributes['gw_system-stats']['mem'] }}"
unifi_status_wan_ip:
friendly_name: 'WAN IP'
value_template: '{{ states.sensor.unifi_status_wan.attributes.wan_ip }}'
unifi_status_wan_download:
friendly_name: 'WAN Download'
unit_of_measurement: kbps
icon_template: "mdi:progress-download"
value_template: "{{ (states.sensor.unifi_status_wan.attributes['rx_bytes-r'] / 1024) | int }}"
unifi_status_wan_upload:
friendly_name: "WAN Upload"
unit_of_measurement: kbps
icon_template: "mdi:progress-upload"
value_template: "{{ (states.sensor.unifi_status_wan.attributes['tx_bytes-r'] / 1024) | int }}"
unifi_status_wan_uptime:
friendly_name: "UDM Uptime"
value_template: >
{%- set time = states.sensor.unifi_status_wan.attributes['gw_system-stats']['uptime'] | int %}
{%- set minutes = ((time % 3600) // 60) %}
{%- set minutes = '{}min'.format(minutes) if minutes > 0 else '' %}
{%- set hours = ((time % 86400) // 3600) %}
{%- set hours = '{}hr '.format(hours) if hours > 0 else '' %}
{%- set days = (time // 86400) %}
{%- set days = '{}d '.format(days) if days > 0 else '' %}
{{ 'Less than 1 min' if time < 60 else days + hours + minutes }}
unifi_status_firmware_version:
friendly_name: "UDM Firmware Version"
icon_template: "mdi:database-plus"
value_template: "{{ states.sensor.unifi_status_wan.attributes.gw_version }}"
unifi_status_www_xput_down:
friendly_name: "UDM Speedtest Download"
unit_of_measurement: Mbps
icon_template: "mdi:progress-download"
value_template: "{{ states.sensor.unifi_status_www.attributes.xput_down }}"
unifi_status_www_xput_up:
friendly_name: "UDM Speedtest Upload"
unit_of_measurement: Mbps
icon_template: "mdi:progress-upload"
value_template: "{{ states.sensor.unifi_status_www.attributes.xput_up }}"
unifi_status_www_speedtest_ping:
friendly_name: "UDM Speedtest Ping"
unit_of_measurement: ms
icon_template: "mdi:progress-clock"
value_template: "{{ states.sensor.unifi_status_www.attributes.speedtest_ping }}"
unifi_status_www_uptime:
friendly_name: 'Internet Uptime'
value_template: >
{%- set time = states.sensor.unifi_status_www.attributes.uptime | int %}
{%- set minutes = ((time % 3600) // 60) %}
{%- set minutes = '{}min'.format(minutes) if minutes > 0 else '' %}
{%- set hours = ((time % 86400) // 3600) %}
{%- set hours = '{}hr '.format(hours) if hours > 0 else '' %}
{%- set days = (time // 86400) %}
{%- set days = '{}d '.format(days) if days > 0 else '' %}
{{ 'Less than 1 min' if time < 60 else days + hours + minutes }}
unifi_status_wlan_num_user:
friendly_name: 'Users Wifi'
icon_template: "mdi:account-multiple"
value_template: '{{ states.sensor.unifi_status_wlan.attributes.num_user }}'
unifi_status_lan_num_user:
friendly_name: 'Users Lan'
icon_template: "mdi:account-multiple"
value_template: '{{ states.sensor.unifi_status_lan.attributes.num_user }}'
Any ideas?
I want to use HA like monitoring for my network.
Thank you.