Closed hajopaj closed 4 years ago
I assume they work correctly with the app?
Are you able to ping those IP addresses from the machine running Homebridge?
Yes, they work correctly with the app and I can ping both devices without any losses
What's the output of DEBUG=* homebridge
when you toggle the unresponsive devices a few times?
First this
Then that
Gave it a quick search and I don't think the error is this plugin's fault. People have suggested changing parameters on avahi as well as making sure that there's not an orphan Homebridge process running from the same config folder on the same host.
You may also want to try deleting the persist/
and accessories/
folders in your Homebridge config location.
I tried changing the cache size in Avahi and deleting both folders. Afterwards I got a "no answer" from all of my devices in home app and still could not toggle the devices although they are displayed (but also always were) in my Homebridge-config-ui.
Debug is the same as before...
I'm sorry, but if you're still getting the same error in the first screenshot I can't help as it's more a Homebridge problem. You may want to open an issue here.
I did some more "research" and I noticed that in the sharedprefs data in Nox there is a difference in the "dps" parts of the preferences.xml file. For the not working switches it says:
"dps": {"1":false,"101":"0","102":0}
and for all the working ones it says:
"dps":{"1":false,"11":0}
Could it be that I just have to add some "options" and "dps" to config.json? - And if yes, any idea how are they supposed to look?
Seems kind of probable to me since debug says everything is working fine...
Am 21.01.2019 um 01:13 schrieb Max Isom notifications@github.com:
I'm sorry, but if you're still getting the same error in the first screenshot I can't help as it's more a Homebridge problem. You may want to open an issue here.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.
As you're not getting an error that seems related to TuyAPI, I would be surprised if that was the problem.
You could try controlling your device with tuya-cli using the same parameters that are in your config.json
. If that works, it's very unlikely that the source of problems is this plugin. If not, we'll have to do some more investigation.
This is what I am getting from tuya-cli. The first device is one of the not responding ("no answer" in home app but working in tuya app) and the second is one working in both. When I use the set command with the not responding device I get this but nothing happens with the breaker.
It's possible you have the wrong key for your device, as data would then not be encoded or decoded correctly (so set and get both fail).
You might want to try acquiring the keys again. Are you doing it with tuya-cli list-app
or some other method?
I checked again but I aquired the code with Tuya-cli and it seems to be right. As you can see in the second picture I was able to send the set command but nothing happened. I am sure I used the correct keys since I directly copied them out of Tuya-cli. No ideal why it won‘t switch anything...
Am 28.01.2019 um 02:00 schrieb Max Isom notifications@github.com:
It's possible you have the wrong key for your device, as data would then not be encoded or decoded correctly (so set and get both fail).
You might want to try acquiring the keys again. Are you doing it with tuya-cli list-app or some other method?
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.
Hmm... do you have other devices of the same model that work?
No I don’t have any other devices of that make. They don’t have a brand name as you can see on the picture but I thought if they run with tuya smart, I can make them run with Homebridge-tuya as well...
I also thought about flashing the devices with tasmota. - do you think that could make it work? I have to use another plugin as far as I understood or could they still work with Homebridge-tuya then?
Am 30.01.2019 um 00:04 schrieb Max Isom notifications@github.com:
Hmm... do you have other devices of the same model that work?
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.
If you flash them with tasmota (still an experimental process, I don't know much about it and haven't tried it myself), you'll have to use a different plugin as homebridge-tuya only supports devices with Tuya firmware.
Any other idea what else I could possibly do? Since I don‘t get any errors I don‘t know what to fix...
Am 30.01.2019 um 23:15 schrieb Max Isom notifications@github.com:
If you flash them with tasmota (still an experimental process, I don't know much about it and haven't tried it myself), you'll have to use a different plugin as homebridge-tuya only supports devices with Tuya firmware.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.
Try running this (after modifying the parameters) with DEBUG=* node test.js
and post the output:
const TuyAPI = require('tuyapi');
const device = new TuyAPI({
id: 'xxxxxxxxxxxxxxxxxxxx',
key: 'xxxxxxxxxxxxxxxx',
ip: 'xxx.xxx.xxx.xxx'});
device.get({schema: true}).then(data => {
console.log(data);
});
pi@raspberrypi:~ $ DEBUG=* node test.js internal/modules/cjs/loader.js:605 throw err; ^
Error: Cannot find module 'tuyapi'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
at Function.Module._load (internal/modules/cjs/loader.js:529:25)
at Module.require (internal/modules/cjs/loader.js:657:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.
Am 31.01.2019 um 20:29 schrieb Max Isom notifications@github.com:
DEBUG=* node test.js
Do I have to run something else since I am using Homebridge with Raspbian?
Am 31.01.2019 um 20:29 schrieb Max Isom notifications@github.com:
Try running this (after modifying the parameters) with DEBUG=* node test.js and post the output:
const TuyAPI = require('tuyapi');
const device = new TuyAPI({ id: 'xxxxxxxxxxxxxxxxxxxx', key: 'xxxxxxxxxxxxxxxx', ip: 'xxx.xxx.xxx.xxx'});
device.get({schema: true}).then(data => { console.log(data); }); — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.
Sorry, forgot to add that you'll need to install TuyAPI.
Do npm i tuyapi -g
(or sudo npm i tuyapi -g
) and try again.
Installed it and did a restart but I’m still getting the same error.
Am 01.02.2019 um 16:05 schrieb Max Isom notifications@github.com:
Sorry, forgot to add that you'll need to install TuyAPI.
Do npm i tuyapi -g (or sudo npm i tuyapi -g) and try again.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.
Hmm, unless you changed your NPM configuration I think that should have worked.
You can also try installing it to your current directory with npm i tuyapi
(without the -g
flag).
Got this:
pi@raspberrypi:~ $ DEBUG=* node test.js TuyAPI Payload: { gwId: '6ca0fa68a6c570c1dasyfh', devId: '6ca0fa68a6c570c1dasyfh' } +0ms TuyAPI Send attempt 1 +24ms TuyAPI Sending this data: 000055aa000000000000000a0000004a7b2267774964223a2236636130666136386136633537306331646173796668222c226465764964223a2236636130666136386136633537306331646173796668227d000000000000aa55 +2ms TuyAPI Connect 192.168.178.32 +3ms TuyAPI Socket connected. +136ms TuyAPI Received data back: 192.168.178.32 +21ms TuyAPI 000055aa000000000000000a00000021000000016a736f6e206f626a206461746120756e76616c6964d25378690000aa55 +0ms TuyAPI decrypt 192.168.178.32 ¸C}õ:É ÿ±Tzp L>!, 10 +8ms TuyAPI Disconnect +2ms (node:5928) UnhandledPromiseRejectionWarning: ¸C}õ:É ÿ±Tzp L>!, (node:5928) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:5928) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. TuyAPI Socket closed: 192.168.178.32 +11ms pi@raspberrypi:~ $
Am 02.02.2019 um 19:43 schrieb Max Isom notifications@github.com:
Hmm, unless you changed your NPM configuration I think that should have worked.
You can also try installing it to your current directory with npm i tuyapi (without the -g flag).
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.
Ok, your device is returning a packet that when translated into ASCII says json obj data unvalid
.
The packet you're sending looks fine, so the next step would be for you to capture a session of app activity with Wireshark and send it to me so I can compare the packets TuyAPI is sending with the packets the app sends.
I don’t know what you can read out of these... I used the capture filter "host 192.168.178.32" Is there a way to capture more packages as I’m noticing that these don’t change in any particular way?
Thanks for the screenshots, but they're all fundamentally the same packet the device is broadcasting to advertise its IP.
Try setting the filter to your phone's IP.
I’m sorry, but when I set the "host" filter to my iPhones ip and switch the breakers over the tuya app there is not anything to see in wireshark. I only get "HomeKit" stuff, nothing else. And literally nothing, no matter what I do with my phone...browsing, apps. Do I have to change something else with the filter?
You might be sniffing on the wrong interface. I think you need to be sniffing on a wireless interface that's connected to the same network your device is.
(I'm copy/pasting this into every open issue and PR.)
This plugin is now deprecated, as I don't have enough time to maintain it along with other TuyAPI related projects. Please use AMoo-Miki's homebridge-tuya-lan plugin instead. (Or, you can continue to use this plugin, but I will not be giving support or adding any new devices.)
I'm sorry about this, but this plugin is taking a disproportionate amount of my time that I believe is better spent making TuyAPI more stable and adding more tools to the ecosystem.
Closing; inactive thread. If you need support please re-open this issue.
Has anyone have any experience with these tuya WiFi breakers?
I’m getting a "no answer" in my home app on iOS while all my other devices are working fine and all ip’s and keys and addresses match the devices they should...
Config.json looks like this:
The last two devices are the ones not responding. I added "type" : "generic" to both of them but still no change
Anyone can help?