Skip to content
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

GiEXperience SMART Water Valve (_TZE200_a7sghmms) #6944

Open
BEskandari opened this issue May 2, 2023 · 16 comments · May be fixed by #6947
Open

GiEXperience SMART Water Valve (_TZE200_a7sghmms) #6944

BEskandari opened this issue May 2, 2023 · 16 comments · May be fixed by #6947

Comments

@BEskandari
Copy link
Contributor

BEskandari commented May 2, 2023

Device

  • Product name: GiEXperience SMART Water Valve
  • Manufacturer: _TZE200_a7sghmms
  • Model identifier: TS0601
  • Device type :
    • Other: Water Valve
  • Link to product
    GiEXperience SMART Water Valve

Screenshots

Node Info

img1
img2
img2a

Basic

img3
img3a
img3b

Groups

img4
img4a
img4b

Scenes

img5
img5a
img5b
img5c
img5d
img5e

Other: Tuya specific

img6

Other: OTAU

img7
img7a
img7b

Other: Time

img8

@BEskandari BEskandari changed the title GiEXperience SMART Water Valve GiEXperience SMART Water Valve (_TZE200_a7sghmms) May 2, 2023
@BabaIsYou
Copy link
Contributor

BabaIsYou commented May 3, 2023

Could try this DDF ? You,Ll have two devices, one On/off "light" and one Consumption "sensor"

{
	"schema": "devcap1.schema.json",
	"manufacturername": ["_TZE200_a7sghmms", "_TZE200_sh1btabb"],
	"modelid": ["TS0601", "TS0601"],
	"vendor": "GIEXperience",
	"product": "Smart water valve",
	"sleeper": false,
	"status": "Gold",
	"subdevices": [{
			"type": "$TYPE_ON_OFF_OUTPUT",
			"restapi": "/lights",
			"uuid": [
				"$address.ext",
				"0x01"
			],
			"items": [{
					"name": "attr/id"
				},
				{
					"name": "attr/lastannounced"
				},
				{
					"name": "attr/lastseen"
				},
				{
					"name": "attr/manufacturername"
				},
				{
					"name": "attr/modelid"
				},
				{
					"name": "attr/name"
				},
				{
					"name": "attr/swversion"
				},
				{
					"name": "attr/type"
				},
				{
					"name": "attr/uniqueid"
				},
				{
					"name": "state/on",
					"refresh.interval": 300,
					"read": {
						"fn": "tuya"
					},
					"write": {
						"dpid": 2,
						"dt": "0x10",
						"eval": "Item.val == 1 ? 1 : 0;",
						"fn": "tuya"
					},
					"parse": {
						"dpid": 2,
						"eval": "Item.val = Attr.val;",
						"fn": "tuya"
					},
					"default": 0
				},
				{
					"name": "config/tuya_unlock"
				},
				{
					"name": "state/reachable"
				}
			]
		},
		{
			"type": "$TYPE_CONSUMPTION_SENSOR",
			"restapi": "/sensors",
			"uuid": [
				"$address.ext",
				"0x01",
				"0x0702"
			],
			"items": [{
					"name": "attr/id"
				},
				{
					"name": "attr/lastannounced"
				},
				{
					"name": "attr/lastseen"
				},
				{
					"name": "attr/manufacturername"
				},
				{
					"name": "attr/modelid"
				},
				{
					"name": "attr/name"
				},
				{
					"name": "attr/swversion"
				},
				{
					"name": "attr/type"
				},
				{
					"name": "attr/uniqueid"
				},
				{
					"name": "config/battery",
					"parse": {
						"dpid": 108,
						"eval": "Item.val = Attr.val;",
						"fn": "tuya"
					},
					"default": 0
				},
				{
					"name": "config/duration",
					"description": "Last irrigation duration",
					"parse": {
						"dpid": 114,
						"eval": "Item.val = Attr.val;",
						"fn": "tuya"
					}
				},
				{
					"name": "state/consumption",
					"description": "Rcurrent_summ_delivered",
					"parse": {
						"dpid": 111,
						"eval": "Item.val == Attr.val;",
						"fn": "tuya"
					},
					"default": 0
				},
				{
					"name": "config/reachable"
				},
				{
					"name": "state/lastupdated"
				},
				{
					"name": "config/delay",
					"description": "Cycle irrigation interval in seconds min=0 max=3600",
					"range": [0, 3600],
					"write": {
						"dpid": 104,
						"dt": "0x2b",
						"eval": "Attr.val = Item.val;",
						"fn": "tuya"
					},
					"parse": {
						"dpid": 104,
						"eval": "Item.val = Attr.val ;",
						"fn": "tuya"
					}
				},
				{
					"name": "state/seconds_remaining",
					"description": "Irrigation target, duration in seconds or capacity in litres (depending on mode) min=0 max=3600",
					"range": [0, 3600],
					"write": {
						"dpid": 104,
						"dt": "0x2b",
						"eval": "Attr.val = Item.val;",
						"fn": "tuya"
					},
					"parse": {
						"dpid": 104,
						"eval": "Item.val = Attr.val ;",
						"fn": "tuya"
					}
				}, {
					"name": "config/mode",
					"description": "Device mode: [0] duration [1] capacity",
					"write": {
						"dpid": 1,
						"dt": "0x10",
						"eval": "Item.val == '1' ? 1 : 0;",
						"fn": "tuya"
					},
					"parse": {
						"dpid": 1,
						"eval": "Item.val = String(Attr.val) ;",
						"fn": "tuya"
					}
				}
			]
		}
	]
}

@BEskandari
Copy link
Contributor Author

I just added to the DDF those lines twice:

"name": "attr/swversion",
"parse": {"fn": "zcl", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "tuya_swversion.js"},
"read": {"fn": "zcl", "ep": 1, "cl": "0x0000", "at": "0x0001"}

I can turn on/off the valve and have the battery level.

I have some doubt on the ZHAConsumption type sensor, because through Homebridge Deconz it gives me as below without any control on the duration. See below:
Screenshot01

@BabaIsYou
Copy link
Contributor

I saw for the swversion but was not an issue at this step ;-)
I don't know what Homebridge is displaying or not, can you have a look using REST-API (in Phoscon / help / API information) to see what is really exposed.

@BabaIsYou
Copy link
Contributor

The Consumption sensor could eventually be replaced by

      "type": "$TYPE_OPEN_CLOSE_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0500"
      ],

instead of


		"type": "$TYPE_CONSUMPTION_SENSOR",
			"restapi": "/sensors",
			"uuid": [
				"$address.ext",
				"0x01",
				"0x0702"
			],

@BEskandari
Copy link
Contributor Author

REST-API for /lights:

{
    "config": {
        "groups": []
    },
    "etag": "1d9980c55c5ca365b9597d2bf16ea338",
    "hascolor": false,
    "lastannounced": null,
    "lastseen": "2023-05-03T19:03Z",
    "manufacturername": "_TZE200_a7sghmms",
    "modelid": "TS0601",
    "name": "Water Valve",
    "state": {
        "on": false,
        "reachable": true
    },
    "swversion": "1.0.8",
    "type": "On/Off output",
    "uniqueid": "a4:c1:38:17:9e:c3:8c:06-01"
}

REST-API for /sensors:

{
    "config": {
        "battery": 100,
        "delay": 0,
        "duration": null,
        "mode": "false",
        "on": true,
        "reachable": true
    },
    "etag": "c05d2ebb4c348c3abd2e8eb3fe497423",
    "lastannounced": null,
    "lastseen": "2023-05-03T19:07Z",
    "manufacturername": "_TZE200_a7sghmms",
    "modelid": "TS0601",
    "name": "Consumption 22",
    "state": {
        "consumption": 0,
        "lastupdated": "2023-05-03T16:50:15.724",
        "seconds_remaining": 0
    },
    "swversion": "1.0.8",
    "type": "ZHAConsumption",
    "uniqueid": "a4:c1:38:17:9e:c3:8c:06-01-0702"
}

Let me check $TYPE_OPEN_CLOSE_SENSOR

@BEskandari
Copy link
Contributor Author

BEskandari commented May 4, 2023

By using $TYPE_OPEN_CLOSE_SENSOR
REST-API for /lights:

{
    "config": {
        "groups": []
    },
    "etag": "204faf3a975f99b35e2c0b6879bf0797",
    "hascolor": false,
    "lastannounced": null,
    "lastseen": "2023-05-04T17:41Z",
    "manufacturername": "_TZE200_a7sghmms",
    "modelid": "TS0601",
    "name": "Water Valve",
    "state": {
        "on": false,
        "reachable": true
    },
    "swversion": "1.0.8",
    "type": "On/Off output",
    "uniqueid": "a4:c1:38:17:9e:c3:8c:06-01"
}

REST-API for /sensors:

{
    "config": {
        "battery": 100,
        "delay": 0,
        "duration": null,
        "mode": null,
        "on": true,
        "reachable": true
    },
    "etag": "56246383b299b40b671f3fe11dc60747",
    "lastannounced": null,
    "lastseen": "2023-05-04T17:43Z",
    "manufacturername": "_TZE200_a7sghmms",
    "modelid": "TS0601",
    "name": "OpenClose 23",
    "state": {
        "consumption": 0,
        "lastupdated": "none",
        "seconds_remaining": 0
    },
    "swversion": "1.0.8",
    "type": "ZHAOpenClose",
    "uniqueid": "a4:c1:38:17:9e:c3:8c:06-01-0500"
}

I would like to quote @ebaauw

Not sure I appreciate the full features of the device, but this looks like a dirty hack, abusing existing API attributes to mean something completely different. No API client is going to understand that, without whitelisting the device and treating it special. I won’t be doing that in Homebridge deCONZ. In fact I just introduced the capabilities and config you /lights to get rid of whitelisting lights.

Looks like you’d need a new device type and new attributes to support the device properly. That cannot be done in a DDF alone, you’d need changes to the C++ code. I’m happy to support a new device type in Homebridge deCONZ if it’s well-defined.

Actually I don't know if we can go further with this DDF and doing more than on/off

@BabaIsYou
Copy link
Contributor

BabaIsYou commented May 4, 2023

I know that some devices are an in-between mode that's perhaps not clearly identified and that some measures are only considered under one angle (electricity) in REST-API. But from my point of view is too limited regarding to Zigbee specification. The formatting of the measure (attribute 0x0300 of cluster 0x0702) is here to precise unit of measure (from kWh, m3, BTU, liters, etc ...). Then REST-API is too limitied (missing an item to transfer unit) , and so are Third party app expectations (just KW are attendee).

Then I agree with Erik. and he is in better position than me to have C++ modification approuved.

@BEskandari
Copy link
Contributor Author

I rather prefer to use $TYPE_CONSUMPTION_SENSOR as the change doesn't bring any additional feature.
Do we need just to add the swversion or can we do more?

@BabaIsYou if you give me the name of the existing DDF I can try to make a PR for your additions.

@BabaIsYou
Copy link
Contributor

BabaIsYou commented May 4, 2023

I see no more addition at this step than swversion. I suggest also to change "status": "Gold", for "status": "Silver", and to put the new DDF in https://github.com/dresden-elektronik/deconz-rest-plugin/tree/f837452b4eec614746e3ba56f214b1096342a797/devices/tuya with name _TZE200_TS0601_water_valve.json

@BabaIsYou
Copy link
Contributor

BabaIsYou commented May 4, 2023

If you add something like close #6944 in the comment of the PR, github will automatically close this issues once PR merged with a next version.

@BEskandari BEskandari linked a pull request May 4, 2023 that will close this issue
@BEskandari
Copy link
Contributor Author

@BabaIsYou, could you please let me know if I made the PR #6947 correctly or not? it seems stuck on a validation process.

@BabaIsYou
Copy link
Contributor

Yes seems good. Waiting for approval.

@github-actions
Copy link
Contributor

As there has not been any response in 21 days, this issue has been automatically marked as stale. At OP: Please either close this issue or keep it active It will be closed in 7 days if no further activity occurs.

@github-actions github-actions bot added the stale label May 28, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 4, 2023

As there has not been any response in 28 days, this issue will be closed. @ OP: If this issue is solved post what fixed it for you. If it is not solved, request to get this opened again.

@miloit
Copy link

miloit commented Sep 12, 2023

Hello is this integrated???

@Mimiix
Copy link
Collaborator

Mimiix commented Sep 12, 2023

Hello is this integrated???

No, as you can see, PR is still open.

@Mimiix Mimiix reopened this Sep 13, 2023
@github-actions github-actions bot removed the stale label Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants