Custom component for DD-WRT routers

Hi all,

Here’s another component I’ve been working on: an updated version of the DD-WRT component which adds almost all info available from a DD-WRT router. It’s still beta, but I think most bugs are resolved now.

Configuration is supported in three ways:

  1. In the Lovelace GUI ( Configuration -> Integrations -> Click the + sign -> DD-WRT )
  2. By SSDP protocol (enable UPnP in your DD-WRT router and it should be auto-detected)
  3. Using the configuration.yaml file. Note: This updated component will break with the configuration of the current dd-wrt component the HomeAssistant.

A simple config could be:

ddwrt:
    - name: router
      host: 192.168.1.1
      username: administrator
      password: my_very_secret_password
      ssl: true
      verify_ssl: false

An extended config could be like this:

ddwrt:
    - name: router
      host: 192.168.1.1
      username: administrator
      password: my_very_secret_password
      ssl: true
      verify_ssl: false
      device_tracker:
        - arp
        - dhcp
        - pppoe
        - pptp
        - wds
        - wireless
      binary_sensor:
        - wan_connected
        - wl_radio
      sensor:
        - clk_freq
        - cpu_temp
        - firmware_build
        - firmware_date
        - firmware_version
        - ip_connections
        - lan_dhcp_start
        - lan_dhcp_end
        - lan_dhcp_lease_time
        - lan_dns
        - lan_gateway
        - lan_ipaddr
        - lan_mac
        - lan_netmask
        - lan_proto
        - load_average1
        - load_average5
        - load_average15
        - network_bridges
        - router_time
        - uptime
        - voltage
        - wan_3g_signal
        - wan_dhcp_remaining
        - wan_dns0
        - wan_dns1
        - wan_dns2
        - wan_gateway
        - wan_ipaddr
        - wan_ip6addr
        - wan_netmask
        - wan_pppoe_ac_name
        - wan_proto
        - wan_status
        - wan_traffic_in
        - wan_traffic_out
        - wan_uptime
        - wl_ack
        - wl_active
        - wl_busy
        - wl_channel
        - wl_count
        - wl_mac
        - wl_quality
        - wl_rate
        - wl_ssid
        - wl_xmit
2 Likes

Whats the progress my friend :slight_smile: @eelcohn

This should be removed. Its not there

Hi Vasco, thanks for your reply. Good to see that some of you use this component :slight_smile:
Is there any specific issue that you want to be fixed? I’m working on an updated version, but please note that this is one of my project’s I’m doing in my spare time so it might take a while…

Well… No.

The DD-WRT component should work both in configuration.yaml mode and in UI-config mode. If one of these methods doesn’t work, please open an issue so I know what the problem is that you’re running into. Just saying ‘this should be removed’ is not the way to go :wink:

Also, please read this article: https://www.home-assistant.io/blog/2020/04/14/the-future-of-yaml/
Home Assistant is moving towards the UI-config method, although the yaml config method will still be supported

@Ben_Ellis and others: I can confirm that the UI configuration part of this custom component is broken in Home Assistant version 0.106.0 and upwards. I’m working on an updated version which should fix this.

thanks @eelcohn

Currently I’m running 0.109.6 and I’m having issues getting this setup on my system. This is for an internal router operating as a client bridge which I can access without issue with the credentials I have in my setup. My ddwrt config is:

ddwrt:
  devices:
    - name: Client Bridge 1
      host: !secret ddwrt_host
      username: !secret ddwrt_admin_user
      password: !secret ddwrt_admin_password
      ssl: false
      verify_ssl: false

The configuration verifies as good, but on restart I get “ERROR (MainThread) [homeassistant.setup] Setup failed for ddwrt: Integration failed to initialize.” and no other indications of what is wrong.

@eelcohn
Thank you for your integration!
Some bug report:
If binary sensors activated

binary_sensor:
   - wan_connected
   - wl_radio

HA log data:

Unable to update wireless data: list index out of range
Unable to update WAN data: list index out of range

HA: 0.113.2
DD-WRT: v3.0-r40559 std (08/06/19)
Router: Asus RT-N18U

In case anyone’s wonding: yes, I’m still maintaining this component, I just don’t have that much time.

I am working on a new version which should be fully compatible with modern versions of HomeAssistant and can be setup using the GUI in Setup -> Integrations.

1 Like

Great. Looking forward to the new version. ATM, upnp isn’t picking up my router. It has at one point. Then it stop. Don’t know why.

Sounds great :wink:

I’ve just published v1.1.0 of the DD-WRT integration on https://www.github.com/eelcohn/home-assistant-ddwrt. For anyone who has issues with v1.0.0, upgrade by doing:

  • Create a backup of your configuration, including the custom_components folder
  • Remove all DD-WRT integrations from Home Assistant
  • Copy/install v1.1.0 of the DD-WRT integration
  • Setup/configure the new component, either from the UI Integrations page, or from the configuration.yaml file

Please open an issue on github if you experience any issues. Also, please let me know if you like the new version :slight_smile:

Can you find out if this is due to a Home Assistant version upgrade? And if so, in what version did the UPNP work, and from what version of Home Assistant didn’t?

Please note that the configuration.yaml setup has changed! You can now setup the integration using configuration.yaml with:

Simple configuration:

ddwrt:
  - host: !secret ddwrt_hostname

Advanced configuration:

ddwrt:
  - host: !secret ddwrt_hostname
    username: !secret ddwrt_username
    password: !secret ddwrt_password
    ssl: true
    verify_ssl: false
    resources:
      - clk_freq
      - cpu_temp
      - ddns_status
      - dhcp_clients
      - sw_build
      - sw_date
      - sw_version
      - ip_connections
      - lan_dhcp_start
      - lan_dhcp_end
      - lan_dhcp_lease_time
      - lan_dns
      - lan_gateway
      - lan_ipaddr
      - lan_mac
      - lan_netmask
      - lan_proto
      - load_average1
      - load_average5
      - load_average15
      - network_bridges
      - nvram_used
      - nvram_total
      - router_manufacturer
      - router_model
      - router_time
      - uptime
      - voltage
      - wan_3g_signal
      - wan_dhcp_remaining
      - wan_dns0
      - wan_dns1
      - wan_dns2
      - wan_dns3
      - wan_dns4
      - wan_dns5
      - wan_gateway
      - wan_ipaddr
      - wan_ip6addr
      - wan_netmask
      - wan_pppoe_ac_name
      - wan_proto
      - wan_status
      - wan_traffic_in
      - wan_traffic_out
      - wan_uptime
      - wl_ack_timing
      - wl_ack_distance
      - wl_active
      - wl_busy
      - wl_channel
      - wl_count
      - wl_mac
      - wl_quality
      - wl_rate
      - wl_rx_packet_error
      - wl_tx_packet_error
      - wl_rx_packet_ok
      - wl_tx_packet_ok
      - wl_ssid
      - wl_xmit
      - wan_connected
      - wl_radio
      - traffic

Oh my. It has been awhile. From memory, I started using HA for the first time back in April of this year. That is when it was working. A month later, I did a fresh install of HA and that was when upnp never pickup my router.

Just tried it again to see if upnp integration is working with v.117 HA. Still no go.

Maybe something changed with your router settings around that time which might be causing your issues?

@moto2000 @duceduc I’ve created an issue on github so I can track this problem: https://github.com/eelcohn/home-assistant-ddwrt/issues/6

1 Like

As for as I can tell, I didn’t update the firmware (ddwrt), or did any drastic changes other then adding/removing devices.

1 Like