-
Notifications
You must be signed in to change notification settings - Fork 737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Device Support Request] TUYA DIN ENERGY METERING #1973
Comments
There are already 2 implementations for Tuya DIN metering devices. There is a good guide to create your local quirk: Just copy inside your local quirk folder the current Edit the content adding your device signature at the class HikingPowerMeter(TuyaSwitch):
"""Hiking Power Meter Device - DDS238-2."""
signature = {
# "node_descriptor": "<NodeDescriptor byte1=1 byte2=64 mac_capability_flags=142 manufacturer_code=4098
# maximum_buffer_size=82 maximum_incoming_transfer_size=82 server_mask=11264
# maximum_outgoing_transfer_size=82 descriptor_capability_field=0>",
# device_version=1
# input_clusters=[0x0000, 0x0004, 0x0005, 0xef00]
# output_clusters=[0x000a, 0x0019]
MODELS_INFO: [
("_TZE200_bkkmqmyo", "TS0601"),
("_TZE204_cjbofhxw", "TS0601"),
],
ENDPOINTS: { Save changes, restart HA and repair the device. |
We can remove the switch, this part is the easy one. To do that, will be necessary to activate the logs for the integration and collect the relevant information. Instructions here: You will get multiple reports from your device, NMK: Every report will be a meassurement and you have to analize it to map against the correct one. In example, the current voltage will be a value around 220/240 |
Hi debug activated, but I am not sur how to understand the log file:
|
The device is calling some custom command Is any entity updating values? |
no |
I have cancel the quirk to see if I have some other info
How can I use this information to customize my quirk |
How can I interpret the log? |
|
Hi I have some programming skills, but this is too difficult for me to figure out, can someone help with this? |
@javicalle Look in the link in the post before its very interesting and the "found" is implanted and tested by the same user as was doing the same with our "tuya magic" casting for Hubitat and Z2M and ZHA (deCONZ not) have implanting it from his work. Thanks for digging and implanting your findings in Hubitat so other open system can using it @kkossev (our tuya magician) !!! |
From https://developer.tuya.com/en/docs/iot/tuya-zigbee-module-uart-communication-protocol?id=K9ear5khsqoty#title-32-MCU%20requests%20gateway%20connection%20status%20(0x25). |
Ok, let's try it... That's my (quick & dirty) proposal:
.../...
HIKING_POWER_FACTOR_ATTR: ("power_factor", t.uint16_t, True),
}
class TuyaTsn(t.Struct):
"""Tuya request data."""
status: t.uint8_t
tsn: t.uint8_t
client_commands = TuyaManufClusterAttributes.client_commands.copy()
client_commands.update(
{
0x25: foundation.ZCLCommandDef(
"mcu_connection_status",
{"data": TuyaTsn},
True,
is_manufacturer_specific=True,
),
}
)
def handle_mcu_connection_status(self, payload: TuyaTsn) -> foundation.Status:
"""Handle gateway connection status requests (0x25)."""
payload_rsp = 0x01 # 0x00 not connected to internet | 0x01 connected to internet | 0x02 time out
self.create_catching_task(
super().command(0x25, payload_rsp, expect_reply=False)
)
return foundation.Status.SUCCESS
def _update_attribute(self, attrid, value):
super()._update_attribute(attrid, value)
.../...
import zigpy.types as t
from zigpy.zcl import foundation
from zigpy.zcl.clusters.general import Basic, Groups, Ota, Scenes, Time Save changes, restart HA and repair the device. There is some instructions: If something isn't working, enable the debug logs and attach the relevant info. |
Hi, Now I get I copied the most relevant lines from the debug log and pasted them below.
|
I have updated the code in my comment adding a new class and updating its use in the commands update and method definition. Please, be sure to put your logs like this:
|
The warnings are gone now, but the device is still only sending the x25 messages.
|
Have you updated also this part? def handle_mcu_connection_status(self, payload: TuyaTsn) -> foundation.Status: |
Just double checked, but that looks ok. I also see a timeout error during initialisation, but this is for the 0x0006 cluster, so I don't think that is relevant for now.
|
Not sure if related but it lacks an break like before the |
Hi, @javicalle have you been able to take a look? The only thing I see, is that in this comand the |
ok, I think I got the handle working, based on the logs below. from zhaquirks.tuya import TuyaManufClusterAttributes, TuyaOnOff, TuyaSwitch, TuyaNewManufCluster
class HikingManufClusterDinPower(TuyaManufClusterAttributes, TuyaNewManufCluster):
client_commands = TuyaNewManufCluster.client_commands.copy()
|
The payload for the 0x25 command answer should be 3 bytes - the previously received serial number (2 bytes) plus 0x01. See the sniffed communication to Tuya gateway. So either the Tuya documentation or the MatSee Plus implementation for this device may be wrong, However, even with the correct answer to 0x25 command, the device will still continue to query the ZIgbee coordinator every 5 seconds. |
Thank you for the info. I'm way over my head here, so below logic could be totatly wrong. The data received from the device is stored via the For now this is my code, but I'm quite sure the class TuyaTsn(t.Struct):
"""Tuya request data."""
status: t.uint8_t
tsn: t.uint8_t
client_commands = TuyaNewManufCluster.client_commands.copy()
client_commands.update(
{
0x25: foundation.ZCLCommandDef(
"mcu_thisisatest",
{"data": TuyaTsn},
True,
is_manufacturer_specific=True,
),
}
)
def handle_mcu_thisisatest(self, payload: TuyaTsn) -> foundation.Status:
"""Handle gateway connection status requests (0x25)."""
payload_rsp: t.uint32_t
payload_rsp = payload.status, payload.tsn, 0x01 # 0x00 not connected to internet | 0x01 connected to internet | 0x02 time out
self.debug("handle_mcu_thisisatest response: %s", payload_rsp)
self.create_catching_task(
super().command(0x25, payload_rsp, expect_reply=False)
)
return foundation.Status.SUCCESS
|
Sorry for the late response.
No, that is not correct. The
Repeating from time to time is not a problem. The problem is if there are retries (with the same In any case, the response message (
That's interesting... Putting all together that would be: ts0601_din_power.py"""Tuya Din Power Meter."""
from zigpy.profiles import zha
import zigpy.types as t
from zigpy.zcl import foundation
from zigpy.zcl.clusters.general import Basic, Groups, Ota, Scenes, Time
from zigpy.zcl.clusters.homeautomation import ElectricalMeasurement
from zigpy.zcl.clusters.smartenergy import Metering
from zhaquirks import Bus, LocalDataCluster
from zhaquirks.const import (
DEVICE_TYPE,
ENDPOINTS,
INPUT_CLUSTERS,
MODELS_INFO,
OUTPUT_CLUSTERS,
PROFILE_ID,
)
from zhaquirks.tuya import TuyaManufClusterAttributes, TuyaOnOff, TuyaSwitch
TUYA_TOTAL_ENERGY_ATTR = 0x0211
TUYA_CURRENT_ATTR = 0x0212
TUYA_POWER_ATTR = 0x0213
TUYA_VOLTAGE_ATTR = 0x0214
TUYA_DIN_SWITCH_ATTR = 0x0101
SWITCH_EVENT = "switch_event"
"""Hiking Power Meter Attributes"""
HIKING_DIN_SWITCH_ATTR = 0x0110
HIKING_TOTAL_ENERGY_DELIVERED_ATTR = 0x0201
HIKING_TOTAL_ENERGY_RECEIVED_ATTR = 0x0266
HIKING_VOLTAGE_CURRENT_ATTR = 0x0006
HIKING_POWER_ATTR = 0x0267
HIKING_FREQUENCY_ATTR = 0x0269
HIKING_POWER_FACTOR_ATTR = 0x026F
HIKING_TOTAL_REACTIVE_ATTR = 0x026D
HIKING_REACTIVE_POWER_ATTR = 0x026E
class TuyaManufClusterDinPower(TuyaManufClusterAttributes):
"""Manufacturer Specific Cluster of the Tuya Power Meter device."""
attributes = {
TUYA_TOTAL_ENERGY_ATTR: ("energy", t.uint16_t, True),
TUYA_CURRENT_ATTR: ("current", t.int16s, True),
TUYA_POWER_ATTR: ("power", t.uint16_t, True),
TUYA_VOLTAGE_ATTR: ("voltage", t.uint16_t, True),
TUYA_DIN_SWITCH_ATTR: ("switch", t.uint8_t, True),
}
def _update_attribute(self, attrid, value):
super()._update_attribute(attrid, value)
if attrid == TUYA_TOTAL_ENERGY_ATTR:
self.endpoint.smartenergy_metering.energy_deliver_reported(value / 100)
elif attrid == TUYA_CURRENT_ATTR:
self.endpoint.electrical_measurement.current_reported(value)
elif attrid == TUYA_POWER_ATTR:
self.endpoint.electrical_measurement.power_reported(value / 10)
elif attrid == TUYA_VOLTAGE_ATTR:
self.endpoint.electrical_measurement.voltage_reported(value / 10)
elif attrid == TUYA_DIN_SWITCH_ATTR:
self.endpoint.device.switch_bus.listener_event(
SWITCH_EVENT, self.endpoint.endpoint_id, value
)
class TuyaPowerMeasurement(LocalDataCluster, ElectricalMeasurement):
"""Custom class for power, voltage and current measurement."""
cluster_id = ElectricalMeasurement.cluster_id
POWER_ID = 0x050B
VOLTAGE_ID = 0x0505
CURRENT_ID = 0x0508
REACTIVE_POWER_ID = 0x050E
AC_FREQUENCY_ID = 0x0300
TOTAL_REACTIVE_POWER_ID = 0x0305
POWER_FACTOR_ID = 0x0510
AC_CURRENT_MULTIPLIER = 0x0602
AC_CURRENT_DIVISOR = 0x0603
AC_FREQUENCY_MULTIPLIER = 0x0400
AC_FREQUENCY_DIVISOR = 0x0401
_CONSTANT_ATTRIBUTES = {
AC_CURRENT_MULTIPLIER: 1,
AC_CURRENT_DIVISOR: 1000,
AC_FREQUENCY_MULTIPLIER: 1,
AC_FREQUENCY_DIVISOR: 100,
}
def voltage_reported(self, value):
"""Voltage reported."""
self._update_attribute(self.VOLTAGE_ID, value)
def power_reported(self, value):
"""Power reported."""
self._update_attribute(self.POWER_ID, value)
def power_factor_reported(self, value):
"""Power Factor reported."""
self._update_attribute(self.POWER_FACTOR_ID, value)
def reactive_power_reported(self, value):
"""Reactive Power reported."""
self._update_attribute(self.REACTIVE_POWER_ID, value)
def current_reported(self, value):
"""Ampers reported."""
self._update_attribute(self.CURRENT_ID, value)
def frequency_reported(self, value):
"""AC Frequency reported."""
self._update_attribute(self.AC_FREQUENCY_ID, value)
def reactive_energy_reported(self, value):
"""Summation Reactive Energy reported."""
self._update_attribute(self.TOTAL_REACTIVE_POWER_ID, value)
class TuyaElectricalMeasurement(LocalDataCluster, Metering):
"""Custom class for total energy measurement."""
cluster_id = Metering.cluster_id
CURRENT_DELIVERED_ID = 0x0000
CURRENT_RECEIVED_ID = 0x0001
POWER_WATT = 0x0000
"""Setting unit of measurement."""
_CONSTANT_ATTRIBUTES = {0x0300: POWER_WATT}
def energy_deliver_reported(self, value):
"""Summation Energy Deliver reported."""
self._update_attribute(self.CURRENT_DELIVERED_ID, value)
def energy_receive_reported(self, value):
"""Summation Energy Receive reported."""
self._update_attribute(self.CURRENT_RECEIVED_ID, value)
class HikingManufClusterDinPower(TuyaManufClusterAttributes):
"""Manufacturer Specific Cluster of the Hiking Power Meter device."""
attributes = {
HIKING_DIN_SWITCH_ATTR: ("switch", t.uint8_t, True),
HIKING_TOTAL_ENERGY_DELIVERED_ATTR: ("energy_delivered", t.uint16_t, True),
HIKING_TOTAL_ENERGY_RECEIVED_ATTR: ("energy_received", t.uint16_t, True),
HIKING_VOLTAGE_CURRENT_ATTR: ("voltage_current", t.uint32_t, True),
HIKING_POWER_ATTR: ("power", t.uint16_t, True),
HIKING_FREQUENCY_ATTR: ("frequency", t.uint16_t, True),
HIKING_TOTAL_REACTIVE_ATTR: ("total_reactive_energy", t.int32s, True),
HIKING_REACTIVE_POWER_ATTR: ("reactive_power", t.int16s, True),
HIKING_POWER_FACTOR_ATTR: ("power_factor", t.uint16_t, True),
}
class TuyaConnectionStatus(t.Struct):
"""Tuya request data."""
data_1: t.uint8_t
data_2: t.uint8_t
client_commands = TuyaManufClusterAttributes.client_commands.copy()
client_commands.update(
{
0x25: foundation.ZCLCommandDef(
"mcu_connection_status",
{"payload": TuyaConnectionStatus},
True,
is_manufacturer_specific=True,
),
}
)
class TuyaConnectionStatusRsp(t.Struct):
"""Tuya request data."""
data_1: t.uint8_t
data_2: t.uint8_t
data_3: t.uint8_t
server_commands = TuyaManufClusterAttributes.server_commands.copy()
server_commands.update(
{
0x25: foundation.ZCLCommandDef(
"mcu_connection_status_rsp",
{"payload": TuyaConnectionStatusRsp},
False,
is_manufacturer_specific=True,
),
}
)
def handle_mcu_connection_status(self, payload: TuyaConnectionStatus) -> foundation.Status:
"""Handle gateway connection status requests (0x25)."""
payload_rsp = TuyaConnectionStatusRsp()
payload_rsp.data_1 = payload.data_1
payload_rsp.data_2 = payload.data_2 # If this is data length would be 0x01
payload_rsp.data_3 = 0x01 # 0x00 not connected to internet | 0x01 connected to internet | 0x02 time out
self.create_catching_task(
super().command(0x25, payload_rsp, expect_reply=False)
)
return foundation.Status.SUCCESS
def _update_attribute(self, attrid, value):
super()._update_attribute(attrid, value)
if attrid == HIKING_DIN_SWITCH_ATTR:
self.endpoint.device.switch_bus.listener_event(SWITCH_EVENT, 16, value)
elif attrid == HIKING_TOTAL_ENERGY_DELIVERED_ATTR:
self.endpoint.smartenergy_metering.energy_deliver_reported(value / 100)
elif attrid == HIKING_TOTAL_ENERGY_RECEIVED_ATTR:
self.endpoint.smartenergy_metering.energy_receive_reported(value / 100)
elif attrid == HIKING_VOLTAGE_CURRENT_ATTR:
self.endpoint.electrical_measurement.current_reported(value >> 16)
self.endpoint.electrical_measurement.voltage_reported(
(value & 0x0000FFFF) / 10
)
elif attrid == HIKING_POWER_ATTR:
self.endpoint.electrical_measurement.power_reported(value)
elif attrid == HIKING_FREQUENCY_ATTR:
self.endpoint.electrical_measurement.frequency_reported(value)
elif attrid == HIKING_TOTAL_REACTIVE_ATTR:
self.endpoint.electrical_measurement.reactive_energy_reported(value)
elif attrid == HIKING_REACTIVE_POWER_ATTR:
self.endpoint.electrical_measurement.reactive_power_reported(value)
elif attrid == HIKING_POWER_FACTOR_ATTR:
self.endpoint.electrical_measurement.power_factor_reported(value / 10)
class TuyaPowerMeter(TuyaSwitch):
"""Tuya power meter device."""
def __init__(self, *args, **kwargs):
"""Init device."""
self.switch_bus = Bus()
super().__init__(*args, **kwargs)
signature = {
# "node_descriptor": "<NodeDescriptor byte1=1 byte2=64 mac_capability_flags=142 manufacturer_code=4098
# maximum_buffer_size=82 maximum_incoming_transfer_size=82 server_mask=11264
# maximum_outgoing_transfer_size=82 descriptor_capability_field=0>",
# device_version=1
# input_clusters=[0x0000, 0x0004, 0x0005, 0xef00]
# output_clusters=[0x000a, 0x0019]
MODELS_INFO: [
("_TZE200_byzdayie", "TS0601"),
("_TZE200_ewxhg6o9", "TS0601"),
],
ENDPOINTS: {
# <SimpleDescriptor endpoint=1 profile=260 device_type=51
# device_version=1
# input_clusters=[0, 4, 5, 61184]
# output_clusters=[10, 25]>
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
INPUT_CLUSTERS: [
Basic.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
TuyaManufClusterAttributes.cluster_id,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
}
},
}
replacement = {
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
INPUT_CLUSTERS: [
Basic.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
TuyaManufClusterDinPower,
TuyaPowerMeasurement,
TuyaElectricalMeasurement,
TuyaOnOff,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
}
}
}
class HikingPowerMeter(TuyaSwitch):
"""Hiking Power Meter Device - DDS238-2."""
signature = {
# "node_descriptor": "<NodeDescriptor byte1=1 byte2=64 mac_capability_flags=142 manufacturer_code=4098
# maximum_buffer_size=82 maximum_incoming_transfer_size=82 server_mask=11264
# maximum_outgoing_transfer_size=82 descriptor_capability_field=0>",
# device_version=1
# input_clusters=[0x0000, 0x0004, 0x0005, 0xef00]
# output_clusters=[0x000a, 0x0019]
MODELS_INFO: [
("_TZE200_bkkmqmyo", "TS0601"),
("_TZE204_cjbofhxw", "TS0601"),
],
ENDPOINTS: {
# <SimpleDescriptor endpoint=1 profile=260 device_type=51
# device_version=1
# input_clusters=[0, 4, 5, 61184]
# output_clusters=[10, 25]>
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
INPUT_CLUSTERS: [
Basic.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
TuyaManufClusterAttributes.cluster_id,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
}
},
}
replacement = {
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
INPUT_CLUSTERS: [
Basic.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
HikingManufClusterDinPower,
TuyaElectricalMeasurement,
TuyaPowerMeasurement,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
},
16: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
INPUT_CLUSTERS: [
TuyaOnOff,
],
OUTPUT_CLUSTERS: [],
},
}
} PS: you can color your code with:
|
This value change over time? Or is exactly |
The message is repeated five times, then there is a timeout of 5 seconds, and then the TSN number goes up with one decimal, and the status number goes up with two decimals. With the code above the
|
If one unicats is not being acked the sender is sending it with the same TSN after some hundred millS. Default response from quirk is implanted in tuya INIT must only using the right device class for using it. |
Thanks for testing. Can you try replacing the copy() parr like this? client_commands = TuyaManufCluster.client_commands.copy() server_commands = TuyaManufCluster.server_commands.copy() |
at the end i decide to bight the bullet and change from zha to mqtt. |
@ricardasr25 How did you configure the helper exactly? Specifically, the method for the integration. Thanks in advance! |
@javicalle Can you have one more look at why the energy values are not being read from the _TZE204_cjbofhxw device using the quirk file you created? According to the information from the device's supplier (listed in the opening post) the device should be able to provide kWh values too. I know it should be possible to create a riemann-sum helper to collect (almost) the same data from the voltage and watt values, however that is more cumbersome to all users of the device (I have not yet been able to get it to work), plus it is not as accurate as when the device itself collects it: for example usage during down time of HA will not be included if we have to use the riemann-sum helper method. Furthermore, I tried creating a PR to get the quirk you created into the official quirks list. But when i tried to merge this version with the existing zhaquirks\tuya\ts0601_din_power.py in the zha-device-handlers project, I found that my merge would remove other models quirk definitions. I do not have sufficient knowledge to properly merge the new file with the existing one without breaking those other model's quirks. Can you please merge the quirk code as posted by cryptocelt on January 18th into the existing ts0601_din_power.py so that it doesn't break the existing devices? I can confirm that said custom quirk file results in my "TS0601 by _TZE204_cjbofhxw" devices getting a working RMS current, RMS Voltage and power entity added: |
Maybe important information for new / not heavily electronically enrolled: users: The clamp has to by placed only around ONE wire (L conductor, usualy brown or red) and NOT around the whole cable with both L and N conductors. The ZHA quirk for the TZE204_cjbofhxw clamp meter did NOT work https://raw.githubusercontent.com/zigpy/zha-device-handlers/dev/zhaquirks/tuya/ts0601_din_power.py but the file ts0601_din_power.py from https://github.com/zigpy/zha-device-handlers/files/11401270/ts0601_din_power.zip provided by setterlee WORKS fine: just extract the archive and copy s0601_din_power.py to /config/custom_zha_quirks/
then restart homeassistant |
Hi good I have the model of amperometric pinsa ts0601 but it is not from din bar the question is the following is it ok anyway or not ? I'll put the image below to make you understand the precise model and I wanted to add that I use z2mqtt and not zha and I wanted to know if the guide was the same or different because as far as I could read all of them used year zha image link;https://prnt.sc/A3nWIIBl55UT |
I have the same device (TZE204_cjbofhxw) and have had some success with the second link posted by panticz. I am getting data, but the numbers are a little off clearly 2 amps @ 240v is 480w I do have a smart meter with the overly fancy in home display, which is super slow reporting, but things were stable and that had da different wattage value Im happy to ignore the wattage value from the sensor and calculate my own, but is there any tweakable values in the quirk file so i can get the current value closer? |
Can somebody please help. This is with a load on the clamp so it should see the entities. I've tried the various versions and just get the same.
DEBUG shows:
Anything else I can provide to help diagnose what's wrong here? |
@andyb2000 apparently newer versions of Home Assistant require also the
|
Thanks @panticz yes I have that (other quirks load and work, so they're loading). Unfortunately I've given up with this device as it just won't work for me. |
Aims to address device support requests: 2 bidirectional clamps: zigpy#2549 (_TZE204_81yrt3lo) zigpy#2650 (_TZE200_rks0sgb7) 1 bidirectional clamp: zigpy#2420 (_TZE204_ac0fhfiq) 1 clamp: zigpy#1973 (_TZE204_cjbofhxw) @jmuf I've just spotted that in parallel you've also been working on zigpy#2870 for _TZE200_rks0sgb7, shall we pool ideas?
I’ve been able to add the merger using the ts0601_energy_meter quirk. Never the less I had to change the quirk because there was a mismatch in cluster 242, that was not allowing the quirk to be loaded. |
Thanks for testing @cobirnm, please can you post a copy of your device signature? Secondly, Is the summation delivered sensor present after a ZHA restart? |
Please find the signature bellow. And yes I got the summarization after a restart. It was the first time I had to do a restart to get a sensor!
|
Thanks @cobirnm, looking at that I believe the latest version of the quirk in the PR already removed the ZGP (242) cluster for the _TZE204_cjbofhxw device, possible to recheck if that version now works for you without changes? Yes it's odd they don't always show up when the device is first added. One option could be that on first load I fill the supported attributes with 0s but that feels a bit hacky. |
I had similar problems when adding this sensor, and everything was solved using this quirk and putting a high load on the clamp before adding the device to HA (1 kW or so). Also, I found somewhere that after removing a ZHA device, there is some kind of persistence of it, so you need to restart HA (maybe reloading only the ZHA integration also works) to remove the configuration of the device before applying a new/updated quirk. Hope that helps. |
You are right. if the load is below 0.2A, then it will only shown the voltage reading. |
@javicalle: Can you please merge your version of ts601_din_power.py as posted in this thread on March 2nd, 2023 by cryptocelt into the one that was created by TheJulianJES which is now the default one that gets installed with ZHA: zha-device-handler. I have tried but am unable to do so myself.
but removes the devices added by @TheJulianJES :
So without this merge we can now get either of these devices working but never both in the same setup. There is a lot of confusion already over the support of these devices. If you could do a merge of the two versions and get that into the zha-device-handlers that would really help a lot of people. |
For anyone reading this in search of getting their _TZE204_cjbofhxw or _TZE204_ac0fhfiq working:
Using Javicalle's quirk file you will get working sensors for:
Also some non-working sensors will show up, these will always have a value of 'unavailable':
Most people will never need the first 3 of these unavailable sensors. The Instantaneous demand (kWh) however is one that many people want for their Energy Dashboard. Luckily the energy used can -with the loss of some accuracy- also be determined from the sensors that we do have available using a Riemann sum integral.
You should now have a kWh sensor added to your device. You can disable the unavailable sensors from your device to hide them from view. |
Hi, what do I need to do if my device is : _TZE204_81yrt3lo edit : ok this helped > #2549 |
Hey, thanks for your detailed explanation! |
Try this :
You should see all the sensors on the right as well :) I hope this helps |
Thanks you for the explanation and images! I did everything exactly as explained... with just one minor difference... my quirk file had missing the ".py" extension x( |
The one by javicalle doesn't contain "81yrt3lo" so I'm guessing it doesn't have the right content for our device |
Thank you, i have another question, how can i add Decimal, BC the Voltage and Watt is only 220V but i need 220.32V |
Is your feature request related to a problem? Please describe.
I can pair this tuya consumption energy metering device but i have no sensor
Describe the solution you'd like
i want to be able to see the consumption metering
Device signature
Diagnostic information
Additional logs
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: