Tuya motion sensor is not supported in Home Assistant

I think I have a problem.
I only have 2 devices

  1. A Jinvoo Power board with 4 power outlets and 4 USB charge ports

  2. A Tuya Door/Window detector

As I got the Jinvoo power board first I used the Jinvoo App.
I was able to load the Tuya door/Window detector on that as well no problems.

The HA Tuya integration allows for 3 types off access Tuya, Smart Life, and Jinvoo Smart apps.

I am not sure I have created the Tuya IoT platform access correctly but when I get to the section on linking apps and I scan the QR code I get a message saying something about an unknown phone number on my phone. it’s really quick and I can’t get it all so I am surmising it might be that Jinvoo is my problem?

Any ideas??

If you ask me… my recommendation is to realign all your device into TUYA apps instead. I even avoid SmartLife and its brand apps. So far using TUYA is the safest.

Hi Richard,
Today I moved all my Tuya devices to the Tuya App.
The QR Code now worked.
The first thing that I noticed was that the Tuya app had a lot more functionality than the Jinvoo.
The Jinvoo devices had no trouble in using the Tuya app.
Basically I am back to where I was using the Tuya integration but using the Tuya App instaed of the invoo.
My Window sensor is working although it’s still slow but that was expected.

I have been studying this YouTube to try and understand the convoluted way of using the IOT Platform in order to run and install the TUYA V2 Beta.

The interesting thing I say was that the V2 will be made a standard integration sometime prior to 31 December 2021.
That’s not that far away.

I have not jumped into loading it in HACS yet as I want to be more sure of what I am doing.

If you wish I will keep you posted if not just say so and I will not

Thanks for you help

That is nonsense. Once you’ve acquired the device id’s and keys (which might be the hardest part to initially setup) configuring your tuya based devices with Local Tuya is a breeze. You’ll get rewarded with instantaneous status updates, internet cut-offs don’t matter anymore and most importantly you are taking your tuya devices away from chinese cloud servers.

Once correctly setup Local Tuya is in fact working very reliable. So far I have not experienced any issues for months with dozens of switches and plugs on different installations.

But as Richard has also already mentioned it: It’s not the easiest addon to install but nevertheless well worth to do.

Glad it work for you and sure you can always ask for assistant. Someone also help me alot during my first onboarding to HA… hahahahahaha… and YES you should move to V2 because that integrations being supported by TUYA.

HACS is something you need to know anyway. Its bring out the best of HA in it.

Read the information on their github

I’m sure not everyone having problem with LocalTuya but in my case it happen everytime. I need to restart LocalTuya before it run my entire device.

When it run, it run good but when it stop workin without any error or just wont run. I just need to scratch my head and reboot. So again that is happen on my system.

That used to happen from time to time on Local Tuya < v3.2.2 but got eventually fixed with the latest update.

There are no update yet… I guess you are running the master branch? Because problem continue for my end on 3.2.2

Same here, no more issues after this update. I don’t see many problems as it is called out earlier.

Hey,

So after battling with two window sensors from Tuya, I managed to do something that actually works. Maybe I took the long way round, but I couldn’t find a way to make sure that I have an accurate open/closed status from the sensors.
But hey, it worked in the end.

image


#Window Sensors (ping variant)
binary_sensor:
  - platform: ping
    host: 192.168.50.165
    count: 1
    scan_interval: 1
    name: ping_wolf_window_sensor
  - platform: ping
    host: 192.168.50.150
    count: 1
    scan_interval: 1
    name: ping_bathroom_window_sensor


#Counters
counter:
  wwcounter:
    name: Wolf Window Count
    initial: 0
    step: 1
  bwcounter:
    name: Bathroom Window Count
    initial: 0
    step: 1


sensor:  #Add Custom Sensors
- platform: template
  sensors:
    wolf_window:
      friendly_name: 'Wolf Window'
      value_template: '{% if is_state("counter.wwcounter", "1") %} open {% else %} closed {% endif %}'
- platform: template
  sensors:
    bathroom_window:
      friendly_name: 'Bathroom Window'
      value_template: '{% if is_state("counter.bwcounter", "1") %} open {% else %} closed {% endif %}

#Add Automation

- id: '1630778240140'
  alias: WWindow Count
  description: ''
  trigger:
  - platform: state
    entity_id: binary_sensor.ping_wolf_window_sensor
    from: 'off'
    to: 'on'
  condition: []
  action:
  - service: counter.increment
    target:
      entity_id: counter.wwcounter
  mode: single
- id: '1630778393410'
  alias: WW Reset
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: counter.wwcounter
    above: '1'
  condition: []
  action:
  - service: counter.reset
    target:
      entity_id: counter.wwcounter
  mode: single
- id: '1630778508819'
  alias: BWindow Count
  description: ''
  trigger:
  - platform: state
    entity_id: binary_sensor.ping_bathroom_window_sensor
    from: 'off'
    to: 'on'
  condition: []
  action:
  - service: counter.increment
    target:
      entity_id: counter.bwcounter
  mode: single
- id: '1630778551690'
  alias: BW Reset
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: counter.bwcounter
    above: '1'
  condition: []
  action:
  - service: counter.reset
    target:
      entity_id: counter.bwcounter
  mode: single


