Channel type pihole:number could not be resolved in Pi-hole Configuration

Hi everyone,

I’m trying to set up a Pi-hole server in my OpenHAB configuration, but I’m running into an error. I’m seeing the message:

Channel type pihole:number could not be resolved

Here’s the configuration I’m using for my Pi-hole thing:

plaintext

Code kopieren

Thing pihole:server:livingroom "Pi-hole" @ "Livingroom"
[
    refreshIntervalSeconds=120,
    hostname="url",
    token="token"
] {
    Channels:
        Type number : domains_being_blocked "Domains Blocked" [ ]
        Type number : dns_queries_today "DNS Queries Today" [ ]
        Type number : ads_blocked_today "Ads Blocked Today" [ ]
        Type number : ads_percentage_today "Ads Percentage Today" [ ]
        Type number : unique_domains "Unique Domains" [ ]
        Type number : queries_forwarded "Queries Forwarded" [ ]
        Type number : queries_cached "Queries Cached" [ ]
        Type number : clients_ever_seen "Clients Ever Seen" [ ]
        Type number : unique_clients "Unique Clients" [ ]
        Type number : dns_queries_all_types "DNS Queries (All Types)" [ ]
        Type number : reply_UNKNOWN "Reply UNKNOWN" [ ]
        Type number : reply_NODATA "Reply NODATA" [ ]
        Type number : reply_NXDOMAIN "Reply NXDOMAIN" [ ]
        Type number : reply_CNAME "Reply CNAME" [ ]
        Type number : reply_IP "Reply IP" [ ]
        Type number : reply_DOMAIN "Reply DOMAIN" [ ]
        Type number : reply_RRNAME "Reply RRNAME" [ ]
        Type number : reply_SERVFAIL "Reply SERVFAIL" [ ]
        Type number : reply_REFUSED "Reply REFUSED" [ ]
        Type number : reply_NOTIMP "Reply NOTIMP" [ ]
        Type number : reply_OTHER "Reply OTHER" [ ]
        Type number : reply_DNSSEC "Reply DNSSEC" [ ]
        Type number : reply_NONE "Reply NONE" [ ]
        Type number : reply_BLOB "Reply BLOB" [ ]
        Type number : dns_queries_all_replies "DNS Queries (All Replies)" [ ]
        Type number : privacy_level "Privacy Level" [ ]
        Type switch : enabled "Status" [ ]
        Type string : disable-enable "Disable Blocking" [ ]
}

I’ve double-checked the binding and configuration, but I’m still unsure what might be causing the error. Here are some questions I have:

  1. Could this be a compatibility issue with the Pi-hole binding version?
  2. Am I missing any additional configuration settings?
  3. Is there an alternative way to define channels that might resolve this issue?

Any advice or insights would be greatly appreciated! Thanks in advance!

You don’t need to define all those channels. So change the configuration to

Thing pihole:server:livingroom "Pi-hole" @ "Livingroom"
[
    refreshIntervalSeconds=120,
    hostname="url",
    token="token"
]

and openHAB will create all the channels by itself.
In fact, the channels are of type “number-channel”, “enabled-channel” and “disable-enable-channel”, but there’s no point defining the channels, as they are not meant to be configurable.

I don’t know if this was changed some time ago so maybe documentation is only outdated…