You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the knx_listener input to monitor a KNX bus. On the bus there's an MDT Glass Push-button that can receive a 14 byte Message telegram of type DPT 16.000 (ASCII text). I want to log and all other telegrams to a database.
Expected behavior
knx_listener should convert DPT 16.000 (ASCII text) to string.
Actual behavior
knx_listener fails to convert DPT 16.000 (ASCII text) to string:
Apr 15 11:46:16 hostname telegraf[1058269]: 2024-04-15T09:46:16Z D! [inputs.knx_listener] Matched GA "5/3/5" to measurement "<name of GA>" with value <ASCII contents of the message>
Apr 15 11:46:16 hostname telegraf[1058269]: 2024-04-15T09:46:16Z E! [inputs.knx_listener] Type conversion string failed for address "5/3/5"
This prevents the DPT 16.000 (ASCII text) telegrams from being logged.
Additional info
I'm not really familiar with Go, but this seems to be a simple fix - just add String to the existing conversion table:
hostname ~/telegraf # git diff plugins/inputs/knx_listener/knx_listener.go
diff --git a/plugins/inputs/knx_listener/knx_listener.go b/plugins/inputs/knx_listener/knx_listener.go
index f013fe638..f81dc9e1a 100644
--- a/plugins/inputs/knx_listener/knx_listener.go+++ b/plugins/inputs/knx_listener/knx_listener.go@@ -187,6 +187,8 @@ func (kl *KNXListener) listen(acc telegraf.Accumulator) {
value = vi.Uint()
case reflect.Float32, reflect.Float64:
value = vi.Float()
+ case reflect.String:+ value = vi.String()
default:
kl.Log.Errorf("Type conversion %v failed for address %q", vi.Kind(), ga)
continue
This seems to be working for me, knx_listener now successfully produces strings for the message telegrams.
The text was updated successfully, but these errors were encountered:
Use Case
I'm using the
knx_listener
input to monitor a KNX bus. On the bus there's an MDT Glass Push-button that can receive a 14 byte Message telegram of type DPT 16.000 (ASCII text). I want to log and all other telegrams to a database.Expected behavior
knx_listener should convert DPT 16.000 (ASCII text) to string.
Actual behavior
knx_listener fails to convert DPT 16.000 (ASCII text) to string:
This prevents the DPT 16.000 (ASCII text) telegrams from being logged.
Additional info
I'm not really familiar with Go, but this seems to be a simple fix - just add
String
to the existing conversion table:This seems to be working for me, knx_listener now successfully produces strings for the message telegrams.
The text was updated successfully, but these errors were encountered: