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

Tuya Smart Button IH-663 #7205

Closed
HypeLaser opened this issue Aug 30, 2023 · 36 comments · Fixed by #7447
Closed

Tuya Smart Button IH-663 #7205

HypeLaser opened this issue Aug 30, 2023 · 36 comments · Fixed by #7447

Comments

@HypeLaser
Copy link

HypeLaser commented Aug 30, 2023

  • Product name: Tuya Smart Button
  • Manufacturer: _TZ3000_fa9mlvja
  • Model identifier: TS0041
  • Device type :
    • Switch

Screenshot 2023-08-30 at 21 10 57

Screenshot 2023-08-30 at 21 10 49

Screenshots

Screenshot 2023-08-30 at 20 48 11

Node Info

Screenshot 2023-08-30 at 20 49 06

Basic Cluster

Screenshot 2023-08-30 at 21 14 39

Power Config Attributes

Screenshot 2023-08-30 at 20 57 49

On/Off attributes (there are two On/Off listed. This is the Blue text one)

Screenshot 2023-08-30 at 21 03 05

On/Off attributes (there are two On/Off listed. This is the Grey text one)

Screenshot 2023-08-30 at 21 05 49

These Tuya Smart Buttons have three states: Single Press, Double Press, Long Press.

Obviously I can see them in DeCONZ, but it does not appear in Phoscon as anything. I've tried all devices.

I am trying to get this device to work in Home Assistant to trigger LED light states from the different button push states.

@github-actions
Copy link

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 Sep 21, 2023
@github-actions
Copy link

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.

@1100101
Copy link
Contributor

1100101 commented Oct 20, 2023

Reopen please, I have this device as well and would like it to work with Phoscon.

@1100101
Copy link
Contributor

1100101 commented Oct 20, 2023

I took the DDF _TZ3000_TS0041_1gang_bat.jsonand modified it, by just adding _TZ3000_fa9mlvja to manufacturername and TS0041 to modelid.

I can now pair the switch in Phoscon, it is recognized.

BUT: I do not get any button events via the API.
Instead, it seems the device sends its battery status every second.

I haven't tried anything else, I don't know DDF at all :)

@Mimiix
Copy link
Collaborator

Mimiix commented Oct 20, 2023

I took the DDF _TZ3000_TS0041_1gang_bat.jsonand modified it, by just adding _TZ3000_fa9mlvja to manufacturername and TS0041 to modelid.

I can now pair the switch in Phoscon, it is recognized.

BUT: I do not get any button events via the API. Instead, it seems the device sends its battery status every second.

I haven't tried anything else, I don't know DDF at all :)

If yours is not the same manufacturer name, you have to open a new device request.

@1100101
Copy link
Contributor

1100101 commented Nov 10, 2023

@Mimiix I have exactly this device mentioned by the original poster.

modifying the existing DDF apparently did not work, but could you still reopen the issue please?

@Mimiix
Copy link
Collaborator

Mimiix commented Nov 10, 2023

@Mimiix I have exactly this device mentioned by the original poster.

modifying the existing DDF apparently did not work, but could you still reopen the issue please?

Can you show me the basic cluster ?

@1100101
Copy link
Contributor

1100101 commented Nov 10, 2023

Sure:
image
image

@Mimiix Mimiix removed the stale label Nov 10, 2023
@Mimiix Mimiix reopened this Nov 10, 2023
@Mimiix
Copy link
Collaborator

Mimiix commented Nov 10, 2023

Thanks

@Smanar would you please help out?

@1100101
Copy link
Contributor

1100101 commented Nov 17, 2023

@Smanar I went ahead and did the change to _TZ3000_TS0041_1gang_bat.json again, as I did previously (see above).
This time I also modified the button_maps.json to include this device.

The switch can now be paired with Phoscon, and I see events coming trough deCONZ REST API, including button clicks (single press, double press, long press).

Still, strangely, once I hit the button, I get loads of events from the device, updating its values constantly for about 30 seconds, even though the values never change.

Is this expected behavior?

@1100101
Copy link
Contributor

1100101 commented Nov 17, 2023

I've added the refresh.interval from https://github.com/dresden-elektronik/deconz-rest-plugin/pull/7006/files#diff-5f7ad09495b8fb0da9809c7bc3f561c7e46102a8c3ef8142568f8ddea4554d81L50
back into the DDF, and now it looks like I don't get bombarded with battery status events :)

@Smanar
Copy link
Collaborator

Smanar commented Nov 17, 2023

Oups sorry, have totally skipped this post

Still, strangely, once I hit the button, I get loads of events from the device, updating its values constantly for about 30 seconds, even though the values never change.

Is this expected behavior?

He, for me not, the device can wait for a "confirmation" from deconz.

The report from battery is set here

    {
      "bind": "unicast",
      "src.ep": 1,
      "cl": "0x0001",
      "report": [
        {
          "at": "0x0021",
          "dt": "0x20",
          "min": 60,
          "max": 3600,
          "change": "0x00000001"
        }
      ]
    },

If this one is not working, and after the time set in refresh.interval (it's for that need to put greater value in it than in bind) deconz make a poll to get the value.
So this setting can't stop the spamming for me, perhaps the bind/report was not set before (deconz need to configure the device and can take time if you don't re-include the device, they are lazy device)

@atomphil
Copy link

I have a switch that appears to be identical to the one shown here, except that it reports "_TZ3000_mrpevh8p" as the manufacturer name. It is found in deconz, but not in Phoscon. How can I integrate it and use it in Home Assistant?
The "manual" names the model as RSH-SC07.

@Smanar
Copy link
Collaborator

Smanar commented Nov 27, 2023

You can do like him #7205 (comment)

@atomphil
Copy link

You can do like him #7205 (comment)

I did it, it is found in Phoscon now, but it only shows the battery status. No button events.

@Smanar
Copy link
Collaborator

Smanar commented Nov 28, 2023

You have edited too the Buttonmap file ?
Not possible if you are on docker (or harder)

@1100101
Copy link
Contributor

1100101 commented Dec 30, 2023

@manup @Smanar could we open this again?
The issue I described in #7205 (comment) still persists:

Once I hit the button, the battery value is sent multiple times per second, for 20-30 seconds (I suppose the button goes to sleep after that time).

@Mimiix
Copy link
Collaborator

Mimiix commented Dec 31, 2023

@manup @Smanar could we open this again? The issue I described in #7205 (comment) still persists:

Once I hit the button, the battery value is sent multiple times per second, for 20-30 seconds (I suppose the button goes to sleep after that time).

Did you update to 2.25.0?

@Smanar
Copy link
Collaborator

Smanar commented Dec 31, 2023

Im looking on Z2M they are doing nothing special except adding the tuya magic packet.
Can try to add to the DDF

	{
	 "name": "config/tuya_unlock"
	},

New device don't support bind, so can try to remove

    {
      "bind": "unicast",
      "src.ep": 1,
      "dst.ep": 1,
      "cl": "0x0006"
    }

But this part can make the device not working.
You need to re-include the device, setting are made during the inclusion.

You haven't some logs when you press the button ? To see if the problem is from the device or deconz, can be something normal, tuya is exotic stuff.

@1100101
Copy link
Contributor

1100101 commented Jan 1, 2024

@Mimiix Yes, I'm running v2.25.0-beta.
@Smanar I've removed the button from Phoscon/deCONZ, and re-learned it, but the issue remains.
I can produce some logs. Which log levels are you interested in?

@Smanar
Copy link
Collaborator

Smanar commented Jan 1, 2024

You have added

	{
	 "name": "config/tuya_unlock"
	},

In your DDF ?

Can start with flags "info" and "info_l2" to start if its too much talkative, else an usefull one is "ZCL"

@1100101
Copy link
Contributor

1100101 commented Jan 1, 2024

@Smanar That did it!
Once I added the tuya_unlock bit, the event spam stopped.
Now I get only one update per attribute when the button is pressed.

Thanks!

@Hoeflers
Copy link

Hoeflers commented Jan 2, 2024

Hi,
I have exactly the same problem, but unfortunately I cannot see the Smart Buttons in Phoscon even after adjusting the json. files.

They are recognized in Deconz.
The button presses are also listed in the log of the Deconz addin in HA.
Is there anything else I need to consider?

Thanks

@Smanar
Copy link
Collaborator

Smanar commented Jan 2, 2024

@1100101 I have make a PR to update your device, if you can test it, but it just remove it from the original DDF to put it in another DDF with the tuya unlock request.

#7509

@Hoeflers if you can see event in HA, for me it mean phoscon just don't support it.

@Hoeflers
Copy link

Hoeflers commented Jan 2, 2024

I only see an entry in the add ins log when the button is pressed. In ha itself I see neither the devices nor events.

In the others, the devices are displayed after the changes.

Am I doing something wrong?

@Smanar
Copy link
Collaborator

Smanar commented Jan 2, 2024

Can you share some logs ?
IDK what kind of logs it can be, but without a good DDF you would have nothing, and with a working DDF I don't see what can be missing.
You have another battery switch working on HA from deconz ? Because HA have a special way to use them.

@Hoeflers
Copy link

Hoeflers commented Jan 3, 2024

Good morning,

