-
Notifications
You must be signed in to change notification settings - Fork 15
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
Problem with ver. 4.0.1 #54
Comments
In the 7.0 version of tuya , the data event was changed to dp-refresh.
https://github.com/vinodsr/node-red-contrib-tuya-smart-device/blob/a60d0c83716e345706f0b542f4bcb6cba5275b64/src/tuya-smart-device.js#L106
It's working for my devices .
Is it because of this ? Can you change the event back to data and check?
Also can you share the node red logs for this usecase.
…On Mon, 12 Apr, 2021, 5:32 pm Marco Sillano, ***@***.***> wrote:
Updated to ver. 4.0.1. I found a big problem, missed the output msg!
Example:
The simplest flow, using a Smart_Switch
<https://github.com/msillano/tuyaDAEMON/blob/main/devices/Smart_Switch01/device_Smart_Switch01.pdf>
plus 2 nodes:
[{"id":"4c90f0fb.6e6d2","type":"tab","label":"extra.test","disabled":false,"info":""},{"id":"9aec7c62.dedc2","type":"debug","z":"4c90f0fb.6e6d2","name":"FROM SWITCH","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":320,"y":80,"wires":[]},{"id":"adcdaeb2.6e71f","type":"inject","z":"4c90f0fb.6e6d2","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"dps\":\"1\",\"set\":false}","payloadType":"json","x":130,"y":160,"wires":[["5ba5abff.f3fcb4"]]},{"id":"5ba5abff.f3fcb4","type":"tuya-smart-device","z":"4c90f0fb.6e6d2","deviceName":"switch module#1","deviceId":"bfa355aa196ae*******","deviceKey":"10ad2960ff******","deviceIp":"","retryTimeout":"4000","findTimeout":"4000","tuyaVersion":"3.1","x":110,"y":80,"wires":[["9aec7c62.dedc2"]]}]
The debug output:
TuyAPI Pinging 192.168.1.16 +10s
TuyAPI Received data: 000055aa00000000000000090000000c00000000b051ab030000aa55 +119ms
TuyAPI Parsed: +2ms
TuyAPI { payload: false, leftover: false, commandByte: 9, sequenceN: 0 } +3ms
TuyAPI Pong from 192.168.1.16 +1ms
express:router dispatching POST /inject/adcdaeb2.6e71f +2m
express:router query : /inject/adcdaeb2.6e71f +1ms
express:router expressInit : /inject/adcdaeb2.6e71f +3ms
express:router mounted_app : /inject/adcdaeb2.6e71f +1ms
express:router dispatching POST /inject/adcdaeb2.6e71f +1ms
express:router query : /inject/adcdaeb2.6e71f +0ms
express:router expressInit : /inject/adcdaeb2.6e71f +1ms
express:router corsMiddleware : /inject/adcdaeb2.6e71f +1ms
express:router jsonParser : /inject/adcdaeb2.6e71f +1ms
body-parser:json content-type undefined +2m
body-parser:json skip parsing +0ms
express:router urlencodedParser : /inject/adcdaeb2.6e71f +2ms
body-parser:urlencoded content-type undefined +1ms
body-parser:urlencoded skip parsing +1ms
express:router mounted_app : /inject/adcdaeb2.6e71f +1ms
express:router dispatching POST /inject/adcdaeb2.6e71f +5ms
express:router query : /inject/adcdaeb2.6e71f +0ms
express:router expressInit : /inject/adcdaeb2.6e71f +3ms
express:router serveStatic : /inject/adcdaeb2.6e71f +0ms
express:router mounted_app : /inject/adcdaeb2.6e71f +1ms
express:router dispatching POST /inject/adcdaeb2.6e71f +0ms
express:router query : /inject/adcdaeb2.6e71f +1ms
express:router expressInit : /inject/adcdaeb2.6e71f +0ms
express:router mounted_app : /inject/adcdaeb2.6e71f +1ms
express:router dispatching POST /inject/adcdaeb2.6e71f +0ms
express:router query : /inject/adcdaeb2.6e71f +1ms
express:router expressInit : /inject/adcdaeb2.6e71f +0ms
TuyAPI SET Payload: +8s
TuyAPI {
TuyAPI devId: 'bfa355aa196ae*******',
TuyAPI gwId: 'bfa355aa196ae*******',
TuyAPI uid: '',
TuyAPI t: 1618227689,
TuyAPI dps: { '1': false }
TuyAPI } +4ms
TuyAPI Received data: 000055aa00000021000000070000000c00000000167be2e10000aa55 +218ms
TuyAPI Parsed: +1ms
TuyAPI { payload: false, leftover: false, commandByte: 7, sequenceN: 33 } +1ms
TuyAPI Got SET ack. +1ms
TuyAPI Received data: 000055aa00000000000000080000004b00000000332e3300000000000000ac00000001f3fc6d8608d019e3d7c7e5022c16e184883cc6cbd441c8b209250a0222ae613e4ab9f738ccf13e1cc293961a60ddb6431b66f5220000aa55 +97ms
TuyAPI Parsed: +0ms
TuyAPI {
TuyAPI payload: { dps: { '1': false }, t: 1618227687 },
TuyAPI leftover: false,
TuyAPI commandByte: 8,
TuyAPI sequenceN: 0
TuyAPI } +2ms
TuyAPI Received DATA packet +1ms
TuyAPI Pinging 192.168.1.16 +2s
TuyAPI Received data: 000055aa00000000000000090000000c00000000b051ab030000aa55 +54ms
TuyAPI Parsed: +2ms
TuyAPI { payload: false, leftover: false, commandByte: 9, sequenceN: 0 } +2ms
TuyAPI Pong from 192.168.1.16 +2ms
engine:ws received "2" +19s
engine:socket packet +19s
engine:socket got ping +2ms
engine:socket sending packet "pong" (undefined) +0ms
engine:socket flushing buffer to transport +1ms
engine:ws writing "3" +4ms`
The log shows data send and received by tuyapi, but nothing in output from
node-red-contrib-tuya-smart-device !! Strange.
p.s.
Of course, the ver. 3.0.2 works well with all devices.
Best regards
m.s.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#54>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADQ6OH2YIB36ES5J3BLDG3TILOMRANCNFSM42ZEZKVQ>
.
|
The log:
================ output (OK) ( but from 'data' event): The log:
and ADDED a second device (AC meter): ================ output (OK) The Log:
Conclusion: Best regards |
@msillano what I see for your log is that the messages are not repeated for data and data refresh events..may be I need to subscribe for both. Waiting for further updates from your testing. |
Using an 'AC meter' (https://m.made-in-china.com/product/Dds238-2-WiFi-Single-Phase-DIN-Rail-Type-WiFi-Remote-Control-Energy-Meter-790065132.html). dP Key: 1 switch, 9: countdown, 18: Current (mA), 19: Watt * 10, 20: V * 10, 101: KWh * 100 SCHEMA {"operation":"GET", "schema":true}: as expected.
GET {"operation":"GET","dps":"20"}: strange, like SCHEMA
SET null {"dps":"20", "set":null}: as expected
As you can see data don't change. Very low sampling rate: see timing. Changed code in
RFR 20 {"operation":"RFR", "dps":"20"} repeat every 1 sec:
Works also so : {"operation":"RFR"} repeat every 1 sec:
Conclusion.
Best regards |
@msillano in order to avoid complex flows, what i am planning is
|
@msillano Can you please verify the new feature @ feature/add-support-for-refresh branch Now you can send the new operation "REFRESH". You can also listen to multiple events in the config page. (for both single and generic node) |
It works well... Thanks
'by default the node will subscribe for both data and data refresh events. but this behavior can be set from the node's config page.': the unique reason I see to change the default is the case of duplicated data. P.S.
This way the FAST control can be done with SET: { dp:"_fast", set: true|false }. Also GET/MULTIPLE works as expected, i.e. as a native dp. SCHEMA sends 2 data packets: one for the '_fast' dp only, one from the device. Best regards |
Changes are now merged. Please check version 4.0.2 |
Updated to ver. 4.0.1. I found a big problem, missed the output msg!
Example:
The simplest flow, using a Smart_Switch plus 2 nodes:
The debug output:
The log shows data send and received by tuyapi, but nothing in output from node-red-contrib-tuya-smart-device !! Strange.
p.s.
Reinstalled ver. 3.0.2: all works well with all devices.
Best regards
m.s.
The text was updated successfully, but these errors were encountered: