deconz-rest-plugin icon indicating copy to clipboard operation
deconz-rest-plugin copied to clipboard

Temporary solution for _TZ3000_qeuvnohg

Open labor4 opened this issue 7 months ago • 16 comments

This PR aims to override the PR at https://github.com/dresden-elektronik/deconz-rest-plugin/pull/7012, to make these MAINS device(s) available, but also to mitigate the danger inherent to the MAINS type in that PR.

This is a temporary solution until Mains switches are handled better in Phoscon GUI.

Note that in above discussion it was argued, that security is the job for the API client. Since Phoscon GUI does not yet handle mains specifically, I suggest to merge this PR in the meantime, having:

  • no lights:state/on property (disable switch)
  • "type": "$TYPE_SMART_PLUG", because it currently fits better with the Phoscon GUI.

The remarks by @BabaIsYou for the similar devices ("_TZ3000_ky0fq4ho","_TZ3000_8bxrzyxz") are in this PR too, though untested by myself.

Please DEVs, review/change the timings to your likings. Thanks.

If this gets merged, then https://github.com/dresden-elektronik/deconz-rest-plugin/pull/7012 is not valid anymore.

cheers

Tongou_TO-Q-SY1-JZT

labor4 avatar Apr 17 '25 15:04 labor4

Hello @labor4 , the formatting was not correct, the duplicate uuid was removed and the intervals were optimized a bit.

_TZ3000_qeuvnohg_fuse_w_power_meter.json

mattreim avatar Apr 18 '25 00:04 mattreim

@mattreim Thanks a lot

labor4 avatar Apr 18 '25 12:04 labor4

Hey @labor4, thanks for your pull request!

[!TIP] Modified bundles can be downloaded here. Relative expire date

DDB changes

Modified

  • tuya/_TZ3000_qeuvnohg_fuse_w_power_meter.json : TO-Q-SY1-JZT Mains/DIN Rail power switch/meter, Note the omitted /lights section :heavy_check_mark:

Validation

[!TIP] Everything is fine !

:clock1230: Updated for commit 2ae01bea4f5533e678474c28c15fae6179e75279

github-actions[bot] avatar Apr 18 '25 15:04 github-actions[bot]

			{
					"name": "attr/swversion",
					"parse": {
						"fn": "zcl",

is now

			{
					"name": "attr/swversion",
					"parse": {
						"fn": "zcl:attr"

and other ....

Smanar avatar Apr 18 '25 15:04 Smanar

@labor4 , replace all "fn": "zcl" by "fn": "zcl:attr"

_TZ3000_qeuvnohg_fuse_w_power_meter.json

mattreim avatar Apr 18 '25 18:04 mattreim

  • is "description" not a valid attribute? any other field for a note/future review?
  • I think it's cross-checking against a lights definition and misses "state/on". Any other way to keep this disabled for the moment, without deleting the whole "lights" section?

I can check and see what happens in Phoscon GUI if the "lights/TYPE_SMART_PLUG" section is missing. It's probably going to sort it into "sensors". Frankly I wouldn't care, since I consider this device's lights-feature a bug to begin with. I think this device should be a meter and nothing more, but this PR is intended as a heads-up for the GUI to reflect Mains, so incomplete as-intended.

What is your preference?

Shall we convert this switch into a sensor-only? What's elegant for future discussion?

I now put the note into the product field to pass validation. Maybe that would be the minimum way to communicate, that not all capabilities are honoured?

labor4 avatar Apr 18 '25 19:04 labor4

is "description" not a valid attribute? any other field for a note/future review?

Not at this place, and no other fields for me, but don't worry for this.

If this device don't have state/on why do you want to create a "light" entry ? Just remove the "light" part.

Smanar avatar Apr 19 '25 11:04 Smanar

@Smanar I‘ll take your „why“ question as an answer. I‘ll put a note into the product field, and anyone who wants to implement this properly downstream can do so.

Going to make some tests the next days.

cheers

labor4 avatar Apr 19 '25 12:04 labor4

Yeah don't worry for that, some router (making only routing) have a DDF to force them visible in the API, but your device will be visible in "sensors" part, so no problem for me, can be removed.

Smanar avatar Apr 19 '25 12:04 Smanar

Phoscon GUI cannot handle these sensors if they are not part of a SMARTPLUG. I give up.

The latest commit features sensors-only. Hopefully somebody at Phoscon GUI will have mercy and sort this out.

Thanks.

labor4 avatar Apr 19 '25 16:04 labor4

Ha yes, it's a problem for phoscon, but not third app. You are using phoscon only ? You can have the value directly on the API using Phoscon/help/API Information/sensors, but not friendly.

Smanar avatar Apr 19 '25 17:04 Smanar

Yeah I guess I could get it from the API, but this is a simple setup with no other integration/automation. I let it be for the moment.

If you can send Phoscon a note with some interest in this, much obliged from my side.

I don't know where they reside these days. Their repo seems abandonned.

labor4 avatar Apr 19 '25 18:04 labor4

I m trying on the forum https://forum.phoscon.de/t/support-for-power-measurement-sensor/6296

But to be sure, you have checked on "sensor" page on Phoscon ? not "light".

Edit: After a check, it's same for me, I have a custom device (exotic stuff) it appear as light, but the consumption don't appear too. I think, for phoscon the device can appear on "light" or "sensor" but not both

Smanar avatar Apr 20 '25 07:04 Smanar

thanks!

for the record:

my check showed, that the sensor page would show only the temperature measurement, but not power consumption (yes surprise this thing has a thermal sensor too😂).

the smartplug page shows light and power consumption, but not temperature.

anyways thanks for your effort

labor4 avatar Apr 20 '25 09:04 labor4

Yeah I think it will be a problem, because Phoscon display "by device", so a device need to be a "light" or a "sensor", so they are doing "magic" to mix data, and not possible for all situations.

Smanar avatar Apr 21 '25 11:04 Smanar

i sent dresden-elektronik a mail with explanations and a request to either

  • fully integrate mains into Phoscon, with some security/safety in mind, or
  • support metering on the sensors page

they replied they‘d take a look at it.

labor4 avatar Apr 24 '25 19:04 labor4