happy to upload some logs later when I get back.
Can i get some logs from deconz inside which can help?
Must confess that deconz is something new for me.

So far I have several plugs, lights and a button from Silvercrest working.
The buttons to be installed now are the same as in the first post except for the manufacture name.
_TZ3000_qgwcxxws

Apart from the described changes in _TZ3000_TS0041_1gang_bat.json and button_maps.json nothing has been changed.
The changes were entered via ssh docker.
Is this the right way?
Is there a possibility directly in Deconz?
Have I overlooked something?

Perhaps also important.
HA runs as VM in Proxmox with a Conbee II.

Thanks a lot

@Smanar
Copy link
Collaborator

Smanar commented Jan 3, 2024

Can i get some logs from deconz inside which can help?

IDK, I just want to see the one you have, for the moment I realy don't understand what happen

I only see an entry in the add ins log when the button is pressed

The changes were entered via ssh docker.
Is this the right way?

You are using the official docker ? If yes DDF need to be in the /opt/deCONZ/devices/ folder deconz-community/deconz-docker#163

But all is native, you don't need to play with DDF, you can have a battery drain without the last version, but it will work natively.
Else you don't have a recent deconz version or you have a new model. If you have the GUI can take a look on the device to be sure you have the same model #7205 (comment) .

@Hoeflers
Copy link

Hoeflers commented Jan 3, 2024

I open Docker via the terminal addon Advanced SSH & Web Terminal
in HA there I followed this guide in the Phoscon forum.

Login via SSH to HA
Login deCONZ docker container: docker exec -it addon_core_deconz bash
Install a text editor e. g. nano for editing files on the CLI: apt update; apt install nano (note: this will be undone once the container is restarted or updated)
Edit your DDF file with e. g. nano /usr/share/deCONZ/devices/blitzwolf/bw_shp13_smart_plug.json
Don’t forget to “hot reload” the DDF changes using deCONZ (VNC GUI)

Login via SSH to HA
Login deCONZ docker container: docker exec -it addon_core_deconz bash
Install a text editor e. g. nano for editing files on the CLI: 
apt update; apt install nano (note: this will be undone once the container is restarted or updated)
Edit your DDF file with e. g. nano /usr/share/deCONZ/devices/blitzwolf/bw_shp13_smart_plug.json
Don’t forget to “hot reload” the DDF changes using deCONZ (VNC GUI)

I have the file _TZ3000_TS0041_1gang_bat.json from the path /usr/share/... to the /data/... folder as described and executed the hot reload.
Now the buttons are displayed in the Phoscon and I can also see when they are pressed.
One step further.

Unfortunately I cannot assign the buttons in the settings yet.
Only the Silvercrest is visible here.
I don't know where the product "Schalter" comes from.

deconz_SW
verbundene_Schalter
SW-verbinden

@Smanar
Copy link
Collaborator

Smanar commented Jan 4, 2024

On HA you have a persistent folder here /data/.local/share/dresden-elektronik/deCONZ/devices/

And on HA you can edit DDF but harder to edit the buttonmap file, and you need it for button return.
And better to look for them in HA, IDK what Phoscon can do with them.

For the "schalter", better to look direclty in the API, phoscon/help/API Information/sensors. Phoscon is a third app like HA, they can add "stuff"

@Hoeflers
Copy link

Hoeflers commented Jan 6, 2024

Yes, I have copied the file to this folder. I just couldn't remember the exact path.

On HA you have a persistent folder here
/data/.local/share/dresden-elektronik/deCONZ/devices/

Then I'll check the button map and see if I can do anything there.

Thanks for the support and have a nice weekend.

@Smanar
Copy link
Collaborator

Smanar commented Jan 6, 2024

Then I'll check the button map and see if I can do anything there

Was just a remark, if you can see button event on phoscon, it mean the buttonmap file is fine, but on my side I don't see something native for the qgwcxxws on the actual code.

@Hoeflers
Copy link

Hoeflers commented Jan 8, 2024

I can see the buttons, but unfortunately only an empty cover.
You can't add the buttons to a group.
Unfortunately, I have no idea how and where to edit this.
Unfortunately, I don't have a clear overview.
Any idea where I can start?

@Smanar
Copy link
Collaborator

Smanar commented Jan 8, 2024

You can't add the buttons to a group.

This device don't have the group cluster, so I don't think it can support it.
You haven't third app ? other than phoscon ?

@Hoeflers
Copy link

Hoeflers commented Jan 9, 2024

No, unfortunately not. I think I'll buy supported buttons to get me started.
Thanks for the great support.

@Smanar
Copy link
Collaborator

Smanar commented Jan 9, 2024

Ikea and philips are working for sure, but tuya it's more random.

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.

6 participants