Can't visualize energy telemetry from Sonoff POW R2 / Tasmota KNX firmware

Hi all,
I’ve recently purchased a Sonoff POW R2 and flashed it with the tasmota KNX firmware since I have my entire home running on KNX & Openhab.

I’m able to control the switch and toggle the relay. All fine here, but, since I can also get the energy telemetry, I want to setup for each telemetry value a specific GA in my things config file and the related config in my item config file to read those values and visualize them. Now, I’ve done that for the voltage value, but in Paper UI I only see a -NaN value.

To understand what is happening, I’ve enabled the calimero tracing to check that the KNX telegrams are received with:

log:set TRACE org.openhab.binding.knx
log:set TRACE calimero

I see all the telemetry values in the OH log and it seems that they are correctly assigned to the related GA but can’t visualize them. Why?

The following is the setup of my flashed Sonoff:

This is the tracing of the messages in the Sonoff console, so the telemetry values are assigned.

07:52:07 KNX: Voltage sent to 2.2.0
07:52:07 KNX: Current sent to 2.2.1
07:52:07 KNX: Power sent to 2.2.2
07:52:07 KNX: Power Factor sent to 2.2.3
07:52:07 KNX: Energy Today sent to 2.2.4
07:52:07 KNX: Energy Total sent to 2.2.6
07:52:07 KNX: Energy Yesterday sent to 2.2.5
07:52:07 RSL: SENSOR = {“Time”:“2020-05-04T07:52:07”,“ENERGY”:{“TotalStartTime”:“2020-04-30T21:49:47”,“Total”:0.004,“Yesterday”:0.004,“Today”:0.000,“Period”:0,“Power”:0,“ApparentPower”:0,“ReactivePower”:0,“Factor”:0.00,“Voltage”:0,“Current”:0.000}}

This is the setup in my Things file:

Bridge  knx:ip:EK-BB1-TP-R "EKINEX KNX/IP Interface" @ "KNX" [
        type="ROUTER",
        ipAddress="224.0.23.12",
        portNumber=3671,
        localIp="192.168.x.x",
        readingPause=50,
        responseTimeout=10,
        readRetriesLimit=3,
        autoReconnectPeriod=60,
        localSourceAddr="0.0.0" ]
{
        Thing device SONOFF-TP_17 "Switch Actuator 2" @ "KNX" [ address="1.1.20", fetch=false, pingInterval=0, readInterval=0 ]
        {
                Type switch-control: Ch_170_Control "Channel 17.0 Control" [ ga="2/0/0" ]
                Type switch: Ch_171 "Channel 17.1" [ ga="2/0/0+2/0/1" ]
                Type number : Ch_172 "Voltage"  [ ga="2/2/0" ]
        }
}

This is the output I receive on the openhab.log (please focus on ga 2/2/0)

2020-05-04 09:17:00.936 [DEBUG] [nx.internal.client.AbstractKNXClient] - Wrote value ‘ON’ to datapoint ‘command DP 2/0/0 ‘knx:ip:EK-BB1-TP-R’, DPT id 1.001, low priority’ (0. attempt).
2020-05-04 09:17:01.028 [WARN ] [p.KNXnet/IP Routing 224.0.23.12:3671] - received frame length 0 for KNXnet/IP routing.ind (0x530 v1.0) length 17 - ignored
2020-05-04 09:17:01.030 [TRACE] [nx.internal.client.AbstractKNXClient] - Received a Group Write telegram from ‘1.1.20’ to ‘2/0/0’ with value ‘[1]’
2020-05-04 09:17:01.030 [DEBUG] [calimero.link.224.0.23.12:3671 ] - indication 1.1.20->2/0/0 L_Data.ind, low priority hop count 6, tpdu 00 81
2020-05-04 09:17:07.012 [DEBUG] [calimero.link.224.0.23.12:3671 ] - indication 1.1.20->2/2/0 L_Data.ind, low priority hop count 6, tpdu 00 80 25 59
2020-05-04 09:17:07.012 [TRACE] [nx.internal.client.AbstractKNXClient] - Received a Group Write telegram from ‘1.1.20’ to ‘2/2/0’ with value '[37, 89]'

Also the voltage values I see in the returned telegram is odd. I would expect a higher Voltage since I’m powering a 202V light bulb and not [37, 89] and why 2 values?

In my Item config file, I have the following entry:

Group gStaircase
Switch L_GF01_01_Staircase "Luce delle scale" <light> (gStaircase) { alexa="Switchable", channel="knx:device:EK-BB1-TP-R:SONOFF-TP_17:Ch_171" }
Number L_GF01_01_Staircase_Voltage "Voltage [%.0f V]" <energy> (gStaircase) { channel="knx:device:EK-BB1-TP-R:SONOFF-TP_17:Ch_172" }

This is what I see on the frontend related to the voltage reading:

Screenshot 2020-05-04 at 09.27.40

Has anyone had a chance to experiment with the Tasmota KNX firmware? And what’s wrong in my settings?

Thanks a lot!!

No one can help out? :confused:

If see ETS, DataType of Voltage is 14.027. In other side DataType can be like temperature (9.001).
Try to denote different DataType for Ch_172. For example:

Hi Pavel! First of all thanks for helping, really appreciated!
I’ve changed the datatype of my ga to 14.027 as suggested

Type number: Ch_172 "Voltage" [ ga="14.027:<2/2/0" ]

but still it isn’t picked up. What I see in the log is the following

2020-05-17 18:58:57.893 [TRACE] [nx.internal.client.AbstractKNXClient] - Received a Group Write telegram from ‘1.1.20’ to ‘2/2/0’ with value ‘[0, 0]’
2020-05-17 18:58:57.893 [DEBUG] [calimero.link.224.0.23.12:3671 ] - indication 1.1.20->2/2/0 L_Data.ind, low priority hop count 6, tpdu 00 80 00 00

So something is there, but why doesn’t it trigger the item?

In ETS I’ve added a dummy device and this is what I have

Even if the datatype is 9.020, it isn’t influenced since it’s just a dummy device. Also, I need to add some more context. I have an KNX IP Interface in my KNX network, so no router (even if I have configured my thing to be a ROUTER but only for my Sonoff since it uses multicast. All my other KNX devices do use my TUNNEL config in my thing file.
I might suspect that not having a real KNX Router could be the reason, but what is really odd is that the switch item does trigger my Sonoff correctly and I see that in my log file.

2020-05-17 19:09:50.127 [TRACE] [.internal.handler.DeviceThingHandler] - Handling command ‘ON’ for channel ‘knx:device:EK-BB1-TP-R:SONOFF-TP_17:Ch_171’
2020-05-17 19:09:50.129 [TRACE] [.knx.internal.channel.KNXChannelType] - getCommandSpec testing Keys ‘[ga]’ for command ‘ON’
2020-05-17 19:09:50.132 [TRACE] [.knx.internal.channel.KNXChannelType] - getCommandSpec key ‘ga’ uses expectedTypeClass ‘class org.eclipse.smarthome.core.library.types.OnOffType’ witch isInstance for command ‘ON’ and dpt ‘1.001’
2020-05-17 19:09:50.135 [TRACE] [nx.internal.client.AbstractKNXClient] - writeToKNX groupAddress ‘2/0/0’, commandSpec ‘org.openhab.binding.knx.internal.channel.WriteSpecImpl@1167660’
2020-05-17 19:09:50.137 [TRACE] [nx.internal.client.AbstractKNXClient] - sendToKNX mappedValue: ‘on’ groupAddress: ‘2/0/0’
2020-05-17 19:09:50.141 [DEBUG] [calimero.link.224.0.23.12:3671 ] - send (wait for confirmation) 0.0.0->2/0/0 L_Data.ind, low priority hop count 6, tpdu 00 81
2020-05-17 19:09:50.144 [TRACE] [p.KNXnet/IP Routing 224.0.23.12:3671] - add to multicast loopback frame buffer: 0.0.0->2/0/0 L_Data.ind, low priority hop count 6, tpdu 00 81
2020-05-17 19:09:50.149 [TRACE] [p.KNXnet/IP Routing 224.0.23.12:3671] - sending cEMI frame seq 0, NonBlocking, attempt 1 (channel 0) 06 10 05 30 00 11 29 00 bc e0 00 00 10 00 01 00 81
2020-05-17 19:09:50.152 [TRACE] [p.KNXnet/IP Routing 224.0.23.12:3671] - discard multicast loopback cEMI frame: 0.0.0->2/0/0 L_Data.ind, low priority hop count 6, tpdu 00 81
2020-05-17 19:09:50.152 [TRACE] [calimero.link.224.0.23.12:3671 ] - send 0.0.0->2/0/0 succeeded
2020-05-17 19:09:50.154 [TRACE] [ocess.communication 224.0.23.12:3671] - group write to 2/0/0 succeeded
2020-05-17 19:09:50.157 [DEBUG] [nx.internal.client.AbstractKNXClient] - Wrote value ‘ON’ to datapoint ‘command DP 2/0/0 ‘knx:ip:EK-BB1-TP-R’, DPT id 1.001, low priority’ (0. attempt).
2020-05-17 19:09:50.170 [WARN ] [p.KNXnet/IP Routing 224.0.23.12:3671] - received frame length 0 for KNXnet/IP routing.ind (0x530 v1.0) length 17 - ignored
2020-05-17 19:09:50.172 [TRACE] [nx.internal.client.AbstractKNXClient] - Received a Group Write telegram from ‘1.1.20’ to ‘2/0/1’ with value ‘[1]’
2020-05-17 19:09:50.171 [DEBUG] [calimero.link.224.0.23.12:3671 ] - indication 1.1.20->2/0/1 L_Data.ind, low priority hop count 6, tpdu 00 81

Isn’t it weird?

Try 9.001:

Type number : Ch_172 “Voltage” [ ga=" 9.001:<2/2/0" ]

Don`t use ETS now - you see nothing, because you have not real KNX Router to connect.
You must have two KNX bridges in things. One of it for virtual Router, the second - for you KNX system with Tunnel.
But on this step - lets forget about “real” KNX system. First of all we need to get value from Sonoff

Hi Pavel,
I tried with the 9.001 DTP, but still no chance… this is what I receive in the log file:

==> /var/log/openhab2/openhab.log <==
2020-05-19 08:48:44.856 [DEBUG] [calimero.link.224.0.23.12:3671 ] - indication 1.1.20->2/2/0 L_Data.ind, low priority hop count 6, tpdu 00 80 00 00
2020-05-19 08:48:44.856 [TRACE] [nx.internal.client.AbstractKNXClient] - Received a Group Write telegram from ‘1.1.20’ to ‘2/2/0’ with value ‘[0, 0]’
2020-05-19 08:48:44.858 [DEBUG] [calimero.link.224.0.23.12:3671 ] - indication 1.1.20->2/2/1 L_Data.ind, low priority hop count 6, tpdu 00 80 00 00
2020-05-19 08:48:44.859 [TRACE] [nx.internal.client.AbstractKNXClient] - Received a Group Write telegram from ‘1.1.20’ to ‘2/2/1’ with value ‘[0, 0]’

This is very different from when I switch my Sonoff ON or OFF over PaperUI:

==> /var/log/openhab2/openhab.log <==
2020-05-19 08:48:25.737 [TRACE] [.internal.handler.DeviceThingHandler] - Handling command ‘OFF’ for channel ‘knx:device:EK-BB1-TP-R:SONOFF-TP_17:Ch_171’
2020-05-19 08:48:25.739 [TRACE] [.knx.internal.channel.KNXChannelType] - getCommandSpec testing Keys ‘[ga]’ for command ‘OFF’
2020-05-19 08:48:25.742 [TRACE] [.knx.internal.channel.KNXChannelType] - getCommandSpec key ‘ga’ uses expectedTypeClass ‘class org.eclipse.smarthome.core.library.types.OnOffType’ witch isInstance for command ‘OFF’ and dpt ‘1.001’
2020-05-19 08:48:25.744 [TRACE] [nx.internal.client.AbstractKNXClient] - writeToKNX groupAddress ‘2/0/0’, commandSpec ‘org.openhab.binding.knx.internal.channel.WriteSpecImpl@c9b004’
2020-05-19 08:48:25.747 [TRACE] [nx.internal.client.AbstractKNXClient] - sendToKNX mappedValue: ‘off’ groupAddress: ‘2/0/0’
2020-05-19 08:48:25.749 [DEBUG] [calimero.link.224.0.23.12:3671 ] - send (wait for confirmation) 0.0.0->2/0/0 L_Data.ind, low priority hop count 6, tpdu 00 80
2020-05-19 08:48:25.751 [TRACE] [p.KNXnet/IP Routing 224.0.23.12:3671] - add to multicast loopback frame buffer: 0.0.0->2/0/0 L_Data.ind, low priority hop count 6, tpdu 00 80
2020-05-19 08:48:25.753 [TRACE] [p.KNXnet/IP Routing 224.0.23.12:3671] - sending cEMI frame seq 0, NonBlocking, attempt 1 (channel 0) 06 10 05 30 00 11 29 00 bc e0 00 00 10 00 01 00 80
2020-05-19 08:48:25.756 [TRACE] [p.KNXnet/IP Routing 224.0.23.12:3671] - discard multicast loopback cEMI frame: 0.0.0->2/0/0 L_Data.ind, low priority hop count 6, tpdu 00 80
2020-05-19 08:48:25.756 [TRACE] [calimero.link.224.0.23.12:3671 ] - send 0.0.0->2/0/0 succeeded
2020-05-19 08:48:25.760 [TRACE] [ocess.communication 224.0.23.12:3671] - group write to 2/0/0 succeeded
2020-05-19 08:48:25.762 [DEBUG] [nx.internal.client.AbstractKNXClient] - Wrote value ‘OFF’ to datapoint ‘command DP 2/0/0 ‘knx:ip:EK-BB1-TP-R’, DPT id 1.001, low priority’ (0. attempt).
2020-05-19 08:48:25.768 [WARN ] [p.KNXnet/IP Routing 224.0.23.12:3671] - received frame length 0 for KNXnet/IP routing.ind (0x530 v1.0) length 17 - ignored
2020-05-19 08:48:25.770 [DEBUG] [calimero.link.224.0.23.12:3671 ] - indication 1.1.20->2/0/1 L_Data.ind, low priority hop count 6, tpdu 00 80
2020-05-19 08:48:25.770 [TRACE] [nx.internal.client.AbstractKNXClient] - Received a Group Write telegram from ‘1.1.20’ to ‘2/0/1’ with value ‘[0]’

I really don’t understand what could be different. At that point, could it be a bug in the Tasmota firmware?

Thanks!

First of all will check connectivity between Sonoff and OH. Can you see reaction in OH when you switch toggle Sonoff? And can you see switching Sonoff when you controlling from OH?

Yes, there is. I can switch on and off a bulb connected to the Sonoff directly from the PaperUI interface.