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

Human Presence Sensor (wifi) works in SmartLife but not in home-assistant #129896

Closed
pabloromeo opened this issue Nov 5, 2024 · 4 comments · Fixed by #129925
Closed

Human Presence Sensor (wifi) works in SmartLife but not in home-assistant #129896

pabloromeo opened this issue Nov 5, 2024 · 4 comments · Fixed by #129925
Assignees

Comments

@pabloromeo
Copy link

The problem

The Tuya product id is gsmc4okxrjukqxuy, In Tuya Development Platform it shows the name HPD WF MS58, and it is correctly categorized as "hps".
The sensor works perfectly within SmartLife:
image

I've attached the diagnostics from the Tuya integration for this device.

One thing i'm noticing, is that presence_state on Tuya's side is an Enum of 5 options:

 "presence_state": {
        "type": "Enum",
        "value": {
          "range": [
            "none",
            "presence",
            "peaceful",
            "small_move",
            "large_move"
          ]
        }
      }

I'm not sure how that would correctly map to a BinarySensor as the Tuya integration attempts.
Currently all that happens in Home-Assistant is that I get a single Occupancy binary_sensor that never changes state, and is always "Clear". Even when the presence_state changes in Tuya as well as in the diagnostics export.
Here's all I see in Home-Assistant:
image

Also, the Standard instruction for this device (In Tuya's Platform) only has the presence_state mapped, while the DP Instructions has many other properties, such as the target distance, which doesn't get exposed to Home-Assistant.
image
image

What version of Home Assistant Core has the issue?

core-2024.10.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

tuya

Link to integration documentation on our website

https://www.home-assistant.io/integrations/tuya/

Diagnostics information

tuya-0751d4c60fd799480426ddd4bc95329e-Living Presencia-db94ff5246cda718bb484e4608a8e8bc (1).json

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Nov 5, 2024

Hey there @tuya, @zlinoliver, @frenck, mind taking a look at this issue as it has been labeled with an integration (tuya) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of tuya can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign tuya Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


tuya documentation
tuya source
(message by IssueLinks)

@KunalAggarwal
Copy link
Contributor

The state is being fixed in the upcoming 2024.11 release. The PR is merged for this #129801

I’ll try and see if other attributes can be mapped as well to entities in coming few days.

@pabloromeo
Copy link
Author

pabloromeo commented Nov 5, 2024

Ah, that's amazing! I wasn't aware of that PR.
One question: shouldn't "peaceful" also be considered an "on" value?

It would be awesome to have the target distance too, but I didn't see it mapped in the Standard Status Set. Not sure if it's something one can add in the Tuya Platform directly, as an extra mapping, or if we are entirely limited by that standard mapping in place.

@KunalAggarwal
Copy link
Contributor

The reason I did not include Peaceful is, I was not sure what that status is. For me it always shows peaceful even when I'm not in the room. My assumption was peaceful was a not present state. I'll raise a PR for that.

The other params like distance are not returned in the status set. So, cannot set that unless Tuya fixes it at their end.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants