[viessmann] Fix parsing of unit Seconds (#20411)

Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
This commit is contained in:
Ronny Grun
2026-03-21 12:08:13 +01:00
committed by GitHub
parent 436bbdc3ba
commit b3183e8248
3 changed files with 16 additions and 2 deletions
@@ -76,6 +76,7 @@ public class ViessmannBindingConstants {
entry("power-kilowattHour", Units.KILOWATT_HOUR.toString()), //
entry("heat-kilowattHour", Units.KILOWATT_HOUR.toString()), //
entry("percent", Units.PERCENT.toString()), //
entry("seconds", Units.SECOND.toString()), //
entry("minute", Units.MINUTE.toString()), //
entry("hour", Units.HOUR.toString()), //
entry("hours", Units.HOUR.toString()), //
@@ -1497,8 +1497,10 @@ public class DeviceHandler extends ViessmannThingHandler {
if (channelType.isBlank() || "object".equals(channelType)) {
channelType = "string";
}
if ("meter".equals(msg.getUnit()) || "degree".equals(msg.getUnit())) {
channelType = msg.getUnit();
String unit = msg.getUnit();
if ("meter".equals(unit) || "degree".equals(unit) || "seconds".equals(unit)) {
channelType = unit;
}
List<String> com = msg.getAllCommands();
@@ -453,6 +453,17 @@
<state pattern="%d %unit%" readOnly="true"/>
</channel-type>
<channel-type id="seconds">
<item-type>Number:Time</item-type>
<label>Seconds</label>
<category>Time</category>
<tags>
<tag>Status</tag>
<tag>Duration</tag>
</tags>
<state pattern="%d %unit%" readOnly="true"/>
</channel-type>
<channel-type id="percent">
<item-type>Number:Dimensionless</item-type>
<label>Percentage</label>