Closed hughfr4nc15 closed 4 months ago
Any resolution for this Issue?
Not on my side. Disabled the add-on for now... You're also experiencing it?
Which plugin are you using instead? Yes it's quite strange. It was working until a few weeks ago, same IR Controller with a different IR Device (AC)
Ah yes indeed. As you mentioned in the issue, it's after the Node JS Update
Which plugin are you using instead?
Yes it's quite strange. It was working until a few weeks ago, same IR Controller with a different IR Device (AC)
None at the moment.
Ah yes indeed. As you mentioned in the issue, it's after the Node JS Update
Maybe a rollback will solve the issue?
I have tested this again today. It's working absolutely fine for me. I am running on latest node and homebridge version. Can you please try putting your homebridge with debug logs to get more insight into what's happening under the hood?
I can try to do that. Not sure if it matters but I run my HB on a Windows machine.
Hi. Any resolution?
I have tested this again today. It's working absolutely fine for me. I am running on latest node and homebridge version. Can you please try putting your homebridge with debug logs to get more insight into what's happening under the hood?
Adding Tuya plugin logs in debug mode.
_[19/12/2023, 01:28:17] [TuyaIR] Initializing TuyaIR platform... [19/12/2023, 01:28:17] [TuyaIR] Initializing child bridge 0E:74:1D:D4:6E:8C [19/12/2023, 01:28:18] [TuyaIR] Launched child bridge with PID 13936 [19/12/2023, 01:28:18] Registering platform 'homebridge-tuya-ir.TuyaIR' [19/12/2023, 01:28:18] [TuyaIR] Loaded homebridge-tuya-ir v1.1.0 child bridge successfully [19/12/2023, 01:28:18] [TuyaIR] Finished initializing platform: TuyaIR [19/12/2023, 01:28:18] [TuyaIR] Loading accessory from cache: Air Conditioner [19/12/2023, 01:28:18] [TuyaIR] Loading accessory from cache: Air Conditioner [19/12/2023, 01:28:18] [TuyaIR] Loading accessory from cache: Air Conditioner [19/12/2023, 01:28:18] Publishing bridge accessory (name: TuyaIR, publishInfo: { username: '0E:74:1D:D4:6E:8C', port: 44305, pincode: '*-*-', category: 2, bind: [ 'Ethernet', [length]: 1 ], mdns: undefined, addIdentifyingMaterial: true, advertiser: 'bonjour-hap' }). [19/12/2023, 01:28:18] [TuyaIR] Executed didFinishLaunching callback [19/12/2023, 01:28:18] [TuyaIR] Starting discovery... [19/12/2023, 01:28:18] [TuyaIR] Starting discovery for device number 0 [19/12/2023, 01:28:18] [TuyaIR] Trying to login for index 0... [19/12/2023, 01:28:18] [TuyaIR] Logging in to the the server https://openapi.tuyaeu.com... [19/12/2023, 01:28:18] [TuyaIR] {"url":"https://openapi.tuyaeu.com/v1.0/token?grant_type=1","headers":{"client_id":"jvac84gxmmeahuucnmwx","sign":"35322765146946F95EC31B6B4AA2B2D3348A3AA8CB4AA20EBCD97A4558D08D56","t":1702949298282,"sign_method":"HMAC-SHA256","nonce":""}} [19/12/2023, 01:28:18] [TuyaIR] {"result":{"access_token":"215a8e23e3358539fc50fe0c34c3b4fa","expire_time":7002,"refresh_token":"233b011156ff5884e1729ff886e86ce3","uid":"bay1669857395525yklj"},"success":true,"t":1702949298828,"tid":"e3c578009e0d11ee9e170225947fc7de"} [19/12/2023, 01:28:18] [TuyaIR] API call successful. [19/12/2023, 01:28:18] [TuyaIR] Login successful. [19/12/2023, 01:28:18] [TuyaIR] Fetching configured remotes... [19/12/2023, 01:28:18] [TuyaIR] This is the config: {"tuyaAPIClientId":"jvac84gxmmeahuucnmwx","tuyaAPISecret":"d4a8d3cfe55542c383e5bd1e53b926f7","deviceRegion":"eu","irDeviceId":"bf4a4541a8bdbb61d2bpfa","autoFetchRemotesFromServer":false,"configuredRemotes":[{"id":"bf36ee721ea886ce16x87k","model":"AC","brand":"Mitsubushi"}],"apiHost":"https://openapi.tuyaeu.com"} [19/12/2023, 01:28:18] [TuyaIR] Auto discovery of remotes disabled... [19/12/2023, 01:28:18] [TuyaIR] https://openapi.tuyaeu.com/v1.0/devices/bf36ee721ea886ce16x87k [19/12/2023, 01:28:18] [TuyaIR] Calling endpoint https://openapi.tuyaeu.com/v1.0/devices/bf36ee721ea886ce16x87k with payload {} [19/12/2023, 01:28:18] [TuyaIR] API call successful. {"result":{"active_time":1669457078,"biz_type":0,"category":"infrared_ac","create_time":1669457078,"icon":"smart/ir/icon/9knfrm4eawao.png","id":"bf36ee721ea886ce16x87k","ip":"","lat":"39.0448","local_key":"819240adbb210266","lon":"-9.2714","model":"","name":"Air Conditioner","node_id":"ff17a29e749a89ae","online":true,"owner_id":"68274801","product_id":"0000008vhd","product_name":"Air Conditioner","status":[],"sub":true,"time_zone":"+00:00","uid":"eu1665788555662CnNxG","update_time":1702781717,"uuid":"bf36ee721ea886ce16x87k"},"success":true,"t":1702949298941,"tid":"e3cfc1e99e0d11ee987e1ab7f84032e6"} [19/12/2023, 01:28:18] [TuyaIR] Restoring existing accessory from cache: Air Conditioner [19/12/2023, 01:28:18] [TuyaIR] Getting AC Status [19/12/2023, 01:28:18] [TuyaIR] Calling endpoint https://openapi.tuyaeu.com/v2.0/infrareds/bf4a4541a8bdbb61d2bpfa/remotes/bf36ee721ea886ce16x87k/ac/status with payload {} [19/12/2023, 01:28:18] [TuyaIR] Calling endpoint https://openapi.tuyaeu.com/v1.0/iot-03/devices/bf36ee721ea886ce16x87k/specification with payload {} [19/12/2023, 01:28:18] [TuyaIR] Starting discovery for device number 1 [19/12/2023, 01:28:18] [TuyaIR] Trying to login for index 1... [19/12/2023, 01:28:18] [TuyaIR] Logging in to the the server https://openapi.tuyaeu.com... [19/12/2023, 01:28:18] [TuyaIR] {"url":"https://openapi.tuyaeu.com/v1.0/token?grant_type=1","headers":{"client_id":"jvac84gxmmeahuucnmwx","sign":"C00B4693654265EB5FC0DD9B404B4974201632C3D697C2C87DCD7FA060F1BA06","t":1702949298681,"sign_method":"HMAC-SHA256","nonce":""}} [19/12/2023, 01:28:18] [TuyaIR] Api call failed with response code 400 [19/12/2023, 01:28:18] [TuyaIR] {"result":{"access_token":"215a8e23e3358539fc50fe0c34c3b4fa","expire_time":7001,"refresh_token":"233b011156ff5884e1729ff886e86ce3","uid":"bay1669857395525yklj"},"success":true,"t":1702949299116,"tid":"e3f134f99e0d11ee987e1ab7f84032e6"} [19/12/2023, 01:28:18] [TuyaIR] API call successful. [19/12/2023, 01:28:18] [TuyaIR] Login successful. [19/12/2023, 01:28:18] [TuyaIR] Fetching configured remotes... [19/12/2023, 01:28:18] [TuyaIR] This is the config: {"tuyaAPIClientId":"jvac84gxmmeahuucnmwx","tuyaAPISecret":"d4a8d3cfe55542c383e5bd1e53b926f7","deviceRegion":"eu","irDeviceId":"bf629be515137cf72ewjqu","autoFetchRemotesFromServer":false,"configuredRemotes":[{"id":"bf2425fd1181d3fdfctt0o","model":"AC","brand":"Mitsubishi"}],"apiHost":"https://openapi.tuyaeu.com"} [19/12/2023, 01:28:18] [TuyaIR] Auto discovery of remotes disabled... [19/12/2023, 01:28:18] [TuyaIR] https://openapi.tuyaeu.com/v1.0/devices/bf2425fd1181d3fdfctt0o [19/12/2023, 01:28:18] [TuyaIR] Calling endpoint https://openapi.tuyaeu.com/v1.0/devices/bf2425fd1181d3fdfctt0o with payload {} [19/12/2023, 01:28:18] [TuyaIR] API call successful. {"result":{"category":"infrared_ac","functions":[{"code":"F","desc":"{\"min\":0,\"max\":3,\"scale\":0,\"step\":1,\"type\":\"Integer\"}","name":"fan speed","type":"ENUM","values":"{\"min\":0,\"max\":3,\"scale\":0,\"step\":1,\"type\":\"Integer\"}"},{"code":"M","desc":"{\"min\":0,\"max\":4,\"scale\":0,\"step\":1,\"type\":\"Integer\"}","name":"mode","type":"ENUM","values":"{\"min\":0,\"max\":4,\"scale\":0,\"step\":1,\"type\":\"Integer\"}"},{"code":"PowerOff","desc":"PowerOff","name":"PowerOff","type":"STRING","values":"PowerOff"},{"code":"PowerOn","desc":"PowerOn","name":"PowerOn","type":"STRING","values":"PowerOn"},{"code":"T","desc":"{\"min\":16,\"max\":30,\"scale\":0,\"step\":1,\"type\":\"Integer\"}","name":"temperature","type":"ENUM","values":"{\"min\":16,\"max\":30,\"scale\":0,\"step\":1,\"type\":\"Integer\"}"}],"status":[{"code":"wind","type":"ENUM","values":"{\"min\":0,\"max\":3,\"scale\":0,\"step\":1,\"type\":\"Integer\"}"},{"code":"mode","type":"ENUM","values":"{\"min\":0,\"max\":4,\"scale\":0,\"step\":1,\"type\":\"Integer\"}"},{"code":"power","type":"BOOLEAN","values":"{}"},{"code":"temp","type":"ENUM","values":"{\"min\":16,\"max\":30,\"scale\":0,\"step\":1,\"type\":\"Integer\"}"}]},"success":true,"t":1702949299200,"tid":"e3fa138d9e0d11ee9e170225947fc7de"} [19/12/2023, 01:28:18] [TuyaIR] Minimum Temperature: 16 [19/12/2023, 01:28:18] [TuyaIR] Maximum Temperature: 30 [19/12/2023, 01:28:18] [TuyaIR] API call successful. {"result":{"active_time":1669400666,"biz_type":0,"category":"infrared_ac","create_time":1669400484,"icon":"smart/ir/icon/9knfrm4eawao.png","id":"bf2425fd1181d3fdfctt0o","ip":"","lat":"39.0447","local_key":"bdb958034124a7ab","lon":"-9.2715","model":"","name":"Air Conditioner","node_id":"ff17a29e749a89ae","online":true,"owner_id":"68274801","product_id":"0000008vhd","product_name":"Air Conditioner","status":[],"sub":true,"time_zone":"+00:00","uid":"eu1665788555662CnNxG","update_time":1702812569,"uuid":"bf2425fd1181d3fdfctt0o"},"success":true,"t":1702949299225,"tid":"e3fae9629e0d11ee987e1ab7f84032e6"} [19/12/2023, 01:28:18] [TuyaIR] Restoring existing accessory from cache: Air Conditioner [19/12/2023, 01:28:18] [TuyaIR] Getting AC Status [19/12/2023, 01:28:18] [TuyaIR] Calling endpoint https://openapi.tuyaeu.com/v2.0/infrareds/bf629be515137cf72ewjqu/remotes/bf2425fd1181d3fdfctt0o/ac/status with payload {} [19/12/2023, 01:28:18] [TuyaIR] Calling endpoint https://openapi.tuyaeu.com/v1.0/iot-03/devices/bf2425fd1181d3fdfctt0o/specification with payload {} [19/12/2023, 01:28:18] [TuyaIR] Starting discovery for device number 2 [19/12/2023, 01:28:18] [TuyaIR] Trying to login for index 2... [19/12/2023, 01:28:18] [TuyaIR] Logging in to the the server https://openapi.tuyaeu.com... [19/12/2023, 01:28:18] [TuyaIR] {"url":"https://openapi.tuyaeu.com/v1.0/token?grant_type=1","headers":{"client_id":"jvac84gxmmeahuucnmwx","sign":"9F51C31FA9AE26FA62592F104DF86D26508B2C851BA33787D44EBE9079BD1BBD","t":1702949298962,"sign_method":"HMAC-SHA256","nonce":""}} [19/12/2023, 01:28:18] [TuyaIR] Api call failed with response code 400 [19/12/2023, 01:28:19] [TuyaIR] {"result":{"access_token":"215a8e23e3358539fc50fe0c34c3b4fa","expire_time":7001,"refresh_token":"233b011156ff5884e1729ff886e86ce3","uid":"bay1669857395525yklj"},"success":true,"t":1702949299404,"tid":"e41ce35d9e0d11ee987e1ab7f84032e6"} [19/12/2023, 01:28:19] [TuyaIR] API call successful. [19/12/2023, 01:28:19] [TuyaIR] Login successful. [19/12/2023, 01:28:19] [TuyaIR] Fetching configured remotes... [19/12/2023, 01:28:19] [TuyaIR] This is the config: {"tuyaAPIClientId":"jvac84gxmmeahuucnmwx","tuyaAPISecret":"d4a8d3cfe55542c383e5bd1e53b926f7","deviceRegion":"eu","irDeviceId":"bff273552268d2b41fvkxk","autoFetchRemotesFromServer":false,"configuredRemotes":[{"id":"bf1cd2ae53eaa1b043gjkt","model":"AC","brand":"Mitsubishi"}],"apiHost":"https://openapi.tuyaeu.com"} [19/12/2023, 01:28:19] [TuyaIR] Auto discovery of remotes disabled... [19/12/2023, 01:28:19] [TuyaIR] https://openapi.tuyaeu.com/v1.0/devices/bf1cd2ae53eaa1b043gjkt [19/12/2023, 01:28:19] [TuyaIR] Calling endpoint https://openapi.tuyaeu.com/v1.0/devices/bf1cd2ae53eaa1b043gjkt with payload {} [19/12/2023, 01:28:19] [TuyaIR] API call successful. {"result":{"category":"infrared_ac","functions":[{"code":"F","desc":"{\"min\":0,\"max\":3,\"scale\":0,\"step\":1,\"type\":\"Integer\"}","name":"fan speed","type":"ENUM","values":"{\"min\":0,\"max\":3,\"scale\":0,\"step\":1,\"type\":\"Integer\"}"},{"code":"M","desc":"{\"min\":0,\"max\":4,\"scale\":0,\"step\":1,\"type\":\"Integer\"}","name":"mode","type":"ENUM","values":"{\"min\":0,\"max\":4,\"scale\":0,\"step\":1,\"type\":\"Integer\"}"},{"code":"PowerOff","desc":"PowerOff","name":"PowerOff","type":"STRING","values":"PowerOff"},{"code":"PowerOn","desc":"PowerOn","name":"PowerOn","type":"STRING","values":"PowerOn"},{"code":"T","desc":"{\"min\":16,\"max\":30,\"scale\":0,\"step\":1,\"type\":\"Integer\"}","name":"temperature","type":"ENUM","values":"{\"min\":16,\"max\":30,\"scale\":0,\"step\":1,\"type\":\"Integer\"}"}],"status":[{"code":"wind","type":"ENUM","values":"{\"min\":0,\"max\":3,\"scale\":0,\"step\":1,\"type\":\"Integer\"}"},{"code":"mode","type":"ENUM","values":"{\"min\":0,\"max\":4,\"scale\":0,\"step\":1,\"type\":\"Integer\"}"},{"code":"power","type":"BOOLEAN","values":"{}"},{"code":"temp","type":"ENUM","values":"{\"min\":16,\"max\":30,\"scale\":0,\"step\":1,\"type\":\"Integer\"}"}]},"success":true,"t":1702949299414,"tid":"e41b953c9e0d11ee9e170225947fc7de"} [19/12/2023, 01:28:19] [TuyaIR] Minimum Temperature: 16 [19/12/2023, 01:28:19] [TuyaIR] Maximum Temperature: 30 [19/12/2023, 01:28:19] [TuyaIR] API call successful. {"result":{"active_time":1665788973,"biz_type":0,"category":"infrared_ac","create_time":1665783882,"icon":"smart/ir/icon/9knfrm4eawao.png","id":"bf1cd2ae53eaa1b043gjkt","ip":"","lat":"39.0447","local_key":"456c18a78be6cedb","lon":"-9.2714","model":"","name":"Air Conditioner","node_id":"ff17a29e749a89ae","online":true,"owner_id":"68274801","product_id":"0000008vhd","product_name":"Air Conditioner","status":[],"sub":true,"time_zone":"+01:00","uid":"eu1665788555662CnNxG","update_time":1702770327,"uuid":"bf1cd2ae53eaa1b043gjkt"},"success":true,"t":1702949299513,"tid":"e426e9279e0d11ee987e1ab7f84032e6"} [19/12/2023, 01:28:19] [TuyaIR] Restoring existing accessory from cache: Air Conditioner [19/12/2023, 01:28:19] [TuyaIR] Getting AC Status [19/12/2023, 01:28:19] [TuyaIR] Calling endpoint https://openapi.tuyaeu.com/v2.0/infrareds/bff273552268d2b41fvkxk/remotes/bf1cd2ae53eaa1b043gjkt/ac/status with payload {} [19/12/2023, 01:28:19] [TuyaIR] Calling endpoint https://openapi.tuyaeu.com/v1.0/iot-03/devices/bf1cd2ae53eaa1b043gjkt/specification with payload {} [19/12/2023, 01:28:19] [TuyaIR] Api call failed with response code 400 [19/12/2023, 01:28:19] [TuyaIR] API call successful. {"result":{"category":"infraredac","functions":[{"code":"F","desc":"{\"min\":0,\"max\":3,\"scale\":0,\"step\":1,\"type\":\"Integer\"}","name":"fan speed","type":"ENUM","values":"{\"min\":0,\"max\":3,\"scale\":0,\"step\":1,\"type\":\"Integer\"}"},{"code":"M","desc":"{\"min\":0,\"max\":4,\"scale\":0,\"step\":1,\"type\":\"Integer\"}","name":"mode","type":"ENUM","values":"{\"min\":0,\"max\":4,\"scale\":0,\"step\":1,\"type\":\"Integer\"}"},{"code":"PowerOff","desc":"PowerOff","name":"PowerOff","type":"STRING","values":"PowerOff"},{"code":"PowerOn","desc":"PowerOn","name":"PowerOn","type":"STRING","values":"PowerOn"},{"code":"T","desc":"{\"min\":16,\"max\":30,\"scale\":0,\"step\":1,\"type\":\"Integer\"}","name":"temperature","type":"ENUM","values":"{\"min\":16,\"max\":30,\"scale\":0,\"step\":1,\"type\":\"Integer\"}"}],"status":[{"code":"wind","type":"ENUM","values":"{\"min\":0,\"max\":3,\"scale\":0,\"step\":1,\"type\":\"Integer\"}"},{"code":"mode","type":"ENUM","values":"{\"min\":0,\"max\":4,\"scale\":0,\"step\":1,\"type\":\"Integer\"}"},{"code":"power","type":"BOOLEAN","values":"{}"},{"code":"temp","type":"ENUM","values":"{\"min\":16,\"max\":30,\"scale\":0,\"step\":1,\"type\":\"Integer\"}"}]},"success":true,"t":1702949299819,"tid":"e45a10729e0d11ee987e1ab7f84032e6"} [19/12/2023, 01:28:19] [TuyaIR] Minimum Temperature: 16 [19/12/2023, 01:28:19] [TuyaIR] Maximum Temperature: 30
Hello, anyone managed to solve this?
EDIT: Seems that I solved my problem with a different plugin.
Just to chime in, I accidentally updated node and HB, and experiencing the same issue now. Running on Raspbian, i.e. it's not an environment issue, but some interaction between plugin, node and HB. Will try downgrading now to see what can fix it.
okay, downgrading node to v18 and HB to 1.6.1 fixed the issue. I'm never upgrading HB again, as my whole home walks sideways now because of the latest upgrade.
I've just arrived here with my cheapo IR blaster and I thought it would never just work "out-of-the-box" ... after doing the Tuya API Cloud App dance ... It KIND OF did!! I'm amazed beyond words. Either way, I see the 400 error too in my log, but like I wrote, my Air Conditioner shows up in Homebridge and in Apple Home and can be controlled.
I will do some debugging and see if I can track the reason for the error down.
n.b. I'm using Homebridge v1.8.1 on Node.js v20.11.1.
UPDATE Nope, nothing. I added some extra http header dumps and proceeded to replay the requests logged just before the error, but they work just fine using e.g. curl/httpie/postman.
UPDATE 2 Okay I see what the problem is - patched.
Setting up the Plugin to run as a Child Bridge did the trick for me
Setting up the Plugin to run as a Child Bridge did the trick for me
It corrected the 400 error? What versions are you using?
What @gurmeherchawla did might have also been what "fixed" (i.e. made it work despite-) the 400 error for me.
Mine is also on a child bridge, as per general best practice.
Is there a fix for this issue?
Hello,
I believe that after I updated Node JS, npm and HB to the latest versions I started having this issue where the AC Temperature shows correctly on the Tuya app but does not replicate to Apple Home. ALso the following error shows up in the logs...
[16/11/2023, 00:36:22] Homebridge v1.7.0 (HAP v0.11.1) (Homebridge) is running on port 51859. [16/11/2023, 00:36:22] [Tuya IR] Launched child bridge with PID 11068 [16/11/2023, 00:36:22] Registering platform 'homebridge-tuya-ir.TuyaIR' [16/11/2023, 00:36:22] [Tuya IR] Loaded homebridge-tuya-ir v1.1.0 child bridge successfully [16/11/2023, 00:36:22] Loaded 0 cached accessories from cachedAccessories.0E6A6C842CCD. [16/11/2023, 00:36:22] [Tuya IR] Starting discovery... [16/11/2023, 00:36:22] [Tuya IR] Trying to login for index 0... [16/11/2023, 00:36:22] Homebridge v1.7.0 (HAP v0.11.1) (Tuya IR) is running on port 53505. [16/11/2023, 00:36:22] Homebridge v1.7.0 (HAP v0.11.1) (Shelly NG) is running on port 59877. [16/11/2023, 00:36:23] [Tuya IR] Login successful. [16/11/2023, 00:36:23] [Tuya IR] Fetching configured remotes... [16/11/2023, 00:36:23] [Tuya IR] Auto discovery of remotes enabled. Fetching with API... [16/11/2023, 00:36:23] [Tuya IR] Adding new accessory: Air Conditioner [16/11/2023, 00:36:23] [Tuya IR] Trying to login for index 1... [16/11/2023, 00:36:23] [Tuya IR] Api call failed with response code 400 [16/11/2023, 00:36:23] [Tuya IR] Login successful. [16/11/2023, 00:36:23] [Tuya IR] Fetching configured remotes... [16/11/2023, 00:36:23] [Tuya IR] Auto discovery of remotes enabled. Fetching with API... [16/11/2023, 00:36:24] [Tuya IR] Adding new accessory: Air Conditioner [16/11/2023, 00:36:24] [Tuya IR] Trying to login for index 2... [16/11/2023, 00:36:24] [Tuya IR] Api call failed with response code 400 [16/11/2023, 00:36:24] [Tuya IR] Login successful. [16/11/2023, 00:36:24] [Tuya IR] Fetching configured remotes... [16/11/2023, 00:36:24] [Tuya IR] Auto discovery of remotes enabled. Fetching with API... [16/11/2023, 00:36:24] [Tuya IR] Adding new accessory: Air Conditioner [16/11/2023, 00:36:24] [Tuya IR] Api call failed with response code 400 [16/11/2023, 00:36:41] [Tuya IR] Air Conditioner is now On [16/11/2023, 00:36:43] [Tuya IR] Air Conditioner is now Off
Can someone please help?