1 Like

Hi !

How did you integrate your sensor ? I’ve been able to find my sensor and add it to config.yaml like that

binary_sensor:
  - platform: ping
    host: 192.168.1.74
    count: 1
    scan_interval: 1
    name: ping_tuya_motion_sensor_fenetrechambre
  - platform: template
    sensors:
      tuya_motion_sensor_fenetrechambre:
        friendly_name: "Fenêtre chambre derrière"
        value_template: >-
          {{ as_timestamp(states.sensor.date_time.last_changed) - as_timestamp(states.binary_sensor.ping_tuya_motion_sensor_fenetrechambre.last_changed) < states('input_number.motion_sensor_idle_secs')|int }}

sensortuya

But don’t understand how you show “Wolf window … Open”
Thank’s a lot

1 Like

Hey mate,

So, i know it is disconnected but no worries. I made a counter:

counter:
  wwcounter:
    name: Wolf Window Count
    initial: 0
    step: 1

and also an automation:

- id: '1630778240140'
  alias: WWindow Count
  description: ''
  trigger:
  - platform: state
    entity_id: binary_sensor.ping_wolf_window_sensor
    from: 'off'
    to: 'on'
  condition: []
  action:
  - service: counter.increment
    target:
      entity_id: counter.wwcounter
   mode: single

these two combined will add a value of 1 to the counter each time the sensor is triggered.

I have also added a reset automation each time the count exceeds 1:

- id: '1630778393410'
  alias: WW Reset
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: counter.wwcounter
    above: '1'
  condition: []
  action:
  - service: counter.reset
    target:
      entity_id: counter.wwcounter
  mode: single

And thus i am setting a default state. I have closed the window and set the counter to “0” ,that means that opening the window will set the new state of the counter to “1” .
If you close the window, the sensor will trigger again adding again to the counter, but because of the reset automation, the counter will revert to “0”.

With this i can have state “0” for closed and state “1” for open

Now, adding another sensor:

sensor: 
- platform: template
  sensors:
    wolf_window:
      friendly_name: 'Wolf Window'
      value_template: '{% if is_state("counter.wwcounter", "1") %} open {% else %} closed {% endif %}'

And finally, this is the actual sensor i am using to determine if the window is open or closed.

I know it might seem like a weird and needlessly complex method, but for a sensor i couldn’t get to work to save my life or integrate it, this is the best solution that i came up with that works.

Please feel free to ask any questions, or if anyone comes up with a more straight forward solution, it will be very much appreciated.

Hey HDDBlackguard !

Thank’s a lot for your help, it’s really cool !
I’m really a beginner in HA, like i say i’ve been able to add my door/windows sensor in config.yaml but i’m searching since 4 hours where to add line as you said “counter: …” , automation and “another sensor”. I must put everyhing into config.yaml ?

My config.yaml looks like

binary_sensor:
  - platform: ping
    host: 192.168.1.74
    count: 1
    scan_interval: 1
    name: ping_tuya_motion_sensor_fenetrechambre
  - platform: template
    sensors:
      tuya_motion_sensor_fenetrechambre:
        friendly_name: "Fenêtre chambre derrière"
        value_template: >-
          {{ as_timestamp(states.sensor.date_time.last_changed) - as_timestamp(states.binary_sensor.ping_tuya_motion_sensor_fenetrechambre.last_changed) < states('input_number.motion_sensor_idle_secs')|int }}
          
          
counter:
  wwcounter:
    name: Wolf Window Count
    initial: 0
    step: 1

  -id: '1630778240140'
  alias: WWindow Count
  description: ''
  trigger:
  - platform: state
    entity_id: binary_sensor.ping_tuya_motion_sensor_fenetrechambre
    from: 'off'
    to: 'on'
  condition: []
  action:
  - service: counter.increment
    target:
      entity_id: counter.wwcounter
    mode: single

  alias: WW Reset
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: counter.wwcounter
    above: '1'
  condition: []
  action:
  - service: counter.reset
    target:
      entity_id: counter.wwcounter
  mode: single

But not sure than i’m the right way… No change at all. Sorry for loose your time but i’m NOOB :confused:

Hey HallEx,

So, counter is a sensor so in the config.yaml , and that ‘another sensor’ , just add it under the rest of the simple sensors in the config.yaml.
automation go into the automation.yaml , or you can use the visual interface:

Oh, and do not forget to change the name to your sensors (just rename the ones that i have created)

Hey, pardon the question but I just got myself a tuya motion sensor and I’ve been trying to get it into HA. I’m reading through this thread but I can’t figure out how you people are getting those IP addresses? I thought those sensors didn’t had wifi capabilities and even if they did, how did you get them to connect to your network in the first place?

This topic is mostly about the tuya wifi motion sensors

Ah sorry, somehow I missed that (maybe one of the reasons I was so confused). I got linked here from another thread.

1 Like

What tuya motion sensors do you have ? Zigbee ?

In my case, all the PIR sensors are Zigbee based. Can I apply this tutorial somehow?
Thanks to the community for the support.