Repository: XKNX/xknx

Issue:
Add more information to Sensor and BinarySensor
It would be nice to have some more information in a Sensor or BinarySensor device. I could imagine good use of 
- source: the source IA of the latest received telegram
- updated_at: a timestamp when the last telegram for the Device was received

To accomplish this I'd propose to store the latest processed `Telegram()` in a RemoteValue instead of the `RemoteValue.payload` attribute. The payload can still be stored as decoded value or just as property returning `RemoteValue.telegram.from_knx()` (or last_telegram or whatever...).
 I'd also like to add a timestamp to the Telegram object to track its reception time.

We would also need to add `src_address` to Telegram() and fill it from cemi_frame.py and RemoteValue._send() to use it later eg. in a `HA.Entity.state_attributes` property.

-----
What do you think?

Discussion:
coveralls: 
[![Coverage Status](https://coveralls.io/builds/38517076/badge)](https://coveralls.io/builds/38517076)

Coverage decreased (-0.01%) to 94.709% when pulling **7e2014edc21621503c25220e9c3da58971edf9e5 on marvin-w:feature/add_more_information_to_sensors** into **a49f809d65448621b9f4369768eb1853f300cd9e on XKNX:main**.


Patch:
diff --git a/changelog.md b/changelog.md
index 1abf723f..c6b058f7 100644
--- a/changelog.md
+++ b/changelog.md
@@ -3,6 +3,12 @@
 ## Unreleased changes
 
 - Add support for cover lock
+- Add more information to sensors and binary sensors in the HA integration
+- Store last Telegram and decoded value in RemoteValue
+
+### Breaking Changes
+
+- Remove configuration handling from core library (use https://xknx.io/config-converter)
 - Drop support for python 3.7
 
 ### Internals
diff --git a/docs/binary_sensor.md b/docs/binary_sensor.md
index 7cdcaca2..1d378ed9 100644
--- a/docs/binary_sensor.md
+++ b/docs/binary_sensor.md
@@ -33,19 +33,8 @@ binarysensor = BinarySensor(xknx, 'TestInput', group_address_state='1/2/3', devi
 ## [](#header-2)Example
 
 ```python
-outlet = Switch(xknx, 'TestOutlet', group_address='1/2/3')
-
 binarysensor = BinarySensor(xknx, 'TestInput', group_address_state='2/3/4')
-action_on = Action(
-    xknx,
-    hook='on',
-    target='TestOutlet',
-    method='on')
-binarysensor.actions.append(action_on)
-action_off = Action(
-    xknx,
-    hook='off',
-    target='TestOutlet',
-    method='off')
-binarysensor.actions.append(action_off)
+
+# Returns the last received Telegram or None
+binarysensor.last_telegram
 ```
diff --git a/docs/sensor.md b/docs/sensor.md
index 88117816..65648bdc 100644
--- a/docs/sensor.md
+++ b/docs/sensor.md
@@ -41,6 +41,9 @@ sensor.resolve_state()
 
 # Returns the unit of the value as string
 sensor.unit_of_measurement()
+
+# Returns the last received telegram or None
+sensor.last_telegram
 ```
 
 
diff --git a/examples/example_config.py b/examples/example_config.py
deleted file mode 100644
index 7e3a12c5..00000000
--- a/examples/example_config.py
+++ /dev/null
@@ -1,15 +0,0 @@
-"""Example for config file parser."""
-import asyncio
-
-from xknx import XKNX
-
-
-async def main():
-    """Read xknx.yaml, walk through all devices and print them."""
-    xknx = XKNX()
-
-    for device in xknx.devices:
-        print(device)
-
-
-asyncio.run(main())
diff --git a/home-assistant-plugin/custom_components/xknx/binary_sensor.py b/home-assistant-plugin/custom_components/xknx/binary_sensor.py
index 0faeb9f3..0fbf1eb1 100644
--- a/home-assistant-plugin/custom_components/xknx/binary_sensor.py
+++ b/home-assistant-plugin/custom_components/xknx/binary_sensor.py
@@ -10,7 +10,7 @@ from homeassistant.core import HomeAssistant
 from homeassistant.helpers.entity import Entity
 from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
 
-from .const import ATTR_COUNTER, DOMAIN
+from .const import ATTR_COUNTER, ATTR_LAST_KNX_UPDATE, ATTR_SOURCE, DOMAIN
 from .knx_entity import KnxEntity
 
 
@@ -51,9 +51,14 @@ class KNXBinarySensor(KnxEntity, BinarySensorEntity):
     @property
     def extra_state_attributes(self) -> dict[str, Any] | None:
         """Return device specific state attributes."""
+        attr = {}
+
         if self._device.counter is not None:
-            return {ATTR_COUNTER: self._device.counter}
-        return None
+            attr[ATTR_COUNTER] = self._device.counter
+        if self._device.last_telegram is not None:
+            attr[ATTR_SOURCE] = str(self._device.last_telegram.source_address)
+            attr[ATTR_LAST_KNX_UPDATE] = str(self._device.last_telegram.timestamp)
+        return attr
 
     @property
     def force_update(self) -> bool:
diff --git a/home-assistant-plugin/custom_components/xknx/const.py b/home-assistant-plugin/custom_components/xknx/const.py
index f4df78f7..902feb0f 100644
--- a/home-assistant-plugin/custom_components/xknx/const.py
+++ b/home-assistant-plugin/custom_components/xknx/const.py
@@ -26,6 +26,8 @@ CONF_SYNC_STATE = "sync_state"
 CONF_RESET_AFTER = "reset_after"
 
 ATTR_COUNTER = "counter"
+ATTR_SOURCE = "source"
+ATTR_LAST_KNX_UPDATE = "last_knx_update"
 ATTR_MOVEMENT_LOCKED = "movement_locked"
 
 
diff --git a/home-assistant-plugin/custom_components/xknx/sensor.py b/home-assistant-plugin/custom_components/xknx/sensor.py
index f14cf7e5..3b109723 100644
--- a/home-assistant-plugin/custom_components/xknx/sensor.py
+++ b/home-assistant-plugin/custom_components/xknx/sensor.py
@@ -1,7 +1,7 @@
 """Support for KNX/IP sensors."""
 from __future__ import annotations
 
-from typing import Callable, Iterable
+from typing import Any, Callable, Iterable
 
 from xknx.devices import Sensor as XknxSensor
 
@@ -10,7 +10,7 @@ from homeassistant.core import HomeAssistant
 from homeassistant.helpers.entity import Entity
 from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType, StateType
 
-from .const import DOMAIN
+from .const import ATTR_LAST_KNX_UPDATE, ATTR_SOURCE, DOMAIN
 from .knx_entity import KnxEntity
 
 
@@ -54,6 +54,16 @@ class KNXSensor(KnxEntity, SensorEntity):
             return device_class
         return None
 
+    @property
+    def extra_state_attributes(self) -> dict[str, Any] | None:
+        """Return device specific state attributes."""
+        attr = {}
+
+        if self._device.last_telegram is not None:
+            attr[ATTR_SOURCE] = str(self._device.last_telegram.source_address)
+            attr[ATTR_LAST_KNX_UPDATE] = str(self._device.last_telegram.timestamp)
+        return attr
+
     @property
     def force_update(self) -> bool:
         """
diff --git a/xknx/devices/binary_sensor.py b/xknx/devices/binary_sensor.py
index 0be49d5f..3f3ed1b7 100644
--- a/xknx/devices/binary_sensor.py
+++ b/xknx/devices/binary_sensor.py
@@ -75,6 +75,11 @@ class BinarySensor(Device):
         """Return unique id for this device."""
         return f"{self.remote_value.group_address_state}"
 
+    @property
+    def last_telegram(self) -> Telegram | None:
+        """Return the last telegram received from the RemoteValue."""
+        return self.remote_value.telegram
+
     def __del__(self) -> None:
         """Destructor. Cleaning up if this was not done before."""
         try:
diff --git a/xknx/devices/sensor.py b/xknx/devices/sensor.py
index fbe309ef..1da02138 100644
--- a/xknx/devices/sensor.py
+++ b/xknx/devices/sensor.py
@@ -77,6 +77,11 @@ class Sensor(Device):
         """Return unique id for this device."""
         return f"{self.sensor_value.group_address_state}"
 
+    @property
+    def last_telegram(self) -> Telegram | None:
+        """Return the last telegram received from the RemoteValue."""
+        return self.sensor_value.telegram
+
     async def process_group_write(self, telegram: "Telegram") -> None:
         """Process incoming and outgoing GROUP WRITE telegram."""
         await self.sensor_value.process(telegram, always_callback=self.always_callback)
diff --git a/xknx/remote_value/remote_value.py b/xknx/remote_value/remote_value.py
index 60de9455..ec522798 100644
--- a/xknx/remote_value/remote_value.py
+++ b/xknx/remote_value/remote_value.py
@@ -72,8 +72,9 @@ class RemoteValue(ABC, Generic[DPTPayloadType, ValueType]):
 
         self.device_name: str = "Unknown" if device_name is None else device_name
         self.feature_name: str = "Unknown" if feature_name is None else feature_name
+        self.value: ValueType | None = None
+        self.telegram: Telegram | None = None
         self.after_update_cb: AsyncCallbackType | None = after_update_cb
-        self.payload: DPTPayloadType | None = None
 
         if sync_state and self.group_address_state:
             self.xknx.state_updater.register_remote_value(
@@ -165,21 +166,18 @@ class RemoteValue(ABC, Generic[DPTPayloadType, ValueType]):
                 device_name=self.device_name,
                 feature_name=self.feature_name,
             )
+        decoded_payload = self.from_knx(_new_payload)
         self.xknx.state_updater.update_received(self)
-        if self.payload is None or always_callback or self.payload != _new_payload:
-            self.payload = _new_payload
+        if self.value is None or always_callback or self.value != decoded_payload:
+            self.value = decoded_payload
+            self.telegram = telegram
             if self.after_update_cb is not None:
                 await self.after_update_cb()
         return True
 
-    @property
-    def value(self) -> ValueType | None:
-        """Return current value."""
-        if self.payload is None:
-            return None
-        return self.from_knx(self.payload)
-
-    async def _send(self, payload: DPTPayloadType, response: bool = False) -> None:
+    async def _send(
+        self, payload: DPTArray | DPTBinary, response: bool = False
+    ) -> None:
         """Send payload as telegram to KNX bus."""
         if self.group_address is not None:
             telegram = Telegram(
@@ -217,8 +215,9 @@ class RemoteValue(ABC, Generic[DPTPayloadType, ValueType]):
 
     async def respond(self) -> None:
         """Send current payload as GroupValueResponse telegram to KNX bus."""
-        if self.payload is not None:
-            await self._send(self.payload, response=True)
+        payload = self._payload()
+        if payload is not None:
+            await self._send(payload, response=True)
 
     async def read_state(self, wait_for_result: bool = False) -> None:
         """Send GroupValueRead telegram for state address to KNX bus."""
@@ -243,6 +242,14 @@ class RemoteValue(ABC, Generic[DPTPayloadType, ValueType]):
             else:
                 await value_reader.send_group_read()
 
+    def _payload(self) -> DPTArray | DPTBinary | None:
+        """Obtain payload from Telegram."""
+        if self.telegram is not None and isinstance(
+            self.telegram.payload, (GroupValueWrite, GroupValueResponse)
+        ):
+            return self.telegram.payload.value
+        return None
+
     @property
     def unit_of_measurement(self) -> str | None:
         """Return the unit of measurement."""
@@ -253,8 +260,8 @@ class RemoteValue(ABC, Generic[DPTPayloadType, ValueType]):
         return "{}/{}/{}/{}".format(
             self.group_address.__repr__(),
             self.group_address_state.__repr__(),
-            self.payload,
             self.value,
+            self._payload(),
         )
 
     def __str__(self) -> str:
diff --git a/xknx/telegram/telegram.py b/xknx/telegram/telegram.py
index bcdb706e..47709f82 100644
--- a/xknx/telegram/telegram.py
+++ b/xknx/telegram/telegram.py
@@ -15,6 +15,7 @@ It contains
 """
 from __future__ import annotations
 
+from datetime import datetime
 from enum import Enum
 
 from .address import GroupAddress, IndividualAddress
@@ -43,6 +44,7 @@ class Telegram:
         self.direction = direction
         self.payload = payload
         self.source_address = source_address
+        self.timestamp = datetime.now()
 
     def __str__(self) -> str:
         """Return object as readable string."""
@@ -58,7 +60,17 @@ class Telegram:
 
     def __eq__(self, other: object) -> bool:
         """Equal operator."""
-        return bool(self.__dict__ == other.__dict__)
+        for key, value in self.__dict__.items():
+            if key == "timestamp":
+                continue
+            if key not in other.__dict__:
+                return False
+            if other.__dict__[key] != value:
+                return False
+        for key, value in other.__dict__.items():
+            if key not in self.__dict__:
+                return False
+        return True
 
     def __hash__(self) -> int:
         """Hash function."""


Test patch:
diff --git a/test/devices_tests/binary_sensor_test.py b/test/devices_tests/binary_sensor_test.py
index 34f1577a..ac1cc4ed 100644
--- a/test/devices_tests/binary_sensor_test.py
+++ b/test/devices_tests/binary_sensor_test.py
@@ -47,6 +47,7 @@ class TestBinarySensor:
             payload=GroupValueWrite(DPTBinary(0)),
         )
         await binaryinput2.process(telegram_off2)
+        assert binaryinput2.last_telegram == telegram_off2
         assert binaryinput2.state is False
 
     async def test_process_invert(self):
diff --git a/test/devices_tests/expose_sensor_test.py b/test/devices_tests/expose_sensor_test.py
index e8a6deed..6640dc58 100644
--- a/test/devices_tests/expose_sensor_test.py
+++ b/test/devices_tests/expose_sensor_test.py
@@ -16,35 +16,52 @@ class TestExposeSensor:
     #
     # STR FUNCTIONS
     #
-    def test_str_binary(self):
+    async def test_str_binary(self):
         """Test resolve state with binary sensor."""
         xknx = XKNX()
         expose_sensor = ExposeSensor(
             xknx, "TestSensor", group_address="1/2/3", value_type="binary"
         )
-        expose_sensor.sensor_value.payload = DPTBinary(1)
+        await expose_sensor.process(
+            Telegram(
+                destination_address=GroupAddress("1/2/3"),
+                payload=GroupValueWrite(value=DPTBinary(1)),
+            )
+        )
 
         assert expose_sensor.resolve_state() is True
         assert expose_sensor.unit_of_measurement() is None
 
-    def test_str_percent(self):
+    async def test_str_percent(self):
         """Test resolve state with percent sensor."""
         xknx = XKNX()
         expose_sensor = ExposeSensor(
             xknx, "TestSensor", group_address="1/2/3", value_type="percent"
         )
-        expose_sensor.sensor_value.payload = DPTArray((0x40,))
+
+        await expose_sensor.process(
+            Telegram(
+                destination_address=GroupAddress("1/2/3"),
+                payload=GroupValueWrite(DPTArray((0x40,))),
+            )
+        )
 
         assert expose_sensor.resolve_state() == 25
         assert expose_sensor.unit_of_measurement() == "%"
 
-    def test_str_temperature(self):
+    async def test_str_temperature(self):
         """Test resolve state with temperature sensor."""
         xknx = XKNX()
         expose_sensor = ExposeSensor(
             xknx, "TestSensor", group_address="1/2/3", value_type="temperature"
         )
-        expose_sensor.sensor_value.payload = DPTArray((0x0C, 0x1A))
+
+        await expose_sensor.process(
+            Telegram(
+                destination_address=GroupAddress("1/2/3"),
+                payload=GroupValueWrite(DPTArray((0x0C, 0x1A))),
+            )
+        )
 
         assert expose_sensor.resolve_state() == 21.0
         assert expose_sensor.unit_of_measurement() == "°C"
@@ -104,7 +121,13 @@ class TestExposeSensor:
         expose_sensor = ExposeSensor(
             xknx, "TestSensor", value_type="binary", group_address="1/2/3"
         )
-        expose_sensor.sensor_value.payload = DPTBinary(1)
+
+        await expose_sensor.process(
+            Telegram(
+                destination_address=GroupAddress("1/2/3"),
+                payload=GroupValueWrite(DPTBinary(True)),
+            )
+        )
 
         telegram = Telegram(GroupAddress("1/2/3"), payload=GroupValueRead())
         await expose_sensor.process(telegram)
@@ -121,7 +144,13 @@ class TestExposeSensor:
         expose_sensor = ExposeSensor(
             xknx, "TestSensor", value_type="percent", group_address="1/2/3"
         )
-        expose_sensor.sensor_value.payload = DPTArray((0x40,))
+
+        await expose_sensor.process(
+            Telegram(
+                destination_address=GroupAddress("1/2/3"),
+                payload=GroupValueWrite(DPTArray((0x40,))),
+            )
+        )
 
         telegram = Telegram(GroupAddress("1/2/3"), payload=GroupValueRead())
         await expose_sensor.process(telegram)
@@ -138,7 +167,13 @@ class TestExposeSensor:
         expose_sensor = ExposeSensor(
             xknx, "TestSensor", value_type="temperature", group_address="1/2/3"
         )
-        expose_sensor.sensor_value.payload = DPTArray((0x0C, 0x1A))
+
+        await expose_sensor.process(
+            Telegram(
+                destination_address=GroupAddress("1/2/3"),
+                payload=GroupValueWrite(DPTArray((0x0C, 0x1A))),
+            )
+        )
 
         telegram = Telegram(GroupAddress("1/2/3"), payload=GroupValueRead())
         await expose_sensor.process(telegram)
diff --git a/test/devices_tests/sensor_test.py b/test/devices_tests/sensor_test.py
index 8f745f8b..fc58954e 100644
--- a/test/devices_tests/sensor_test.py
+++ b/test/devices_tests/sensor_test.py
@@ -13,23 +13,683 @@ from xknx.telegram.apci import GroupValueRead, GroupValueResponse, GroupValueWri
 class TestSensor:
     """Test class for Sensor objects."""
 
-    #
-    # STR FUNCTIONS
-    #
-    def test_str_absolute_temperature(self):
-        """Test resolve state with absolute_temperature sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="absolute_temperature",
-        )
-        sensor.sensor_value.payload = DPTArray((0x44, 0xD7, 0xD2, 0x8B))
-
-        assert sensor.resolve_state() == 1726.5794677734375
-        assert sensor.unit_of_measurement() == "K"
-        assert sensor.ha_device_class() is None
+    @pytest.mark.parametrize(
+        "value_type,raw_payload,expected_state",
+        [
+            (
+                "absolute_temperature",
+                DPTArray((0x44, 0xD7, 0xD2, 0x8B)),
+                1726.5794677734375,
+            ),
+            (
+                "acceleration",
+                DPTArray((0x45, 0x94, 0xD8, 0x5D)),
+                4763.04541015625,
+            ),
+            (
+                "volume_liquid_litre",
+                DPTArray((0x00, 0x00, 0x01, 0x00)),
+                256,
+            ),
+            (
+                "volume_m3",
+                DPTArray((0x00, 0x00, 0x01, 0x00)),
+                256,
+            ),
+            (
+                "active_energy",
+                DPTArray((0x26, 0x37, 0x49, 0x7F)),
+                641157503,
+            ),
+            (
+                "active_energy_kwh",
+                DPTArray((0x37, 0x5, 0x5, 0xEA)),
+                923076074,
+            ),
+            (
+                "activity",
+                DPTArray((0x45, 0x76, 0x0, 0xA3)),
+                3936.039794921875,
+            ),
+            (
+                "amplitude",
+                DPTArray((0x45, 0x9A, 0xED, 0x8)),
+                4957.62890625,
+            ),
+            (
+                "angle",
+                DPTArray((0xE4,)),
+                322,
+            ),
+            (
+                "angle_deg",
+                DPTArray((0x44, 0x5C, 0x20, 0x2B)),
+                880.5026245117188,
+            ),
+            (
+                "angle_rad",
+                DPTArray((0x44, 0x36, 0x75, 0x1)),
+                729.8281860351562,
+            ),
+            (
+                "angular_frequency",
+                DPTArray((0x43, 0xBC, 0x20, 0x8D)),
+                376.2543029785156,
+            ),
+            (
+                "angular_momentum",
+                DPTArray((0xC2, 0x75, 0xB7, 0xB5)),
+                -61.42940139770508,
+            ),
+            (
+                "angular_velocity",
+                DPTArray((0xC4, 0xD9, 0x10, 0xB3)),
+                -1736.5218505859375,
+            ),
+            (
+                "apparant_energy",
+                DPTArray((0xD3, 0xBD, 0x1E, 0xA5)),
+                -742580571,
+            ),
+            (
+                "apparant_energy_kvah",
+                DPTArray((0x49, 0x40, 0xC9, 0x9)),
+                1228982537,
+            ),
+            (
+                "area",
+                DPTArray((0x45, 0x63, 0x1E, 0xCD)),
+                3633.925048828125,
+            ),
+            (
+                "brightness",
+                DPTArray((0xC3, 0x56)),
+                50006,
+            ),
+            (
+                "capacitance",
+                DPTArray((0x45, 0xC9, 0x1D, 0x9D)),
+                6435.70166015625,
+            ),
+            (
+                "charge_density_surface",
+                DPTArray((0x45, 0xDB, 0x66, 0x99)),
+                7020.82470703125,
+            ),
+            (
+                "charge_density_volume",
+                DPTArray((0xC4, 0x8C, 0x33, 0xD7)),
+                -1121.6199951171875,
+            ),
+            (
+                "color_temperature",
+                DPTArray((0x6C, 0x95)),
+                27797,
+            ),
+            (
+                "common_temperature",
+                DPTArray((0x45, 0xD9, 0xC6, 0x3F)),
+                6968.78076171875,
+            ),
+            (
+                "compressibility",
+                DPTArray((0x45, 0x89, 0x94, 0xAB)),
+                4402.58349609375,
+            ),
+            (
+                "conductance",
+                DPTArray((0x45, 0xA6, 0x28, 0xF9)),
+                5317.12158203125,
+            ),
+            (
+                "counter_pulses",
+                DPTArray((0x9D,)),
+                -99,
+            ),
+            (
+                "current",
+                DPTArray((0xCA, 0xCC)),
+                51916,
+            ),
+            (
+                "delta_time_hrs",
+                DPTArray((0x47, 0x80)),
+                18304,
+            ),
+            (
+                "delta_time_min",
+                DPTArray((0xB9, 0x7B)),
+                -18053,
+            ),
+            (
+                "delta_time_ms",
+                DPTArray((0x58, 0x77)),
+                22647,
+            ),
+            (
+                "delta_time_sec",
+                DPTArray((0xA3, 0x6A)),
+                -23702,
+            ),
+            (
+                "density",
+                DPTArray((0x44, 0xA5, 0xCB, 0x27)),
+                1326.3485107421875,
+            ),
+            (
+                "electrical_conductivity",
+                DPTArray((0xC4, 0xC6, 0xF5, 0x6E)),
+                -1591.669677734375,
+            ),
+            (
+                "electric_charge",
+                DPTArray((0x46, 0x14, 0xF6, 0xA0)),
+                9533.65625,
+            ),
+            (
+                "electric_current",
+                DPTArray((0x45, 0xAD, 0x45, 0x90)),
+                5544.6953125,
+            ),
+            (
+                "electric_current_density",
+                DPTArray((0x45, 0x7C, 0x57, 0xF6)),
+                4037.49755859375,
+            ),
+            (
+                "electric_dipole_moment",
+                DPTArray((0x45, 0x58, 0xF1, 0x73)),
+                3471.090576171875,
+            ),
+            (
+                "electric_displacement",
+                DPTArray((0xC5, 0x34, 0x8B, 0x0)),
+                -2888.6875,
+            ),
+            (
+                "electric_field_strength",
+                DPTArray((0xC6, 0x17, 0x1C, 0x39)),
+                -9671.0556640625,
+            ),
+            (
+                "electric_flux",
+                DPTArray((0x45, 0x8F, 0x6C, 0xFD)),
+                4589.62353515625,
+            ),
+            (
+                "electric_flux_density",
+                DPTArray((0xC6, 0x0, 0x50, 0xA8)),
+                -8212.1640625,
+            ),
+            (
+                "electric_polarization",
+                DPTArray((0x45, 0xF8, 0x89, 0xC6)),
+                7953.2216796875,
+            ),
+            (
+                "electric_potential",
+                DPTArray((0xC6, 0x18, 0xA4, 0xAF)),
+                -9769.1708984375,
+            ),
+            (
+                "electric_potential_difference",
+                DPTArray((0xC6, 0xF, 0x1D, 0x6)),
+                -9159.255859375,
+            ),
+            (
+                "electromagnetic_moment",
+                DPTArray((0x45, 0x82, 0x48, 0xAE)),
+                4169.0849609375,
+            ),
+            (
+                "electromotive_force",
+                DPTArray((0x45, 0xBC, 0xEF, 0xEB)),
+                6045.98974609375,
+            ),
+            (
+                "energy",
+                DPTArray((0x45, 0x4B, 0xB3, 0xF8)),
+                3259.248046875,
+            ),
+            (
+                "enthalpy",
+                DPTArray((0x76, 0xDD)),
+                287866.88,
+            ),
+            (
+                "flow_rate_m3h",
+                DPTArray((0x99, 0xEA, 0xC0, 0x55)),
+                -1712668587,
+            ),
+            (
+                "force",
+                DPTArray((0x45, 0x9E, 0x2C, 0xE1)),
+                5061.60986328125,
+            ),
+            (
+                "frequency",
+                DPTArray((0x45, 0xC2, 0x3C, 0x44)),
+                6215.533203125,
+            ),
+            (
+                "heatcapacity",
+                DPTArray((0xC5, 0xB3, 0x56, 0x7E)),
+                -5738.8115234375,
+            ),
+            (
+                "heatflowrate",
+                DPTArray((0x44, 0xEC, 0x80, 0x7A)),
+                1892.014892578125,
+            ),
+            (
+                "heat_quantity",
+                DPTArray((0xC5, 0xA6, 0xB6, 0xD5)),
+                -5334.85400390625,
+            ),
+            (
+                "humidity",
+                DPTArray((0x7E, 0xE1)),
+                577044.48,
+            ),
+            (
+                "impedance",
+                DPTArray((0x45, 0xDD, 0x79, 0x6D)),
+                7087.17822265625,
+            ),
+            (
+                "illuminance",
+                DPTArray((0x7C, 0x5E)),
+                366346.24,
+            ),
+            (
+                "kelvin_per_percent",
+                DPTArray((0xFA, 0xBD)),
+                -441384.96,
+            ),
+            (
+                "length",
+                DPTArray((0xC5, 0x9D, 0xAE, 0xC5)),
+                -5045.84619140625,
+            ),
+            (
+                "length_mm",
+                DPTArray((0x56, 0xB9)),
+                22201,
+            ),
+            (
+                "light_quantity",
+                DPTArray((0x45, 0x4A, 0xF5, 0x68)),
+                3247.337890625,
+            ),
+            (
+                "long_delta_timesec",
+                DPTArray((0x45, 0xB2, 0x17, 0x54)),
+                1169299284,
+            ),
+            (
+                "luminance",
+                DPTArray((0x45, 0x18, 0xD9, 0x76)),
+                2445.59130859375,
+            ),
+            (
+                "luminous_flux",
+                DPTArray((0x45, 0xBD, 0x16, 0x9)),
+                6050.75439453125,
+            ),
+            (
+                "luminous_intensity",
+                DPTArray((0x46, 0xB, 0xBE, 0x7E)),
+                8943.623046875,
+            ),
+            (
+                "magnetic_field_strength",
+                DPTArray((0x44, 0x15, 0xF1, 0xAD)),
+                599.7761840820312,
+            ),
+            (
+                "magnetic_flux",
+                DPTArray((0xC5, 0xCB, 0x3C, 0x98)),
+                -6503.57421875,
+            ),
+            (
+                "magnetic_flux_density",
+                DPTArray((0x45, 0xB6, 0xBD, 0x42)),
+                5847.6572265625,
+            ),
+            (
+                "magnetic_moment",
+                DPTArray((0xC3, 0x8E, 0x7F, 0x73)),
+                -284.9956970214844,
+            ),
+            (
+                "magnetic_polarization",
+                DPTArray((0x45, 0x8C, 0xFA, 0xCB)),
+                4511.34912109375,
+            ),
+            (
+                "magnetization",
+                DPTArray((0x45, 0xF7, 0x9D, 0xA2)),
+                7923.7041015625,
+            ),
+            (
+                "magnetomotive_force",
+                DPTArray((0xC6, 0x4, 0xC2, 0xDA)),
+                -8496.712890625,
+            ),
+            (
+                "mass",
+                DPTArray((0x45, 0x8F, 0x70, 0xA4)),
+                4590.080078125,
+            ),
+            (
+                "mass_flux",
+                DPTArray((0xC6, 0x7, 0x34, 0xFF)),
+                -8653.2490234375,
+            ),
+            (
+                "mol",
+                DPTArray((0xC4, 0xA0, 0xF4, 0x68)),
+                -1287.6376953125,
+            ),
+            (
+                "momentum",
+                DPTArray((0xC5, 0x27, 0xAA, 0x5B)),
+                -2682.647216796875,
+            ),
+            (
+                "percent",
+                DPTArray((0xE3,)),
+                89,
+            ),
+            (
+                "percentU8",
+                DPTArray((0x6B,)),
+                107,
+            ),
+            (
+                "percentV8",
+                DPTArray((0x20,)),
+                32,
+            ),
+            (
+                "percentV16",
+                DPTArray((0x8A, 0x2F)),
+                -30161,
+            ),
+            (
+                "phaseanglerad",
+                DPTArray((0x45, 0x54, 0xAC, 0x2E)),
+                3402.76123046875,
+            ),
+            (
+                "phaseangledeg",
+                DPTArray((0xC5, 0x25, 0x13, 0x38)),
+                -2641.201171875,
+            ),
+            (
+                "power",
+                DPTArray((0x45, 0xCB, 0xE2, 0x5C)),
+                6524.294921875,
+            ),
+            (
+                "power_2byte",
+                DPTArray((0x6D, 0x91)),
+                116736.0,
+            ),
+            (
+                "power_density",
+                DPTArray((0x65, 0x3E)),
+                54968.32,
+            ),
+            (
+                "powerfactor",
+                DPTArray((0xC5, 0x35, 0x28, 0x21)),
+                -2898.508056640625,
+            ),
+            (
+                "ppm",
+                DPTArray((0x7F, 0x74)),
+                625213.44,
+            ),
+            (
+                "pressure",
+                DPTArray((0xC5, 0xE6, 0xE6, 0x63)),
+                -7388.79833984375,
+            ),
+            (
+                "pressure_2byte",
+                DPTArray((0x7C, 0xF4)),
+                415498.24,
+            ),
+            (
+                "pulse",
+                DPTArray((0xFC,)),
+                252,
+            ),
+            (
+                "rain_amount",
+                DPTArray((0xE0, 0xD0)),
+                -75366.4,
+            ),
+            (
+                "reactance",
+                DPTArray((0x45, 0xB0, 0x50, 0x91)),
+                5642.07080078125,
+            ),
+            (
+                "reactive_energy",
+                DPTArray((0x1A, 0x49, 0x6D, 0xA7)),
+                441019815,
+            ),
+            (
+                "reactive_energy_kvarh",
+                DPTArray((0xCC, 0x62, 0x5, 0x31)),
+                -865991375,
+            ),
+            (
+                "resistance",
+                DPTArray((0xC5, 0xFC, 0x5F, 0xC2)),
+                -8075.9697265625,
+            ),
+            (
+                "resistivity",
+                DPTArray((0xC5, 0x57, 0x76, 0xC3)),
+                -3447.422607421875,
+            ),
+            (
+                "rotation_angle",
+                DPTArray((0x2D, 0xDC)),
+                11740,
+            ),
+            (
+                "scene_number",
+                DPTArray((0x1,)),
+                2,
+            ),
+            (
+                "self_inductance",
+                DPTArray((0xC4, 0xA1, 0xB0, 0x6)),
+                -1293.500732421875,
+            ),
+            (
+                "solid_angle",
+                DPTArray((0xC5, 0xC6, 0xE5, 0x47)),
+                -6364.65966796875,
+            ),
+            (
+                "sound_intensity",
+                DPTArray((0xC4, 0xF2, 0x56, 0xE6)),
+                -1938.715576171875,
+            ),
+            (
+                "speed",
+                DPTArray((0xC5, 0xCD, 0x1C, 0x6A)),
+                -6563.5517578125,
+            ),
+            (
+                "stress",
+                DPTArray((0x45, 0xDC, 0xA8, 0xF2)),
+                7061.1181640625,
+            ),
+            (
+                "surface_tension",
+                DPTArray((0x46, 0xB, 0xAC, 0x11)),
+                8939.0166015625,
+            ),
+            (
+                "temperature",
+                DPTArray((0x77, 0x88)),
+                315883.52,
+            ),
+            (
+                "temperature_a",
+                DPTArray((0xF1, 0xDB)),
+                -257720.32,
+            ),
+            (
+                "temperature_difference",
+                DPTArray((0xC6, 0xC, 0x50, 0xBC)),
+                -8980.18359375,
+            ),
+            (
+                "temperature_difference_2byte",
+                DPTArray((0xA9, 0xF4)),
+                -495.36,
+            ),
+            (
+                "temperature_f",
+                DPTArray((0x67, 0xA9)),
+                80322.56,
+            ),
+            (
+                "thermal_capacity",
+                DPTArray((0x45, 0x83, 0xEA, 0xB3)),
+                4221.33740234375,
+            ),
+            (
+                "thermal_conductivity",
+                DPTArray((0xC5, 0x9C, 0x4D, 0x22)),
+                -5001.6416015625,
+            ),
+            (
+                "thermoelectric_power",
+                DPTArray((0x41, 0xCF, 0x9E, 0x4F)),
+                25.952299118041992,
+            ),
+            (
+                "time_1",
+                DPTArray((0x5E, 0x1E)),
+                32071.68,
+            ),
+            (
+                "time_2",
+                DPTArray((0xFB, 0x29)),
+                -405995.52,
+            ),
+            (
+                "time_period_100msec",
+                DPTArray((0x6A, 0x35)),
+                27189,
+            ),
+            (
+                "time_period_10msec",
+                DPTArray((0x32, 0x3)),
+                12803,
+            ),
+            (
+                "time_period_hrs",
+                DPTArray((0x29, 0xDE)),
+                10718,
+            ),
+            (
+                "time_period_min",
+                DPTArray((0x0, 0x54)),
+                84,
+            ),
+            (
+                "time_period_msec",
+                DPTArray((0x93, 0xC7)),
+                37831,
+            ),
+            (
+                "time_period_sec",
+                DPTArray((0xE0, 0xF5)),
+                57589,
+            ),
+            (
+                "time_seconds",
+                DPTArray((0x45, 0xEC, 0x91, 0x7C)),
+                7570.185546875,
+            ),
+            (
+                "torque",
+                DPTArray((0xC5, 0x9, 0x23, 0x5F)),
+                -2194.210693359375,
+            ),
+            (
+                "voltage",
+                DPTArray((0x6D, 0xBF)),
+                120504.32,
+            ),
+            (
+                "volume",
+                DPTArray((0x46, 0x16, 0x98, 0x43)),
+                9638.0654296875,
+            ),
+            (
+                "volume_flow",
+                DPTArray((0x7C, 0xF5)),
+                415825.92,
+            ),
+            (
+                "volume_flux",
+                DPTArray((0xC5, 0x4, 0x2D, 0x72)),
+                -2114.84033203125,
+            ),
+            (
+                "weight",
+                DPTArray((0x45, 0x20, 0x10, 0xE8)),
+                2561.056640625,
+            ),
+            (
+                "work",
+                DPTArray((0x45, 0x64, 0x5D, 0xBE)),
+                3653.85888671875,
+            ),
+            (
+                "wind_speed_ms",
+                DPTArray((0x7D, 0x98)),
+                469237.76,
+            ),
+            (
+                "wind_speed_kmh",
+                DPTArray((0x68, 0x0)),
+                0.0,
+            ),
+        ],
+    )
+    async def test_sensor_value_types(
+        self,
+        value_type,
+        raw_payload,
+        expected_state,
+    ):
+        """Test sensor value types."""
+        xknx = XKNX()
+        sensor = Sensor(
+            xknx,
+            "TestSensor",
+            group_address_state="1/2/3",
+            value_type=value_type,
+        )
+        await sensor.process(
+            Telegram(
+                destination_address=GroupAddress("1/2/3"),
+                payload=GroupValueWrite(value=raw_payload),
+            )
+        )
+
+        assert sensor.resolve_state() == expected_state
 
     async def test_always_callback_sensor(self):
         """Test always callback sensor."""
@@ -45,7 +705,7 @@ class TestSensor:
         sensor.register_device_updated_cb(after_update_callback)
         payload = DPTArray((0x00, 0x00, 0x01, 0x00))
         #  set initial payload of sensor
-        sensor.sensor_value.payload = payload
+        sensor.sensor_value.value = 256
         telegram = Telegram(
             destination_address=GroupAddress("1/2/3"), payload=GroupValueWrite(payload)
         )
@@ -68,1731 +728,6 @@ class TestSensor:
         await sensor.process(response_telegram)
         after_update_callback.assert_not_called()
 
-    def test_str_acceleration(self):
-        """Test resolve state with acceleration sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="acceleration"
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0x94, 0xD8, 0x5D))
-
-        assert sensor.resolve_state() == 4763.04541015625
-        assert sensor.unit_of_measurement() == "m/s²"
-        assert sensor.ha_device_class() is None
-
-    def test_str_volume_liquid_litre(self):
-        """Test resolve state with volume liquid sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="volume_liquid_litre",
-        )
-        sensor.sensor_value.payload = DPTArray((0x00, 0x00, 0x01, 0x00))
-
-        assert sensor.resolve_state() == 256
-        assert sensor.unit_of_measurement() == "l"
-        assert sensor.ha_device_class() is None
-
-    def test_str_volume_m3(self):
-        """Test resolve state with volume m3 sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="volume_m3"
-        )
-        sensor.sensor_value.payload = DPTArray((0x00, 0x00, 0x01, 0x00))
-
-        assert sensor.resolve_state() == 256
-        assert sensor.unit_of_measurement() == "m³"
-        assert sensor.ha_device_class() is None
-
-    def test_str_acceleration_angular(self):
-        """Test resolve state with acceleration_angular sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="acceleration_angular",
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0xEA, 0x62, 0x34))
-
-        assert sensor.resolve_state() == 7500.275390625
-        assert sensor.unit_of_measurement() == "rad/s²"
-        assert sensor.ha_device_class() is None
-
-    def test_str_activation_energy(self):
-        """Test resolve state with activation_energy sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="activation_energy",
-        )
-        sensor.sensor_value.payload = DPTArray((0x46, 0x0, 0x3E, 0xEE))
-
-        assert sensor.resolve_state() == 8207.732421875
-        assert sensor.unit_of_measurement() == "J/mol"
-        assert sensor.ha_device_class() is None
-
-    def test_str_active_energy(self):
-        """Test resolve state with active_energy sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="active_energy"
-        )
-        sensor.sensor_value.payload = DPTArray((0x26, 0x37, 0x49, 0x7F))
-
-        assert sensor.resolve_state() == 641157503
-        assert sensor.unit_of_measurement() == "Wh"
-        assert sensor.ha_device_class() == "energy"
-
-    def test_str_active_energy_kwh(self):
-        """Test resolve state with active_energy_kwh sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="active_energy_kwh",
-        )
-        sensor.sensor_value.payload = DPTArray((0x37, 0x5, 0x5, 0xEA))
-
-        assert sensor.resolve_state() == 923076074
-        assert sensor.unit_of_measurement() == "kWh"
-        assert sensor.ha_device_class() == "energy"
-
-    def test_str_activity(self):
-        """Test resolve state with activity sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="activity"
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0x76, 0x0, 0xA3))
-
-        assert sensor.resolve_state() == 3936.039794921875
-        assert sensor.unit_of_measurement() == "s⁻¹"
-        assert sensor.ha_device_class() is None
-
-    def test_str_amplitude(self):
-        """Test resolve state with amplitude sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="amplitude"
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0x9A, 0xED, 0x8))
-
-        assert sensor.resolve_state() == 4957.62890625
-        assert sensor.unit_of_measurement() == ""
-        assert sensor.ha_device_class() is None
-
-    def test_str_angle(self):
-        """Test resolve state with angle sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="angle"
-        )
-        sensor.sensor_value.payload = DPTArray((0xE4,))
-
-        assert sensor.resolve_state() == 322
-        assert sensor.unit_of_measurement() == "°"
-        assert sensor.ha_device_class() is None
-
-    def test_str_angle_deg(self):
-        """Test resolve state with angle_deg sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="angle_deg"
-        )
-        sensor.sensor_value.payload = DPTArray((0x44, 0x5C, 0x20, 0x2B))
-
-        assert sensor.resolve_state() == 880.5026245117188
-        assert sensor.unit_of_measurement() == "°"
-        assert sensor.ha_device_class() is None
-
-    def test_str_angle_rad(self):
-        """Test resolve state with angle_rad sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="angle_rad"
-        )
-        sensor.sensor_value.payload = DPTArray((0x44, 0x36, 0x75, 0x1))
-
-        assert sensor.resolve_state() == 729.8281860351562
-        assert sensor.unit_of_measurement() == "rad"
-        assert sensor.ha_device_class() is None
-
-    def test_str_angular_frequency(self):
-        """Test resolve state with angular_frequency sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="angular_frequency",
-        )
-        sensor.sensor_value.payload = DPTArray((0x43, 0xBC, 0x20, 0x8D))
-
-        assert sensor.resolve_state() == 376.2543029785156
-        assert sensor.unit_of_measurement() == "rad/s"
-        assert sensor.ha_device_class() is None
-
-    def test_str_angular_momentum(self):
-        """Test resolve state with angular_momentum sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="angular_momentum",
-        )
-        sensor.sensor_value.payload = DPTArray((0xC2, 0x75, 0xB7, 0xB5))
-
-        assert sensor.resolve_state() == -61.42940139770508
-        assert sensor.unit_of_measurement() == "J s"
-        assert sensor.ha_device_class() is None
-
-    def test_str_angular_velocity(self):
-        """Test resolve state with angular_velocity sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="angular_velocity",
-        )
-        sensor.sensor_value.payload = DPTArray((0xC4, 0xD9, 0x10, 0xB3))
-
-        assert sensor.resolve_state() == -1736.5218505859375
-        assert sensor.unit_of_measurement() == "rad/s"
-        assert sensor.ha_device_class() is None
-
-    def test_str_apparant_energy(self):
-        """Test resolve state with apparant_energy sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="apparant_energy",
-        )
-        sensor.sensor_value.payload = DPTArray((0xD3, 0xBD, 0x1E, 0xA5))
-
-        assert sensor.resolve_state() == -742580571
-        assert sensor.unit_of_measurement() == "VAh"
-        assert sensor.ha_device_class() == "energy"
-
-    def test_str_apparant_energy_kvah(self):
-        """Test resolve state with apparant_energy_kvah sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="apparant_energy_kvah",
-        )
-        sensor.sensor_value.payload = DPTArray((0x49, 0x40, 0xC9, 0x9))
-
-        assert sensor.resolve_state() == 1228982537
-        assert sensor.unit_of_measurement() == "kVAh"
-        assert sensor.ha_device_class() == "energy"
-
-    def test_str_area(self):
-        """Test resolve state with area sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="area"
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0x63, 0x1E, 0xCD))
-
-        assert sensor.resolve_state() == 3633.925048828125
-        assert sensor.unit_of_measurement() == "m²"
-        assert sensor.ha_device_class() is None
-
-    def test_str_brightness(self):
-        """Test resolve state with brightness sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="brightness"
-        )
-        sensor.sensor_value.payload = DPTArray((0xC3, 0x56))
-
-        assert sensor.resolve_state() == 50006
-        assert sensor.unit_of_measurement() == "lx"
-        assert sensor.ha_device_class() is None
-
-    def test_str_capacitance(self):
-        """Test resolve state with capacitance sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="capacitance"
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0xC9, 0x1D, 0x9D))
-
-        assert sensor.resolve_state() == 6435.70166015625
-        assert sensor.unit_of_measurement() == "F"
-        assert sensor.ha_device_class() is None
-
-    def test_str_charge_density_surface(self):
-        """Test resolve state with charge_density_surface sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="charge_density_surface",
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0xDB, 0x66, 0x99))
-
-        assert sensor.resolve_state() == 7020.82470703125
-        assert sensor.unit_of_measurement() == "C/m²"
-        assert sensor.ha_device_class() is None
-
-    def test_str_charge_density_volume(self):
-        """Test resolve state with charge_density_volume sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="charge_density_volume",
-        )
-        sensor.sensor_value.payload = DPTArray((0xC4, 0x8C, 0x33, 0xD7))
-
-        assert sensor.resolve_state() == -1121.6199951171875
-        assert sensor.unit_of_measurement() == "C/m³"
-        assert sensor.ha_device_class() is None
-
-    def test_str_color_temperature(self):
-        """Test resolve state with color_temperature sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="color_temperature",
-        )
-        sensor.sensor_value.payload = DPTArray((0x6C, 0x95))
-
-        assert sensor.resolve_state() == 27797
-        assert sensor.unit_of_measurement() == "K"
-        assert sensor.ha_device_class() is None
-
-    def test_str_common_temperature(self):
-        """Test resolve state with common_temperature sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="common_temperature",
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0xD9, 0xC6, 0x3F))
-
-        assert sensor.resolve_state() == 6968.78076171875
-        assert sensor.unit_of_measurement() == "°C"
-        assert sensor.ha_device_class() is None
-
-    def test_str_compressibility(self):
-        """Test resolve state with compressibility sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="compressibility",
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0x89, 0x94, 0xAB))
-
-        assert sensor.resolve_state() == 4402.58349609375
-        assert sensor.unit_of_measurement() == "m²/N"
-        assert sensor.ha_device_class() is None
-
-    def test_str_conductance(self):
-        """Test resolve state with conductance sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="conductance"
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0xA6, 0x28, 0xF9))
-
-        assert sensor.resolve_state() == 5317.12158203125
-        assert sensor.unit_of_measurement() == "S"
-        assert sensor.ha_device_class() is None
-
-    def test_str_counter_pulses(self):
-        """Test resolve state with counter_pulses sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="counter_pulses"
-        )
-        sensor.sensor_value.payload = DPTArray((0x9D,))
-
-        assert sensor.resolve_state() == -99
-        assert sensor.unit_of_measurement() == "counter pulses"
-        assert sensor.ha_device_class() is None
-
-    def test_str_current(self):
-        """Test resolve state with current sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="current"
-        )
-        sensor.sensor_value.payload = DPTArray((0xCA, 0xCC))
-
-        assert sensor.resolve_state() == 51916
-        assert sensor.unit_of_measurement() == "mA"
-        assert sensor.ha_device_class() is None
-
-    def test_str_delta_time_hrs(self):
-        """Test resolve state with delta_time_hrs sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="delta_time_hrs"
-        )
-        sensor.sensor_value.payload = DPTArray((0x47, 0x80))
-
-        assert sensor.resolve_state() == 18304
-        assert sensor.unit_of_measurement() == "h"
-        assert sensor.ha_device_class() is None
-
-    def test_str_delta_time_min(self):
-        """Test resolve state with delta_time_min sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="delta_time_min"
-        )
-        sensor.sensor_value.payload = DPTArray((0xB9, 0x7B))
-
-        assert sensor.resolve_state() == -18053
-        assert sensor.unit_of_measurement() == "min"
-        assert sensor.ha_device_class() is None
-
-    def test_str_delta_time_ms(self):
-        """Test resolve state with delta_time_ms sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="delta_time_ms"
-        )
-        sensor.sensor_value.payload = DPTArray((0x58, 0x77))
-
-        assert sensor.resolve_state() == 22647
-        assert sensor.unit_of_measurement() == "ms"
-        assert sensor.ha_device_class() is None
-
-    def test_str_delta_time_sec(self):
-        """Test resolve state with delta_time_sec sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="delta_time_sec"
-        )
-        sensor.sensor_value.payload = DPTArray((0xA3, 0x6A))
-
-        assert sensor.resolve_state() == -23702
-        assert sensor.unit_of_measurement() == "s"
-        assert sensor.ha_device_class() is None
-
-    def test_str_density(self):
-        """Test resolve state with density sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="density"
-        )
-        sensor.sensor_value.payload = DPTArray((0x44, 0xA5, 0xCB, 0x27))
-
-        assert sensor.resolve_state() == 1326.3485107421875
-        assert sensor.unit_of_measurement() == "kg/m³"
-        assert sensor.ha_device_class() is None
-
-    def test_str_electrical_conductivity(self):
-        """Test resolve state with electrical_conductivity sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="electrical_conductivity",
-        )
-        sensor.sensor_value.payload = DPTArray((0xC4, 0xC6, 0xF5, 0x6E))
-
-        assert sensor.resolve_state() == -1591.669677734375
-        assert sensor.unit_of_measurement() == "S/m"
-        assert sensor.ha_device_class() is None
-
-    def test_str_electric_charge(self):
-        """Test resolve state with electric_charge sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="electric_charge",
-        )
-        sensor.sensor_value.payload = DPTArray((0x46, 0x14, 0xF6, 0xA0))
-
-        assert sensor.resolve_state() == 9533.65625
-        assert sensor.unit_of_measurement() == "C"
-        assert sensor.ha_device_class() is None
-
-    def test_str_electric_current(self):
-        """Test resolve state with electric_current sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="electric_current",
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0xAD, 0x45, 0x90))
-
-        assert sensor.resolve_state() == 5544.6953125
-        assert sensor.unit_of_measurement() == "A"
-        assert sensor.ha_device_class() is None
-
-    def test_str_electric_current_density(self):
-        """Test resolve state with electric_current_density sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="electric_current_density",
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0x7C, 0x57, 0xF6))
-
-        assert sensor.resolve_state() == 4037.49755859375
-        assert sensor.unit_of_measurement() == "A/m²"
-        assert sensor.ha_device_class() is None
-
-    def test_str_electric_dipole_moment(self):
-        """Test resolve state with electric_dipole_moment sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="electric_dipole_moment",
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0x58, 0xF1, 0x73))
-
-        assert sensor.resolve_state() == 3471.090576171875
-        assert sensor.unit_of_measurement() == "C m"
-        assert sensor.ha_device_class() is None
-
-    def test_str_electric_displacement(self):
-        """Test resolve state with electric_displacement sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="electric_displacement",
-        )
-        sensor.sensor_value.payload = DPTArray((0xC5, 0x34, 0x8B, 0x0))
-
-        assert sensor.resolve_state() == -2888.6875
-        assert sensor.unit_of_measurement() == "C/m²"
-        assert sensor.ha_device_class() is None
-
-    def test_str_electric_field_strength(self):
-        """Test resolve state with electric_field_strength sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="electric_field_strength",
-        )
-        sensor.sensor_value.payload = DPTArray((0xC6, 0x17, 0x1C, 0x39))
-
-        assert sensor.resolve_state() == -9671.0556640625
-        assert sensor.unit_of_measurement() == "V/m"
-        assert sensor.ha_device_class() is None
-
-    def test_str_electric_flux(self):
-        """Test resolve state with electric_flux sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="electric_flux"
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0x8F, 0x6C, 0xFD))
-
-        assert sensor.resolve_state() == 4589.62353515625
-        assert sensor.unit_of_measurement() == "c"
-        assert sensor.ha_device_class() is None
-
-    def test_str_electric_flux_density(self):
-        """Test resolve state with electric_flux_density sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="electric_flux_density",
-        )
-        sensor.sensor_value.payload = DPTArray((0xC6, 0x0, 0x50, 0xA8))
-
-        assert sensor.resolve_state() == -8212.1640625
-        assert sensor.unit_of_measurement() == "C/m²"
-        assert sensor.ha_device_class() is None
-
-    def test_str_electric_polarization(self):
-        """Test resolve state with electric_polarization sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="electric_polarization",
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0xF8, 0x89, 0xC6))
-
-        assert sensor.resolve_state() == 7953.2216796875
-        assert sensor.unit_of_measurement() == "C/m²"
-        assert sensor.ha_device_class() is None
-
-    def test_str_electric_potential(self):
-        """Test resolve state with electric_potential sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="electric_potential",
-        )
-        sensor.sensor_value.payload = DPTArray((0xC6, 0x18, 0xA4, 0xAF))
-
-        assert sensor.resolve_state() == -9769.1708984375
-        assert sensor.unit_of_measurement() == "V"
-        assert sensor.ha_device_class() is None
-
-    def test_str_electric_potential_difference(self):
-        """Test resolve state with electric_potential_difference sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="electric_potential_difference",
-        )
-        sensor.sensor_value.payload = DPTArray((0xC6, 0xF, 0x1D, 0x6))
-
-        assert sensor.resolve_state() == -9159.255859375
-        assert sensor.unit_of_measurement() == "V"
-        assert sensor.ha_device_class() is None
-
-    def test_str_electromagnetic_moment(self):
-        """Test resolve state with electromagnetic_moment sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="electromagnetic_moment",
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0x82, 0x48, 0xAE))
-
-        assert sensor.resolve_state() == 4169.0849609375
-        assert sensor.unit_of_measurement() == "A m²"
-        assert sensor.ha_device_class() is None
-
-    def test_str_electromotive_force(self):
-        """Test resolve state with electromotive_force sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="electromotive_force",
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0xBC, 0xEF, 0xEB))
-
-        assert sensor.resolve_state() == 6045.98974609375
-        assert sensor.unit_of_measurement() == "V"
-        assert sensor.ha_device_class() is None
-
-    def test_str_energy(self):
-        """Test resolve state with energy sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="energy"
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0x4B, 0xB3, 0xF8))
-
-        assert sensor.resolve_state() == 3259.248046875
-        assert sensor.unit_of_measurement() == "J"
-        assert sensor.ha_device_class() is None
-
-    def test_str_enthalpy(self):
-        """Test resolve state with enthalpy sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="enthalpy"
-        )
-        sensor.sensor_value.payload = DPTArray((0x76, 0xDD))
-
-        assert sensor.resolve_state() == 287866.88
-        assert sensor.unit_of_measurement() == "H"
-        assert sensor.ha_device_class() is None
-
-    def test_str_flow_rate_m3h(self):
-        """Test resolve state with flow_rate_m3h sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="flow_rate_m3h"
-        )
-        sensor.sensor_value.payload = DPTArray((0x99, 0xEA, 0xC0, 0x55))
-
-        assert sensor.resolve_state() == -1712668587
-        assert sensor.unit_of_measurement() == "m³/h"
-        assert sensor.ha_device_class() is None
-
-    def test_str_force(self):
-        """Test resolve state with force sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="force"
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0x9E, 0x2C, 0xE1))
-
-        assert sensor.resolve_state() == 5061.60986328125
-        assert sensor.unit_of_measurement() == "N"
-        assert sensor.ha_device_class() is None
-
-    def test_str_frequency(self):
-        """Test resolve state with frequency sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="frequency"
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0xC2, 0x3C, 0x44))
-
-        assert sensor.resolve_state() == 6215.533203125
-        assert sensor.unit_of_measurement() == "Hz"
-        assert sensor.ha_device_class() is None
-
-    def test_str_heatcapacity(self):
-        """Test resolve state with heatcapacity sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="heatcapacity"
-        )
-        sensor.sensor_value.payload = DPTArray((0xC5, 0xB3, 0x56, 0x7E))
-
-        assert sensor.resolve_state() == -5738.8115234375
-        assert sensor.unit_of_measurement() == "J/K"
-        assert sensor.ha_device_class() is None
-
-    def test_str_heatflowrate(self):
-        """Test resolve state with heatflowrate sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="heatflowrate"
-        )
-        sensor.sensor_value.payload = DPTArray((0x44, 0xEC, 0x80, 0x7A))
-
-        assert sensor.resolve_state() == 1892.014892578125
-        assert sensor.unit_of_measurement() == "W"
-        assert sensor.ha_device_class() is None
-
-    def test_str_heat_quantity(self):
-        """Test resolve state with heat_quantity sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="heat_quantity"
-        )
-        sensor.sensor_value.payload = DPTArray((0xC5, 0xA6, 0xB6, 0xD5))
-
-        assert sensor.resolve_state() == -5334.85400390625
-        assert sensor.unit_of_measurement() == "J"
-        assert sensor.ha_device_class() is None
-
-    def test_str_humidity(self):
-        """Test resolve state with humidity sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="humidity"
-        )
-        sensor.sensor_value.payload = DPTArray((0x7E, 0xE1))
-
-        assert sensor.resolve_state() == 577044.48
-        assert sensor.unit_of_measurement() == "%"
-        assert sensor.ha_device_class() == "humidity"
-
-    def test_str_impedance(self):
-        """Test resolve state with impedance sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="impedance"
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0xDD, 0x79, 0x6D))
-
-        assert sensor.resolve_state() == 7087.17822265625
-        assert sensor.unit_of_measurement() == "Ω"
-        assert sensor.ha_device_class() is None
-
-    def test_str_illuminance(self):
-        """Test resolve state with illuminance sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="illuminance"
-        )
-        sensor.sensor_value.payload = DPTArray((0x7C, 0x5E))
-
-        assert sensor.resolve_state() == 366346.24
-        assert sensor.unit_of_measurement() == "lx"
-        assert sensor.ha_device_class() == "illuminance"
-
-    def test_str_kelvin_per_percent(self):
-        """Test resolve state with kelvin_per_percent sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="kelvin_per_percent",
-        )
-        sensor.sensor_value.payload = DPTArray((0xFA, 0xBD))
-
-        assert sensor.resolve_state() == -441384.96
-        assert sensor.unit_of_measurement() == "K/%"
-        assert sensor.ha_device_class() is None
-
-    def test_str_length(self):
-        """Test resolve state with length sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="length"
-        )
-        sensor.sensor_value.payload = DPTArray((0xC5, 0x9D, 0xAE, 0xC5))
-
-        assert sensor.resolve_state() == -5045.84619140625
-        assert sensor.unit_of_measurement() == "m"
-        assert sensor.ha_device_class() is None
-
-    def test_str_length_mm(self):
-        """Test resolve state with length_mm sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="length_mm"
-        )
-        sensor.sensor_value.payload = DPTArray((0x56, 0xB9))
-
-        assert sensor.resolve_state() == 22201
-        assert sensor.unit_of_measurement() == "mm"
-        assert sensor.ha_device_class() is None
-
-    def test_str_light_quantity(self):
-        """Test resolve state with light_quantity sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="light_quantity"
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0x4A, 0xF5, 0x68))
-
-        assert sensor.resolve_state() == 3247.337890625
-        assert sensor.unit_of_measurement() == "lm s"
-        assert sensor.ha_device_class() is None
-
-    def test_str_long_delta_timesec(self):
-        """Test resolve state with long_delta_timesec sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="long_delta_timesec",
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0xB2, 0x17, 0x54))
-
-        assert sensor.resolve_state() == 1169299284
-        assert sensor.unit_of_measurement() == "s"
-        assert sensor.ha_device_class() is None
-
-    def test_str_luminance(self):
-        """Test resolve state with luminance sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="luminance"
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0x18, 0xD9, 0x76))
-
-        assert sensor.resolve_state() == 2445.59130859375
-        assert sensor.unit_of_measurement() == "cd/m²"
-        assert sensor.ha_device_class() == "illuminance"
-
-    def test_str_luminous_flux(self):
-        """Test resolve state with luminous_flux sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="luminous_flux"
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0xBD, 0x16, 0x9))
-
-        assert sensor.resolve_state() == 6050.75439453125
-        assert sensor.unit_of_measurement() == "lm"
-        assert sensor.ha_device_class() == "illuminance"
-
-    def test_str_luminous_intensity(self):
-        """Test resolve state with luminous_intensity sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="luminous_intensity",
-        )
-        sensor.sensor_value.payload = DPTArray((0x46, 0xB, 0xBE, 0x7E))
-
-        assert sensor.resolve_state() == 8943.623046875
-        assert sensor.unit_of_measurement() == "cd"
-        assert sensor.ha_device_class() == "illuminance"
-
-    def test_str_magnetic_field_strength(self):
-        """Test resolve state with magnetic_field_strength sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="magnetic_field_strength",
-        )
-        sensor.sensor_value.payload = DPTArray((0x44, 0x15, 0xF1, 0xAD))
-
-        assert sensor.resolve_state() == 599.7761840820312
-        assert sensor.unit_of_measurement() == "A/m"
-        assert sensor.ha_device_class() is None
-
-    def test_str_magnetic_flux(self):
-        """Test resolve state with magnetic_flux sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="magnetic_flux"
-        )
-        sensor.sensor_value.payload = DPTArray((0xC5, 0xCB, 0x3C, 0x98))
-
-        assert sensor.resolve_state() == -6503.57421875
-        assert sensor.unit_of_measurement() == "Wb"
-        assert sensor.ha_device_class() is None
-
-    def test_str_magnetic_flux_density(self):
-        """Test resolve state with magnetic_flux_density sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="magnetic_flux_density",
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0xB6, 0xBD, 0x42))
-
-        assert sensor.resolve_state() == 5847.6572265625
-        assert sensor.unit_of_measurement() == "T"
-        assert sensor.ha_device_class() is None
-
-    def test_str_magnetic_moment(self):
-        """Test resolve state with magnetic_moment sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="magnetic_moment",
-        )
-        sensor.sensor_value.payload = DPTArray((0xC3, 0x8E, 0x7F, 0x73))
-
-        assert sensor.resolve_state() == -284.9956970214844
-        assert sensor.unit_of_measurement() == "A m²"
-        assert sensor.ha_device_class() is None
-
-    def test_str_magnetic_polarization(self):
-        """Test resolve state with magnetic_polarization sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="magnetic_polarization",
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0x8C, 0xFA, 0xCB))
-
-        assert sensor.resolve_state() == 4511.34912109375
-        assert sensor.unit_of_measurement() == "T"
-        assert sensor.ha_device_class() is None
-
-    def test_str_magnetization(self):
-        """Test resolve state with magnetization sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="magnetization"
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0xF7, 0x9D, 0xA2))
-
-        assert sensor.resolve_state() == 7923.7041015625
-        assert sensor.unit_of_measurement() == "A/m"
-        assert sensor.ha_device_class() is None
-
-    def test_str_magnetomotive_force(self):
-        """Test resolve state with magnetomotive_force sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="magnetomotive_force",
-        )
-        sensor.sensor_value.payload = DPTArray((0xC6, 0x4, 0xC2, 0xDA))
-
-        assert sensor.resolve_state() == -8496.712890625
-        assert sensor.unit_of_measurement() == "A"
-        assert sensor.ha_device_class() is None
-
-    def test_str_mass(self):
-        """Test resolve state with mass sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="mass"
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0x8F, 0x70, 0xA4))
-
-        assert sensor.resolve_state() == 4590.080078125
-        assert sensor.unit_of_measurement() == "kg"
-        assert sensor.ha_device_class() is None
-
-    def test_str_mass_flux(self):
-        """Test resolve state with mass_flux sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="mass_flux"
-        )
-        sensor.sensor_value.payload = DPTArray((0xC6, 0x7, 0x34, 0xFF))
-
-        assert sensor.resolve_state() == -8653.2490234375
-        assert sensor.unit_of_measurement() == "kg/s"
-        assert sensor.ha_device_class() is None
-
-    def test_str_mol(self):
-        """Test resolve state with mol sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="mol"
-        )
-        sensor.sensor_value.payload = DPTArray((0xC4, 0xA0, 0xF4, 0x68))
-
-        assert sensor.resolve_state() == -1287.6376953125
-        assert sensor.unit_of_measurement() == "mol"
-        assert sensor.ha_device_class() is None
-
-    def test_str_momentum(self):
-        """Test resolve state with momentum sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="momentum"
-        )
-        sensor.sensor_value.payload = DPTArray((0xC5, 0x27, 0xAA, 0x5B))
-
-        assert sensor.resolve_state() == -2682.647216796875
-        assert sensor.unit_of_measurement() == "N/s"
-        assert sensor.ha_device_class() is None
-
-    def test_str_percent(self):
-        """Test resolve state with percent sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="percent"
-        )
-        sensor.sensor_value.payload = DPTArray((0xE3,))
-
-        assert sensor.resolve_state() == 89
-        assert sensor.unit_of_measurement() == "%"
-        assert sensor.ha_device_class() is None
-
-    def test_str_percent_u8(self):
-        """Test resolve state with percentU8 sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="percentU8"
-        )
-        sensor.sensor_value.payload = DPTArray((0x6B,))
-
-        assert sensor.resolve_state() == 107
-        assert sensor.unit_of_measurement() == "%"
-        assert sensor.ha_device_class() is None
-
-    def test_str_percent_v8(self):
-        """Test resolve state with percentV8 sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="percentV8"
-        )
-        sensor.sensor_value.payload = DPTArray((0x20,))
-
-        assert sensor.resolve_state() == 32
-        assert sensor.unit_of_measurement() == "%"
-        assert sensor.ha_device_class() is None
-
-    def test_str_percent_v16(self):
-        """Test resolve state with percentV16 sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="percentV16"
-        )
-        sensor.sensor_value.payload = DPTArray((0x8A, 0x2F))
-
-        assert sensor.resolve_state() == -30161
-        assert sensor.unit_of_measurement() == "%"
-        assert sensor.ha_device_class() is None
-
-    def test_str_phaseanglerad(self):
-        """Test resolve state with phaseanglerad sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="phaseanglerad"
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0x54, 0xAC, 0x2E))
-
-        assert sensor.resolve_state() == 3402.76123046875
-        assert sensor.unit_of_measurement() == "rad"
-        assert sensor.ha_device_class() is None
-
-    def test_str_phaseangledeg(self):
-        """Test resolve state with phaseangledeg sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="phaseangledeg"
-        )
-        sensor.sensor_value.payload = DPTArray((0xC5, 0x25, 0x13, 0x38))
-
-        assert sensor.resolve_state() == -2641.201171875
-        assert sensor.unit_of_measurement() == "°"
-        assert sensor.ha_device_class() is None
-
-    def test_str_power(self):
-        """Test resolve state with power sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="power"
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0xCB, 0xE2, 0x5C))
-
-        assert sensor.resolve_state() == 6524.294921875
-        assert sensor.unit_of_measurement() == "W"
-        assert sensor.ha_device_class() == "power"
-
-    def test_str_power_2byte(self):
-        """Test resolve state with power_2byte sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="power_2byte"
-        )
-        sensor.sensor_value.payload = DPTArray((0x6D, 0x91))
-
-        assert sensor.resolve_state() == 116736.0
-        assert sensor.unit_of_measurement() == "kW"
-        assert sensor.ha_device_class() == "power"
-
-    def test_str_power_density(self):
-        """Test resolve state with power_density sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="power_density"
-        )
-        sensor.sensor_value.payload = DPTArray((0x65, 0x3E))
-
-        assert sensor.resolve_state() == 54968.32
-        assert sensor.unit_of_measurement() == "W/m²"
-        assert sensor.ha_device_class() is None
-
-    def test_str_powerfactor(self):
-        """Test resolve state with powerfactor sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="powerfactor"
-        )
-        sensor.sensor_value.payload = DPTArray((0xC5, 0x35, 0x28, 0x21))
-
-        assert sensor.resolve_state() == -2898.508056640625
-        assert sensor.unit_of_measurement() == "cosΦ"
-        assert sensor.ha_device_class() == "power_factor"
-
-    def test_str_ppm(self):
-        """Test resolve state with ppm sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="ppm"
-        )
-        sensor.sensor_value.payload = DPTArray((0x7F, 0x74))
-
-        assert sensor.resolve_state() == 625213.44
-        assert sensor.unit_of_measurement() == "ppm"
-        assert sensor.ha_device_class() is None
-
-    def test_str_pressure(self):
-        """Test resolve state with pressure sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="pressure"
-        )
-        sensor.sensor_value.payload = DPTArray((0xC5, 0xE6, 0xE6, 0x63))
-
-        assert sensor.resolve_state() == -7388.79833984375
-        assert sensor.unit_of_measurement() == "Pa"
-        assert sensor.ha_device_class() == "pressure"
-
-    def test_str_pressure_2byte(self):
-        """Test resolve state with pressure_2byte sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="pressure_2byte"
-        )
-        sensor.sensor_value.payload = DPTArray((0x7C, 0xF4))
-
-        assert sensor.resolve_state() == 415498.24
-        assert sensor.unit_of_measurement() == "Pa"
-        assert sensor.ha_device_class() == "pressure"
-
-    def test_str_pulse(self):
-        """Test resolve state with pulse sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="pulse"
-        )
-        sensor.sensor_value.payload = DPTArray((0xFC,))
-
-        assert sensor.resolve_state() == 252
-        assert sensor.unit_of_measurement() == "counter pulses"
-        assert sensor.ha_device_class() is None
-
-    def test_str_rain_amount(self):
-        """Test resolve state with rain_amount sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="rain_amount"
-        )
-        sensor.sensor_value.payload = DPTArray((0xE0, 0xD0))
-
-        assert sensor.resolve_state() == -75366.4
-        assert sensor.unit_of_measurement() == "l/m²"
-        assert sensor.ha_device_class() is None
-
-    def test_str_reactance(self):
-        """Test resolve state with reactance sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="reactance"
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0xB0, 0x50, 0x91))
-
-        assert sensor.resolve_state() == 5642.07080078125
-        assert sensor.unit_of_measurement() == "Ω"
-        assert sensor.ha_device_class() is None
-
-    def test_str_reactive_energy(self):
-        """Test resolve state with reactive_energy sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="reactive_energy",
-        )
-        sensor.sensor_value.payload = DPTArray((0x1A, 0x49, 0x6D, 0xA7))
-
-        assert sensor.resolve_state() == 441019815
-        assert sensor.unit_of_measurement() == "VARh"
-        assert sensor.ha_device_class() == "energy"
-
-    def test_str_reactive_energy_kvarh(self):
-        """Test resolve state with reactive_energy_kvarh sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="reactive_energy_kvarh",
-        )
-        sensor.sensor_value.payload = DPTArray((0xCC, 0x62, 0x5, 0x31))
-
-        assert sensor.resolve_state() == -865991375
-        assert sensor.unit_of_measurement() == "kVARh"
-        assert sensor.ha_device_class() == "energy"
-
-    def test_str_resistance(self):
-        """Test resolve state with resistance sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="resistance"
-        )
-        sensor.sensor_value.payload = DPTArray((0xC5, 0xFC, 0x5F, 0xC2))
-
-        assert sensor.resolve_state() == -8075.9697265625
-        assert sensor.unit_of_measurement() == "Ω"
-        assert sensor.ha_device_class() is None
-
-    def test_str_resistivity(self):
-        """Test resolve state with resistivity sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="resistivity"
-        )
-        sensor.sensor_value.payload = DPTArray((0xC5, 0x57, 0x76, 0xC3))
-
-        assert sensor.resolve_state() == -3447.422607421875
-        assert sensor.unit_of_measurement() == "Ω m"
-        assert sensor.ha_device_class() is None
-
-    def test_str_rotation_angle(self):
-        """Test resolve state with rotation_angle sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="rotation_angle"
-        )
-        sensor.sensor_value.payload = DPTArray((0x2D, 0xDC))
-
-        assert sensor.resolve_state() == 11740
-        assert sensor.unit_of_measurement() == "°"
-        assert sensor.ha_device_class() is None
-
-    def test_str_scene_number(self):
-        """Test resolve state with scene_number sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="scene_number"
-        )
-        sensor.sensor_value.payload = DPTArray((0x1,))
-
-        assert sensor.resolve_state() == 2
-        assert sensor.unit_of_measurement() == ""
-        assert sensor.ha_device_class() is None
-
-    def test_str_self_inductance(self):
-        """Test resolve state with self_inductance sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="self_inductance",
-        )
-        sensor.sensor_value.payload = DPTArray((0xC4, 0xA1, 0xB0, 0x6))
-
-        assert sensor.resolve_state() == -1293.500732421875
-        assert sensor.unit_of_measurement() == "H"
-        assert sensor.ha_device_class() is None
-
-    def test_str_solid_angle(self):
-        """Test resolve state with solid_angle sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="solid_angle"
-        )
-        sensor.sensor_value.payload = DPTArray((0xC5, 0xC6, 0xE5, 0x47))
-
-        assert sensor.resolve_state() == -6364.65966796875
-        assert sensor.unit_of_measurement() == "sr"
-        assert sensor.ha_device_class() is None
-
-    def test_str_sound_intensity(self):
-        """Test resolve state with sound_intensity sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="sound_intensity",
-        )
-        sensor.sensor_value.payload = DPTArray((0xC4, 0xF2, 0x56, 0xE6))
-
-        assert sensor.resolve_state() == -1938.715576171875
-        assert sensor.unit_of_measurement() == "W/m²"
-        assert sensor.ha_device_class() is None
-
-    def test_str_speed(self):
-        """Test resolve state with speed sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="speed"
-        )
-        sensor.sensor_value.payload = DPTArray((0xC5, 0xCD, 0x1C, 0x6A))
-
-        assert sensor.resolve_state() == -6563.5517578125
-        assert sensor.unit_of_measurement() == "m/s"
-        assert sensor.ha_device_class() is None
-
-    def test_str_stress(self):
-        """Test resolve state with stress sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="stress"
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0xDC, 0xA8, 0xF2))
-
-        assert sensor.resolve_state() == 7061.1181640625
-        assert sensor.unit_of_measurement() == "Pa"
-        assert sensor.ha_device_class() is None
-
-    def test_str_surface_tension(self):
-        """Test resolve state with surface_tension sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="surface_tension",
-        )
-        sensor.sensor_value.payload = DPTArray((0x46, 0xB, 0xAC, 0x11))
-
-        assert sensor.resolve_state() == 8939.0166015625
-        assert sensor.unit_of_measurement() == "N/m"
-        assert sensor.ha_device_class() is None
-
-    def test_str_temperature(self):
-        """Test resolve state with temperature sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="temperature"
-        )
-        sensor.sensor_value.payload = DPTArray((0x77, 0x88))
-
-        assert sensor.resolve_state() == 315883.52
-        assert sensor.unit_of_measurement() == "°C"
-        assert sensor.ha_device_class() == "temperature"
-
-    def test_str_temperature_a(self):
-        """Test resolve state with temperature_a sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="temperature_a"
-        )
-        sensor.sensor_value.payload = DPTArray((0xF1, 0xDB))
-
-        assert sensor.resolve_state() == -257720.32
-        assert sensor.unit_of_measurement() == "K/h"
-        assert sensor.ha_device_class() is None
-
-    def test_str_temperature_difference(self):
-        """Test resolve state with temperature_difference sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="temperature_difference",
-        )
-        sensor.sensor_value.payload = DPTArray((0xC6, 0xC, 0x50, 0xBC))
-
-        assert sensor.resolve_state() == -8980.18359375
-        assert sensor.unit_of_measurement() == "K"
-        assert sensor.ha_device_class() is None
-
-    def test_str_temperature_difference_2byte(self):
-        """Test resolve state with temperature_difference_2byte sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="temperature_difference_2byte",
-        )
-        sensor.sensor_value.payload = DPTArray((0xA9, 0xF4))
-
-        assert sensor.resolve_state() == -495.36
-        assert sensor.unit_of_measurement() == "K"
-        assert sensor.ha_device_class() == "temperature"
-
-    def test_str_temperature_f(self):
-        """Test resolve state with temperature_f sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="temperature_f"
-        )
-        sensor.sensor_value.payload = DPTArray((0x67, 0xA9))
-
-        assert sensor.resolve_state() == 80322.56
-        assert sensor.unit_of_measurement() == "°F"
-        assert sensor.ha_device_class() == "temperature"
-
-    def test_str_thermal_capacity(self):
-        """Test resolve state with thermal_capacity sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="thermal_capacity",
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0x83, 0xEA, 0xB3))
-
-        assert sensor.resolve_state() == 4221.33740234375
-        assert sensor.unit_of_measurement() == "J/K"
-        assert sensor.ha_device_class() is None
-
-    def test_str_thermal_conductivity(self):
-        """Test resolve state with thermal_conductivity sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="thermal_conductivity",
-        )
-        sensor.sensor_value.payload = DPTArray((0xC5, 0x9C, 0x4D, 0x22))
-
-        assert sensor.resolve_state() == -5001.6416015625
-        assert sensor.unit_of_measurement() == "W/mK"
-        assert sensor.ha_device_class() is None
-
-    def test_str_thermoelectric_power(self):
-        """Test resolve state with thermoelectric_power sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="thermoelectric_power",
-        )
-        sensor.sensor_value.payload = DPTArray((0x41, 0xCF, 0x9E, 0x4F))
-
-        assert sensor.resolve_state() == 25.952299118041992
-        assert sensor.unit_of_measurement() == "V/K"
-        assert sensor.ha_device_class() is None
-
-    def test_str_time_1(self):
-        """Test resolve state with time_1 sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="time_1"
-        )
-        sensor.sensor_value.payload = DPTArray((0x5E, 0x1E))
-
-        assert sensor.resolve_state() == 32071.68
-        assert sensor.unit_of_measurement() == "s"
-        assert sensor.ha_device_class() is None
-
-    def test_str_time_2(self):
-        """Test resolve state with time_2 sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="time_2"
-        )
-        sensor.sensor_value.payload = DPTArray((0xFB, 0x29))
-
-        assert sensor.resolve_state() == -405995.52
-        assert sensor.unit_of_measurement() == "ms"
-        assert sensor.ha_device_class() is None
-
-    def test_str_time_period_100msec(self):
-        """Test resolve state with time_period_100msec sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="time_period_100msec",
-        )
-        sensor.sensor_value.payload = DPTArray((0x6A, 0x35))
-
-        assert sensor.resolve_state() == 27189
-        assert sensor.unit_of_measurement() == "ms"
-        assert sensor.ha_device_class() is None
-
-    def test_str_time_period_10msec(self):
-        """Test resolve state with time_period_10msec sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="time_period_10msec",
-        )
-        sensor.sensor_value.payload = DPTArray((0x32, 0x3))
-
-        assert sensor.resolve_state() == 12803
-        assert sensor.unit_of_measurement() == "ms"
-        assert sensor.ha_device_class() is None
-
-    def test_str_time_period_hrs(self):
-        """Test resolve state with time_period_hrs sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="time_period_hrs",
-        )
-        sensor.sensor_value.payload = DPTArray((0x29, 0xDE))
-
-        assert sensor.resolve_state() == 10718
-        assert sensor.unit_of_measurement() == "h"
-        assert sensor.ha_device_class() is None
-
-    def test_str_time_period_min(self):
-        """Test resolve state with time_period_min sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="time_period_min",
-        )
-        sensor.sensor_value.payload = DPTArray((0x0, 0x54))
-
-        assert sensor.resolve_state() == 84
-        assert sensor.unit_of_measurement() == "min"
-        assert sensor.ha_device_class() is None
-
-    def test_str_time_period_msec(self):
-        """Test resolve state with time_period_msec sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="time_period_msec",
-        )
-        sensor.sensor_value.payload = DPTArray((0x93, 0xC7))
-
-        assert sensor.resolve_state() == 37831
-        assert sensor.unit_of_measurement() == "ms"
-        assert sensor.ha_device_class() is None
-
-    def test_str_time_period_sec(self):
-        """Test resolve state with time_period_sec sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx,
-            "TestSensor",
-            group_address_state="1/2/3",
-            value_type="time_period_sec",
-        )
-        sensor.sensor_value.payload = DPTArray((0xE0, 0xF5))
-
-        assert sensor.resolve_state() == 57589
-        assert sensor.unit_of_measurement() == "s"
-        assert sensor.ha_device_class() is None
-
-    def test_str_time_seconds(self):
-        """Test resolve state with time_seconds sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="time_seconds"
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0xEC, 0x91, 0x7C))
-
-        assert sensor.resolve_state() == 7570.185546875
-        assert sensor.unit_of_measurement() == "s"
-        assert sensor.ha_device_class() is None
-
-    def test_str_torque(self):
-        """Test resolve state with torque sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="torque"
-        )
-        sensor.sensor_value.payload = DPTArray((0xC5, 0x9, 0x23, 0x5F))
-
-        assert sensor.resolve_state() == -2194.210693359375
-        assert sensor.unit_of_measurement() == "N m"
-        assert sensor.ha_device_class() is None
-
-    def test_str_voltage(self):
-        """Test resolve state with voltage sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="voltage"
-        )
-        sensor.sensor_value.payload = DPTArray((0x6D, 0xBF))
-
-        assert sensor.resolve_state() == 120504.32
-        assert sensor.unit_of_measurement() == "mV"
-        assert sensor.ha_device_class() is None
-
-    def test_str_volume(self):
-        """Test resolve state with volume sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="volume"
-        )
-        sensor.sensor_value.payload = DPTArray((0x46, 0x16, 0x98, 0x43))
-
-        assert sensor.resolve_state() == 9638.0654296875
-        assert sensor.unit_of_measurement() == "m³"
-        assert sensor.ha_device_class() is None
-
-    def test_str_volume_flow(self):
-        """Test resolve state with volume_flow sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="volume_flow"
-        )
-        sensor.sensor_value.payload = DPTArray((0x7C, 0xF5))
-
-        assert sensor.resolve_state() == 415825.92
-        assert sensor.unit_of_measurement() == "l/h"
-        assert sensor.ha_device_class() is None
-
-    def test_str_volume_flux(self):
-        """Test resolve state with volume_flux sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="volume_flux"
-        )
-        sensor.sensor_value.payload = DPTArray((0xC5, 0x4, 0x2D, 0x72))
-
-        assert sensor.resolve_state() == -2114.84033203125
-        assert sensor.unit_of_measurement() == "m³/s"
-        assert sensor.ha_device_class() is None
-
-    def test_str_weight(self):
-        """Test resolve state with weight sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="weight"
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0x20, 0x10, 0xE8))
-
-        assert sensor.resolve_state() == 2561.056640625
-        assert sensor.unit_of_measurement() == "N"
-        assert sensor.ha_device_class() is None
-
-    def test_str_work(self):
-        """Test resolve state with work sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="work"
-        )
-        sensor.sensor_value.payload = DPTArray((0x45, 0x64, 0x5D, 0xBE))
-
-        assert sensor.resolve_state() == 3653.85888671875
-        assert sensor.unit_of_measurement() == "J"
-        assert sensor.ha_device_class() is None
-
-    def test_str_wind_speed_ms(self):
-        """Test resolve state with wind_speed_ms sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="wind_speed_ms"
-        )
-        sensor.sensor_value.payload = DPTArray((0x7D, 0x98))
-
-        assert sensor.resolve_state() == 469237.76
-        assert sensor.unit_of_measurement() == "m/s"
-        assert sensor.ha_device_class() is None
-
-    def test_str_wind_speed_kmh(self):
-        """Test resolve state with wind_speed_kmh sensor."""
-        xknx = XKNX()
-        sensor = Sensor(
-            xknx, "TestSensor", group_address_state="1/2/3", value_type="wind_speed_kmh"
-        )
-        sensor.sensor_value.payload = DPTArray((0x68, 0x0))
-
-        assert sensor.resolve_state() == 0.0
-        assert sensor.unit_of_measurement() == "km/h"
-        assert sensor.ha_device_class() is None
-
     #
     # SYNC
     #
@@ -1836,7 +771,8 @@ class TestSensor:
             payload=GroupValueWrite(DPTArray((0x06, 0xA0))),
         )
         await sensor.process(telegram)
-        assert sensor.sensor_value.payload == DPTArray((0x06, 0xA0))
+        assert sensor.sensor_value.value == 16.96
+        assert sensor.sensor_value.telegram.payload.value == DPTArray((0x06, 0xA0))
         assert sensor.resolve_state() == 16.96
 
     async def test_process_callback(self):
@@ -1855,6 +791,7 @@ class TestSensor:
         )
         await sensor.process(telegram)
         after_update_callback.assert_called_with(sensor)
+        assert sensor.last_telegram == telegram
 
     def test_unique_id(self):
         """Test unique id functionality."""
diff --git a/test/devices_tests/weather_test.py b/test/devices_tests/weather_test.py
index a201aa6b..51f78fd7 100644
--- a/test/devices_tests/weather_test.py
+++ b/test/devices_tests/weather_test.py
@@ -1,28 +1,37 @@
 """Unit test for Weather objects."""
 import datetime
 
+import pytest
 from xknx import XKNX
 from xknx.devices import Weather
 from xknx.devices.weather import WeatherCondition
 from xknx.dpt import DPTArray, DPTBinary
-from xknx.telegram import GroupAddress
+from xknx.telegram import GroupAddress, Telegram
+from xknx.telegram.apci import GroupValueWrite
 
 
+@pytest.mark.asyncio
 class TestWeather:
     """Test class for Weather objects."""
 
-    def test_temperature(self):
+    async def test_temperature(self):
         """Test resolve state with temperature."""
         xknx = XKNX()
         weather = Weather(name="weather", xknx=xknx, group_address_temperature="1/3/4")
-        weather._temperature.payload = DPTArray((0x19, 0xA))
+
+        await weather.process(
+            Telegram(
+                destination_address=GroupAddress("1/3/4"),
+                payload=GroupValueWrite(value=DPTArray((0x19, 0xA))),
+            )
+        )
 
         assert weather.has_group_address(GroupAddress("1/3/4"))
         assert weather.temperature == 21.28
         assert weather._temperature.unit_of_measurement == "°C"
         assert weather._temperature.ha_device_class == "temperature"
 
-    def test_brightness(self):
+    async def test_brightness(self):
         """Test resolve state for brightness east, west and south."""
         xknx = XKNX()
         weather: Weather = Weather(
@@ -35,10 +44,33 @@ class TestWeather:
             group_address_temperature="1/4/4",
         )
 
-        weather._brightness_east.payload = DPTArray((0x7C, 0x5E))
-        weather._brightness_west.payload = DPTArray((0x7C, 0x5C))
-        weather._brightness_south.payload = DPTArray((0x7C, 0x5A))
-        weather._brightness_north.payload = DPTArray((0x7C, 0x5A))
+        await weather.process(
+            Telegram(
+                destination_address=GroupAddress("1/3/5"),
+                payload=GroupValueWrite(value=DPTArray((0x7C, 0x5E))),
+            )
+        )
+
+        await weather.process(
+            Telegram(
+                destination_address=GroupAddress("1/3/7"),
+                payload=GroupValueWrite(value=DPTArray((0x7C, 0x5C))),
+            )
+        )
+
+        await weather.process(
+            Telegram(
+                destination_address=GroupAddress("1/3/6"),
+                payload=GroupValueWrite(value=DPTArray((0x7C, 0x5A))),
+            )
+        )
+
+        await weather.process(
+            Telegram(
+                destination_address=GroupAddress("1/3/8"),
+                payload=GroupValueWrite(value=DPTArray((0x7C, 0x5A))),
+            )
+        )
 
         assert weather.brightness_east == 366346.24
         assert weather._brightness_east.unit_of_measurement == "lx"
@@ -56,47 +88,69 @@ class TestWeather:
         assert weather._brightness_north.unit_of_measurement == "lx"
         assert weather._brightness_north.ha_device_class == "illuminance"
 
-    def test_pressure(self):
+    async def test_pressure(self):
         """Test resolve state with pressure."""
         xknx = XKNX()
         weather = Weather(name="weather", xknx=xknx, group_address_air_pressure="1/3/4")
-        weather._air_pressure.payload = DPTArray((0x6C, 0xAD))
+
+        await weather.process(
+            Telegram(
+                destination_address=GroupAddress("1/3/4"),
+                payload=GroupValueWrite(value=DPTArray((0x6C, 0xAD))),
+            )
+        )
 
         assert weather.air_pressure == 98058.24
         assert weather._air_pressure.unit_of_measurement == "Pa"
         assert weather._air_pressure.ha_device_class == "pressure"
 
-    def test_humidity(self):
+    async def test_humidity(self):
         """Test humidity."""
         xknx = XKNX()
         weather = Weather(name="weather", xknx=xknx, group_address_humidity="1/2/4")
-        weather._humidity.payload = DPTArray((0x7E, 0xE1))
+
+        await weather.process(
+            Telegram(
+                destination_address=GroupAddress("1/2/4"),
+                payload=GroupValueWrite(value=DPTArray((0x7E, 0xE1))),
+            )
+        )
 
         assert weather.humidity == 577044.48
         assert weather._humidity.unit_of_measurement == "%"
         assert weather._humidity.ha_device_class == "humidity"
 
-    def test_wind_speed(self):
+    async def test_wind_speed(self):
         """Test wind speed received."""
         xknx = XKNX()
         weather: Weather = Weather(
-            name="weather", xknx=xknx, group_address_brightness_east="1/3/8"
+            name="weather", xknx=xknx, group_address_wind_speed="1/3/8"
         )
 
-        weather._wind_speed.payload = DPTArray((0x7D, 0x98))
+        await weather.process(
+            Telegram(
+                destination_address=GroupAddress("1/3/8"),
+                payload=GroupValueWrite(value=DPTArray((0x7D, 0x98))),
+            )
+        )
 
         assert weather.wind_speed == 469237.76
         assert weather._wind_speed.unit_of_measurement == "m/s"
         assert weather._wind_speed.ha_device_class is None
 
-    def test_wind_bearing(self):
+    async def test_wind_bearing(self):
         """Test wind bearing received."""
         xknx = XKNX()
         weather: Weather = Weather(
-            name="weather", xknx=xknx, group_address_brightness_east="1/3/8"
+            name="weather", xknx=xknx, group_address_wind_bearing="1/3/8"
         )
 
-        weather._wind_bearing.payload = DPTArray((0xBF,))
+        await weather.process(
+            Telegram(
+                destination_address=GroupAddress("1/3/8"),
+                payload=GroupValueWrite(value=DPTArray((0xBF,))),
+            )
+        )
 
         assert weather.wind_bearing == 270
         assert weather._wind_bearing.unit_of_measurement == "°"
@@ -112,8 +166,8 @@ class TestWeather:
             group_address_wind_alarm="1/3/9",
         )
 
-        weather._rain_alarm.payload = DPTBinary(1)
-        weather._wind_alarm.payload = DPTBinary(1)
+        weather._rain_alarm.value = DPTBinary(1)
+        weather._wind_alarm.value = DPTBinary(1)
 
         assert weather.ha_current_state() == WeatherCondition.LIGHTNING_RAINY
 
@@ -127,8 +181,8 @@ class TestWeather:
             group_address_frost_alarm="1/3/10",
         )
 
-        weather._rain_alarm.payload = DPTBinary(1)
-        weather._frost_alarm.payload = DPTBinary(1)
+        weather._rain_alarm.value = DPTBinary(1)
+        weather._frost_alarm.value = DPTBinary(1)
 
         assert weather.ha_current_state() == WeatherCondition.SNOWY_RAINY
 
@@ -143,7 +197,7 @@ class TestWeather:
             group_address_frost_alarm="1/3/10",
         )
 
-        weather._wind_alarm.payload = DPTBinary(1)
+        weather._wind_alarm.value = DPTBinary(1)
 
         assert weather.ha_current_state() == WeatherCondition.WINDY
 
@@ -158,11 +212,11 @@ class TestWeather:
             group_address_frost_alarm="1/3/10",
         )
 
-        weather._rain_alarm.payload = DPTBinary(1)
+        weather._rain_alarm.value = DPTBinary(1)
 
         assert weather.ha_current_state() == WeatherCondition.RAINY
 
-    def test_cloudy_summer(self):
+    async def test_cloudy_summer(self):
         """Test cloudy summer if illuminance matches defined interval."""
         xknx = XKNX()
         weather: Weather = Weather(
@@ -172,7 +226,12 @@ class TestWeather:
             group_address_brightness_south="1/3/6",
         )
 
-        weather._brightness_south.payload = DPTArray((0x46, 0x45))
+        await weather.process(
+            Telegram(
+                destination_address=GroupAddress("1/3/6"),
+                payload=GroupValueWrite(value=DPTArray((0x46, 0x45))),
+            )
+        )
 
         summer_date = datetime.datetime(2020, 10, 5, 18, 00)
 
@@ -181,7 +240,7 @@ class TestWeather:
             == WeatherCondition.CLOUDY
         )
 
-    def test_sunny_summer(self):
+    async def test_sunny_summer(self):
         """Test returns sunny condition if illuminance is in defined interval"""
         xknx = XKNX()
         weather: Weather = Weather(
@@ -192,7 +251,12 @@ class TestWeather:
             group_address_brightness_west="1/3/7",
         )
 
-        weather._brightness_south.payload = DPTArray((0x7C, 0x5C))
+        await weather.process(
+            Telegram(
+                destination_address=GroupAddress("1/3/6"),
+                payload=GroupValueWrite(value=DPTArray((0x7C, 0x5C))),
+            )
+        )
 
         summer_date = datetime.datetime(2020, 10, 5, 18, 00)
 
@@ -200,7 +264,7 @@ class TestWeather:
             weather.ha_current_state(current_date=summer_date) == WeatherCondition.SUNNY
         )
 
-    def test_sunny_winter(self):
+    async def test_sunny_winter(self):
         """Test sunny winter if illuminance matches defined interval."""
         xknx = XKNX()
         weather: Weather = Weather(
@@ -210,7 +274,12 @@ class TestWeather:
             group_address_brightness_west="1/3/7",
         )
 
-        weather._brightness_south.payload = DPTArray((0x7C, 0x5C))
+        await weather.process(
+            Telegram(
+                destination_address=GroupAddress("1/3/6"),
+                payload=GroupValueWrite(value=DPTArray((0x7C, 0x5C))),
+            )
+        )
 
         winter_date = datetime.datetime(2020, 12, 5, 18, 00)
 
@@ -218,7 +287,7 @@ class TestWeather:
             weather.ha_current_state(current_date=winter_date) == WeatherCondition.SUNNY
         )
 
-    def test_cloudy_winter(self):
+    async def test_cloudy_winter(self):
         """Test cloudy winter if illuminance matches defined interval."""
         xknx = XKNX()
         weather: Weather = Weather(
@@ -229,7 +298,12 @@ class TestWeather:
             group_address_brightness_west="1/3/7",
         )
 
-        weather._brightness_south.payload = DPTArray((0x46, 0x45))
+        await weather.process(
+            Telegram(
+                destination_address=GroupAddress("1/3/6"),
+                payload=GroupValueWrite(value=DPTArray((0x46, 0x45))),
+            )
+        )
 
         winter_date = datetime.datetime(2020, 12, 31, 18, 00)
 
@@ -238,14 +312,19 @@ class TestWeather:
             == WeatherCondition.CLOUDY
         )
 
-    def test_day_night(self):
+    async def test_day_night(self):
         """Test day night mapping."""
         xknx = XKNX()
         weather: Weather = Weather(
             name="weather", xknx=xknx, group_address_day_night="1/3/20"
         )
 
-        weather._day_night.payload = DPTBinary(0)
+        await weather.process(
+            Telegram(
+                destination_address=GroupAddress("1/3/20"),
+                payload=GroupValueWrite(value=DPTBinary(0)),
+            )
+        )
 
         assert weather.ha_current_state() == WeatherCondition.CLEAR_NIGHT
 
diff --git a/test/remote_value_tests/remote_value_switch_test.py b/test/remote_value_tests/remote_value_switch_test.py
index 826b227c..cedfe9ff 100644
--- a/test/remote_value_tests/remote_value_switch_test.py
+++ b/test/remote_value_tests/remote_value_switch_test.py
@@ -76,7 +76,7 @@ class TestRemoteValueSwitch:
         )
         assert remote_value.value is None
         await remote_value.process(telegram)
-        assert remote_value.payload is not None
+        assert remote_value.telegram is not None
         assert remote_value.value is True
 
     async def test_process_off(self):
@@ -89,7 +89,7 @@ class TestRemoteValueSwitch:
         )
         assert remote_value.value is None
         await remote_value.process(telegram)
-        assert remote_value.payload is not None
+        assert remote_value.telegram is not None
         assert remote_value.value is False
 
     async def test_to_process_error(self):
diff --git a/test/remote_value_tests/remote_value_test.py b/test/remote_value_tests/remote_value_test.py
index 755601e0..948870e1 100644
--- a/test/remote_value_tests/remote_value_test.py
+++ b/test/remote_value_tests/remote_value_test.py
@@ -100,6 +100,7 @@ class TestRemoteValue:
 
             await remote_value.read_state(wait_for_result=True)
 
+            assert remote_value.telegram == telegram
             assert remote_value.value
 
     async def test_read_state_none(self):
@@ -176,7 +177,7 @@ class TestRemoteValue:
                 payload=GroupValueWrite(test_payload),
             )
             assert await remote_value.process(telegram)
-            assert remote_value.payload == test_payload
+            assert remote_value.telegram.payload.value == test_payload
 
     def test_eq(self):
         """Test __eq__ operator."""
diff --git a/test/str_test.py b/test/str_test.py
index 81f86986..36981cb4 100644
--- a/test/str_test.py
+++ b/test/str_test.py
@@ -75,11 +75,11 @@ class TestStringRepresentations:
             == '<RemoteValue device_name="MyDevice" feature_name="Unknown" GroupAddress("1/2/3")/GroupAddress("1/2/4")/None/None/>'
         )
 
-        remote_value.payload = DPTArray([0x01, 0x02])
+        remote_value.value = 34
         assert (
             str(remote_value)
             == '<RemoteValue device_name="MyDevice" feature_name="Unknown" '
-            'GroupAddress("1/2/3")/GroupAddress("1/2/4")/<DPTArray value="[0x1,0x2]" />/None/>'
+            'GroupAddress("1/2/3")/GroupAddress("1/2/4")/34/None/>'
         )
 
     def test_binary_sensor(self):
@@ -246,9 +246,9 @@ class TestStringRepresentations:
         assert (
             str(notification) == '<Notification name="Alarm" '
             'message="GroupAddress("1/2/3")/'
-            'GroupAddress("1/2/4")/'
-            '<DPTArray value="[0x45,0x69,0x6e,0x62,0x72,0x65,0x63,0x68,0x65,0x72,0x20,0x69,0x6d,0x20]" />/'
-            'Einbrecher im " />'
+            'GroupAddress("1/2/4")/Einbrecher im /'
+            '<DPTArray value="[0x45,0x69,0x6e,0x62,0x72,0x65,0x63,0x68,0x65,0x72,0x20,0x69,0x6d,0x20]" />'
+            '" />'
         )
 
     def test_scene(self):
@@ -279,7 +279,7 @@ class TestStringRepresentations:
         await sensor.process_group_write(telegram)
         assert (
             str(sensor)
-            == '<Sensor name="MeinSensor" sensor="None/GroupAddress("1/2/3")/<DPTArray value="[0x40]" />/25" value="25" unit="%"/>'
+            == '<Sensor name="MeinSensor" sensor="None/GroupAddress("1/2/3")/25/<DPTArray value="[0x40]" />" value="25" unit="%"/>'
         )
 
     async def test_expose_sensor(self):
@@ -296,7 +296,7 @@ class TestStringRepresentations:
         await sensor.process(xknx.telegrams.get_nowait())
         assert (
             str(sensor)
-            == '<ExposeSensor name="MeinSensor" sensor="GroupAddress("1/2/3")/None/<DPTArray value="[0x40]" />/25" value="25" unit="%"/>'
+            == '<ExposeSensor name="MeinSensor" sensor="GroupAddress("1/2/3")/None/25/<DPTArray value="[0x40]" />" value="25" unit="%"/>'
         )
 
     def test_switch(self):
@@ -356,7 +356,7 @@ class TestStringRepresentations:
             'brightness_west="None/GroupAddress("7/0/3")/None/None" '
             'brightness_east="None/GroupAddress("7/0/4")/None/None" wind_speed="None/GroupAddress("7/0/2")/None/None" '
             'wind_bearing="None/GroupAddress("7/0/6")/None/None" rain_alarm="None/GroupAddress("7/0/0")/None/None" '
-            'wind_alarm="None/GroupAddress("7/0/10")/<DPTBinary value="1" />/True" '
+            'wind_alarm="None/GroupAddress("7/0/10")/True/<DPTBinary value="1" />" '
             'frost_alarm="None/GroupAddress("7/0/8")/None/None" day_night="None/GroupAddress("7/0/7")/None/None" '
             'air_pressure="None/GroupAddress("7/0/9")/None/None" humidity="None/GroupAddress("7/0/9")/None/None" />'
         )