[App][Pro] Tuya Cloud

@Stig_Solberg, The problem you have are with the Tuya or Smartlife app. You should contact them about this.

@Wayne_Laagewaard, There was indeed an new version, but it only updated the wrong reported battey values for PIR. But start reading the opening post and rest of forum. I think you are still using legacy devices.

Thanks for your answer. Will do that. Thanks!

There is a new test version with following changes:

  • Smokesensor
  • Contactsensor
  • Settingspage has reference to opening post of this topic
  • Redirect Tuya API connection error to alert after pressing save
  • Refresh Scenes button on settingspage

I have to look at other devices to add, sensors are easier to add

6 Likes

:pray::+1: Wow, lots of improvements again, Jurgen!
Thanks again!

1 Like

Hello,first thanks for this great app!
I have install the last test version with the contact sensor(i have a lot of this) but they are not find when i try to detect them…
no problem with the sockets,they appears with power consumption(have not this option with the ancient api),but the wifi contact sensors are not find

@Ewen_Le_guennec, can you send an app diagnostic report. I will then look why they are not found. I can’t test them because I don’t own one.

a6fc5f6f-af9c-41b9-87a4-9c241e2f24c3
Hope it’s that you need

Cool I’m going to test my contact sensors asap.

@Jurgen_Heine I’ve added my motion sensors, it seems that when motion is detected, it then only turns off when the reset timer expertise not when the actual state changes in the tuya app. I’ve set this setting back to 1 min but when continuous motion is detected it still turns off motion after the reset timer. It looks like its not synced with the actual state. It seems only to trigger when motion is detected, not when the state is no motion therefore only the reset timer kicks in.

The problem you have are with the Tuya or Smartlife app. You should contact them about this.

Hi again. I am using Tuya Smart on my phone. But what about the thing that I don’t get RGB options in Homey? Is it Tuya phone app fault as well or what is wrong here?

Hi @Jurgen_Heine,

I just upgrade to the 1.0.9 test version. I’m testing my contact sensors, however, it seems the homey app cannot find the contact sensor. I’ve added one in the tuya cloud app, it is visible in my IoT account but no devices found from the homey app.

I configured the app with official API only. Other device are working and able to add
Any idea?

hi @Jurgen_Heine, I think I spotted the issue in the code. I posted this in the issue on git. Seems the contactsensor driver.js has smokedetector as device type when getting devices.

Regards,

Matrean

@Ewen_Le_guennec, I did not receive your log. But log is not needed anymore because @Matrean found probably the issue.

@Stig_Solberg , if it’s not working in Tuya app then this is probably also the reason it doesn’t work in Homey. This app uses the Tuya API.

@Matrean, there is indeed a timer, but I thought the state also triggers the off state. Also on every motion detection the timer should reset. I have to look at it. Good find about the contact sensor. I copied the smoke sensor code for contact sensor and adapted it, but probably forget to changer device type. I will look at both issues as soon I have the time and publish a new version then.

2 Likes

Hi Maarten,

That’s odd.
I’ve 4 motion sensors, set the motion reset time to 60s, and they act fine.
It’s the big round ones, LSC KE C20d.
Do you see differences in both the Homey & Tuya mobile app device log?
What settings are available in the Tuya mobile app?

  • Homey

  • Tuya mobile

@Stig_Solberg
Like I said before, it seems your rgb light is somehow not 100% Tuya compatible. What is the brand and type if I may ask?

I have LSC RGB lights, the Tuya IoT site returns this info:

  • Your light options

  • My light options

@Peter_Kawa Where do you find the device info?

I indeed see a difference between the apps. Lets say I put it on 300 sec, it will always wait 300 sec before setting it back to no motion, even if there’s no motion any more on the tuya cloud app

When there’s continuous movement in the room the motion sensor still goes to no motion directly after the reset timer expires while there’s still motion detected (in tuya cloud app). This can go until forever, until the tuya app changes again from no motion to motion (so it has to turn back to no motion again and then detect motion, after that the state is sent to homey)

To me it looks like only the action from no-motion → motion is synced, and it does not request.sync the state after reset timer expires

I don’t see any settings on the device in the tuya app.

@Jurgen_Heine and @Peter_Kawa I just looked at the code, and I believe the description I gave matches how the code operates.

In devices.js I only see a trigger for alarm_motion, true, not a specific for setting alarm_motion, false only when the timer expires.

besides that, it only triggers on a change, so when the reset time expires, but there’s still motion it just turns to alarm)motion, false I think an additional check is required on the PIR state

As far as I can see the output of this would match the behavior I see.

Suggestion to :slight_smile:

  • add trigger for setting motion_alarm, false
  • add sensor check to the reset timer, if still motion then reset the timer
 //init Or refresh AccessoryService
    updateCapabilities(statusArr) {
        this.log("Update pir capabilities from Tuya: " + JSON.stringify(statusArr));
        for (const statusMap of statusArr) {
            if (statusMap.code === "pir") {
                this.sensorStatus = statusMap;
                var rawStatus = this.sensorStatus.value;
                switch (rawStatus) {
                    case "pir":
                        this.setCapabilityValue("alarm_motion", true).catch(this.error);
                        // reset timeout when new trigger
                        if (this.timeoutObj !== null && this.timeoutObj !== undefined) {
                            clearTimeout(this.timeoutObj);
                        }
                        // Untrigger the motion sensor after specified seconds
                        this.timeoutObj = setTimeout(() => {
                            this.setCapabilityValue("alarm_motion", false).catch(this.error);
                        }, 1000 * this.getSettings().motionTimeoutInSeconds);
                        break;
                    default:
                        break;
                }
            }

In your IoT account. Tuya Smart Developer Center

@Peter_Kawa

I have no such info in my developer account…
Edit:
Made a project and suddely everything became Chinese…