msillano / IoTwebUI

WEB APP for Tuya, with customizable functions that increase the performance of your IoT system
MIT License
1 stars 0 forks source link

INIT: Cannot set properties of null (setting 'rooms') #2

Open msillano opened 3 months ago

msillano commented 3 months ago

From CA-CAM, (original: https://github.com/msillano/TuyaUIweb/issues/2#issue-2306525246)

Buonasera,

ho variato il file BAT in 2 righe come segue: SET browser="C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" SET tuyaui="C:\TuyaUIweb.1.0\tuyaui.html"

ho variato il file config.js in 2 righe come segue: const client_id = "hue95........"; // here your ID const secretkey = "b34da.........."; // here your secret key

Ma qui cosa bisogna mettere? home è il nome del comune dell'installazione? device: è il device name o il device id come da progetto su https://eu.platform.tuya.com/cloud ? status: cosa bisogna mettere? righe: 1 per dispositivo?

{ home: "LOCALITA", device: "nome o ID", status""},

Per ora lanciando il BAT ricevo questo risultato: INIT ERROR see console...

Console: *** token expires in 01:35:46 tuyaui.html:433 TuyaUI init tuyaInterval: 60s, logInterval: 120s tuyaui.html:320 Init data log JSON @20:17:07 tuyaui.html:442 autosave option = 1h tuyaHTTP.js:33 Array(3) tuyaui.html:452 INIT ERROR TypeError: Cannot set properties of null (setting 'rooms') tuyaui.html:455 Uncaught INIT FATAL ERROR tuyaui.html:484 User action: dump all data tuyaui.html:485 Object tuyaui.html:484 User action: dump all data tuyaui.html:485 Object tuyaui.html:484 User action: dump all data tuyaui.html:485 Object tuyaui.html:484 User action: dump all data tuyaui.html:485 Object tuyaui.html:484 User action: dump all data tuyaui.html:485 Object tuyaui.html:484 User action: dump all data tuyaui.html:485 Object tuyaui.html:484 User action: dump all data tuyaui.html:485 Object tuyaui.html:332 Log polling @20:19:07 tuyaui.html:335 Uncaught TypeError: Cannot read properties of null (reading 'name') at tuyaui.html:335:39 at Array.forEach () at tuyaui.html:334:11 at Array.forEach () at logPolling (tuyaui.html:333:28)

Grazie mille.

msillano commented 3 months ago

(from: https://github.com/msillano/TuyaUIweb/issues/2) Dunque

Ok per le modifiche al file BAT ! Ok per le credenziali Tuya ! la riga *** token expires in 01:35:46 dimostra che hai l'accesso a Tuya. I messaggi di errore hanno un'altra origine. // comincia a mettete per escludere il LOG logFormat = "NONE" logInterval = 0

Nell'esempio fornito:

home: "ROMA", device: "TF_frigo", status:"va_temperatura" identificano una device-proprietà per il LOG Home e device sono nomi definiti dall'utente in SmartLife, mentre 'status' à definito dal device (lo vedi nel pop-up dei device)

In genere NON creano problemi, anche se non corrispondono ai dati presenti.

Direi che i messaggi di errore successivi (che NON dovrebbero apparire) sono causati dalla mancanza di definizioni di 'Home' o 'stanze' in Tuya Cloud (SmartLife).

Come workaround provvisorio, se NON basta escludere il LOG, prova a definire una home ed una room in SmartLife.

Cordialmente

msillano commented 2 months ago

I confirm: after further tests, the cause of this behavior is caused by an error in the "data_center" value in 'config.js': not consistent with the one used by SmartLife/Tuya. See https://github.com/tuya/tuya-home-assistant/wiki/Countries-Regions-and-Tuya-Data-Center

Sincerely In version 2.2 I will capture the error and add a specific warning.