ioBroker / ioBroker.history

manages state history
MIT License
29 stars 22 forks source link

changes in datapoints settings clears already made material.ui settings #45

Closed Diginix closed 4 years ago

Diginix commented 5 years ago

If material settings are made (datapoint JSON part custom) and you change history settings, the martial settings will be cleared. e.g. name, colorOn ...

Apollon77 commented 5 years ago

Can you please show a object JSON before and after history changes? Object JSON can be found at Objects -> then the relevant object use the pencil icon and then under "Raw"

Diginix commented 5 years ago

It's trivial to reproduce. Every edit of history settings of an object deletes the whole block "material" in its JSON.

Before: { "_id": "mihome.0.devices.magnet_********.state", "common": { "name": "Tür Eingang open", "role": "state", "write": false, "read": true, "type": "boolean", "custom": { "history.0": { "enabled": true, "changesOnly": true, "debounce": 0, "maxLength": "10", "retention": "31536000", "changesRelogInterval": 0, "changesMinDelta": 0, "aliasId": "" }, "material": { "admin": { "inverted": false, "useDefaultIcon": "", "name": "Eingang", "colorOn": "rgba(255,114,0,1)", "doubleSize": "", "colorOff": "rgba(81,161,0,0.7)", "icon": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkNhcGFfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgdmlld0JveD0iMCAwIDUxMiA1MTIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDUxMiA1MTI7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGc+Cgk8cGF0aCBkPSJNMjk4LjY2NywyOTguNjY3YzE3LjY0MywwLDMyLTE0LjM1NywzMi0zMmMwLTE3LjY0My0xNC4zNTctMzItMzItMzJjLTE3LjY0MywwLTMyLDE0LjM1Ny0zMiwzMgoJCUMyNjYuNjY3LDI4NC4zMDksMjgxLjAyNCwyOTguNjY3L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TMyYzAtMTcuNjQzLTE0LjM1Ny0zMi0zMi0zMmMtMTcuNjQzLDAtMzIsMTQuMzU3LTMyLDMyCgkJQzMwOS4zMzMsMjYyLjk3NiwzMjMuNjkxLDI3Ny4zMzMsMzQxLjMzMywyNzcuMzMzeiBNMzQxLjMzMywyMzQuNjY3YzUuODg4LDAsMTAuNjY3LDQuNzc5LDEwLjY2NywxMC42NjcKCQlTMzQ3LjIyMSwyNTYsMzQxLjMzMywyNTZzLTEwLjY2Ny00Ljc3OS0xMC42NjctMTAuNjY3UzMzNS40NDUsMjM0LjY2NywzNDEuMzMzLDIzNC42Njd6Ii8+CjwvZz4KPC9zdmc+Cg==", "background": "", "enabled": true } } } }, "type": "state", "native": {}, "from": "system.adapter.mihome.0", "ts": 1518632421275, "acl": { "object": 1636, "state": 1636, "owner": "system.user.admin", "ownerGroup": "system.group.administrator" }, "user": "system.user.admin" }

After: { "_id": "mihome.0.devices.magnet_********.state", "common": { "name": "Tür Eingang open", "role": "state", "write": false, "read": true, "type": "boolean", "custom": { "history.0": { "enabled": true, "changesOnly": true, "debounce": 0, "maxLength": "100", "retention": "31536000", "changesRelogInterval": 0, "changesMinDelta": 0, "aliasId": "" } } }, "type": "state", "native": {}, "from": "system.adapter.mihome.0", "ts": 1518632421275, "acl": { "object": 1636, "state": 1636, "owner": "system.user.admin", "ownerGroup": "system.group.administrator" }, "user": "system.user.admin" }

I have just changed the history setting for "how many states are stored in RAM" in the GUI. history_material1

My workaround is to edit all values in RAW instead using the GUI form.

Apollon77 commented 5 years ago

It is no history topic, it is material or js-controller ... normally other values in custom are preserved. There was a bug with this in js.controller <1.5.x ... BTW: which js-controller version do yo you use?

Diginix commented 5 years ago

JS Controller is 1.5.7 npm 6.4.1 nodejs 8.15.1

So, what can I do or where else should I open this again?

Apollon77 commented 5 years ago

I will check and take care.

Apollon77 commented 5 years ago

@GermanBluefox Do we need to have "supportsCustom" or such in io-package in material? Or would this just handle Admin stuff? Else we have a bug in js.controller regarding preserving of fields :-(

GermanBluefox commented 5 years ago

supportCustoms must be set

Apollon77 commented 5 years ago

@Diginix could you please verify it? Please edit in your local installation the file /opt/iobroker/node_modules/iobroker.material/io-package.json and add in the "common" part a

"supportCustoms": true

line.Then "iobroker upload material", maybe best restart js-controller

and try it again. :-)

Diginix commented 5 years ago

Unfortunately, that doesn't help. Attached the patched (line 227) io-package.json (renamed as TXT due to GIT restrictions). I have done an adapter upload, js controler restart and even a full system reboot.

io-package.json.txt

Apollon77 commented 5 years ago

Can you please verify that the new line is also in the adapter object?!

In Admin select expert mode and find object System.adapter.material.0 and Click pencil icon there in das it should be there but in native.

Diginix commented 5 years ago

It is there but in common (line 281).

{ "_id": "system.adapter.material.0", "type": "instance", "common": { "name": "material", "version": "0.10.6", "news": { "0.9.10": { "en": "in process" }, "0.9.9": { "en": "Order of tiles is implemented\nSupport of dwd data", "de": "Reihenfolge der Kacheln ist implementiert\nUnterstützung von DWD-Daten", "ru": "Выполняется заказ плитки\nПоддержка данных dwd", "pt": "Ordem de telhas é implementada\nSuporte de dados do dwd", "nl": "Orde van tegels is geïmplementeerd\nOndersteuning van dwd-gegevens", "fr": "L'ordre des carreaux est implémenté\nPrise en charge des données DWD", "it": "L'ordine delle piastrelle è implementato\nSupporto di dati DWD", "es": "Se implementa el orden de las fichas\nSoporte de datos dwd", "pl": "Kolejność płytek jest zaimplementowana\nObsługa danych DWD" }, "0.9.7": { "en": "Implemented the weather widget", "de": "Implementiert das Wetter Widget", "ru": "Реализован погодный виджет", "pt": "Implementou o widget do tempo", "nl": "De weerwidget geïmplementeerd", "fr": "Implémenté le widget météo", "it": "Implementato il widget meteo", "es": "Implementado el widget del clima", "pl": "Wdrożyłem widget pogody" }, "0.9.4": { "en": "Bug-fixes", "de": "Fehlerbehebung", "ru": "Исправление ошибок", "pt": "Correções de bugs", "nl": "Bugfixes", "fr": "Corrections de bogues", "it": "Bug-fix", "es": "Corrección de errores", "pl": "Poprawki błędów" }, "0.9.3": { "en": "Many changes", "de": "Viele Veränderungen", "ru": "Много изменений", "pt": "Muitas mudanças", "nl": "Veel veranderingen", "fr": "Beaucoup de changements", "it": "Molti cambiamenti", "es": "Muchos cambios", "pl": "Wiele zmian" }, "0.9.2": { "en": "Update logic was implemented", "de": "Update-Logik wurde implementiert", "ru": "Была реализована логика обновления", "pt": "A lógica de atualização foi implementada", "nl": "Update logica is geïmplementeerd", "fr": "La mise à jour a été implémentée", "it": "La logica di aggiornamento è stata implementata", "es": "Se implementó la lógica de actualización", "pl": "Zaktualizowana logika została zaimplementowana" }, "0.9.1": { "en": "Volume control was implemented", "de": "Lautstärkeregelung wurde implementiert", "ru": "Регулятор громкости был реализован", "pt": "Controle de volume foi implementado", "nl": "Volumeregeling is geïmplementeerd", "fr": "Le contrôle du volume a été implémenté", "it": "Il controllo del volume è stato implementato", "es": "Control de volumen fue implementado", "pl": "Kontrola głośności została wdrożona" }, "0.8.9": { "en": "React app" }, "0.5.7": { "en": "Ready for cloud services", "de": "Bereit für Cloud-Dienste", "ru": "Готов к облачным сервисам", "pt": "Pronto para serviços em nuvem", "nl": "Klaar voor cloudservices", "fr": "Prêt pour les services cloud", "it": "Pronto per i servizi cloud", "es": "Listo para servicios en la nube", "pl": "Gotowy do usług w chmurze" }, "0.5.6": { "en": "fix undefined names", "de": "Korrigiere undefinierte Namen", "ru": "Поправлены неопределённые имена" }, "0.5.3": { "en": "fix dimmer", "de": "Korrigiere Dimmer", "ru": "Поправлены диммеры" }, "0.5.2": { "en": "fix action icons", "de": "Korrigiere Zustandsbldchen", "ru": "Поправлены иконки" }, "0.5.1": { "en": "initial commit", "de": "initial commit", "ru": "initial commit" }, "0.9.11": { "en": "Fixed error with empty page", "de": "Fehler bei leerer Seite behoben", "ru": "Исправлена ​​ошибка с пустой страницей", "pt": "Corrigido erro com página vazia", "nl": "Vaste fout met lege pagina", "fr": "Erreur fixe avec page vide", "it": "Risolto errore con la pagina vuota", "es": "Se arregló el error con la página vacía", "pl": "Naprawiono błąd z pustą stroną" }, "0.9.12": { "en": "RGB was implemented", "de": "RGB wurde implementiert", "ru": "RGB был реализован", "pt": "RGB foi implementado", "nl": "RGB is geïmplementeerd", "fr": "RVB a été implémenté", "it": "RGB è stato implementato", "es": "RGB fue implementado", "pl": "Zaimplementowano RGB" }, "0.10.0": { "en": "RGB was corrected", "de": "RGB wurde korrigiert", "ru": "RGB был исправлен", "pt": "RGB foi corrigido", "nl": "RGB is gecorrigeerd", "fr": "RVB a été corrigé", "it": "RGB è stato corretto", "es": "RGB fue corregido", "pl": "RGB zostało poprawione" }, "0.10.1": { "en": "GUI corrections", "de": "GUI-Korrekturen", "ru": "Исправления GUI", "pt": "Correções da GUI", "nl": "GUI-correcties", "fr": "Corrections GUI", "it": "Correzioni della GUI", "es": "Correcciones GUI", "pl": "Poprawki GUI" }, "0.10.2": { "en": "Color temperature was implemented\nCache of objects was implemented", "de": "Farbtemperatur wurde implementiert\nCache von Objekten wurde implementiert", "ru": "Цветовая температура была реализована\nБыл реализован кеш объектов", "pt": "Temperatura de cor foi implementada\nCache de objetos foi implementado", "nl": "Kleurtemperatuur is geïmplementeerd\nCache met objecten is geïmplementeerd", "fr": "La température de couleur a été mise en œuvre\nLe cache des objets a été implémenté", "it": "La temperatura del colore è stata implementata\nLa cache degli oggetti è stata implementata", "es": "La temperatura del color fue implementada\nSe implementó el caché de objetos", "pl": "Wprowadzono temperaturę kolorów\nPamięć podręczna obiektów została zaimplementowana" }, "0.10.3": { "en": "Color temperature was implemented\nCache of objects was implemented", "de": "Farbtemperatur wurde implementiert\nCache von Objekten wurde implementiert", "ru": "Цветовая температура была реализована\nБыл реализован кеш объектов", "pt": "Temperatura de cor foi implementada\nCache de objetos foi implementado", "nl": "Kleurtemperatuur is geïmplementeerd\nCache met objecten is geïmplementeerd", "fr": "La température de couleur a été mise en œuvre\nLe cache des objets a été implémenté", "it": "La temperatura del colore è stata implementata\nLa cache degli oggetti è stata implementata", "es": "La temperatura del color fue implementada\nSe implementó el caché de objetos", "pl": "Wprowadzono temperaturę kolorów\nPamięć podręczna obiektów została zaimplementowana" }, "0.10.4": { "en": "The error with settings was fixed", "de": "Der Fehler bei den Einstellungen wurde behoben", "ru": "Исправлена ​​ошибка с настройками", "pt": "O erro com as configurações foi corrigido", "nl": "De fout met de instellingen was verholpen", "fr": "L'erreur avec les paramètres a été corrigée", "it": "L'errore con le impostazioni è stato corretto", "es": "El error con la configuración fue arreglado", "pl": "Naprawiono błąd związany z ustawieniami" }, "0.10.5": { "en": "The error with settings was fixed", "de": "Der Fehler bei den Einstellungen wurde behoben", "ru": "Исправлена ​​ошибка с настройками", "pt": "O erro com as configurações foi corrigido", "nl": "De fout met de instellingen was verholpen", "fr": "L'erreur avec les paramètres a été corrigée", "it": "L'errore con le impostazioni è stato corretto", "es": "El error con la configuración fue arreglado", "pl": "Naprawiono błąd związany z ustawieniami" }, "0.10.6": { "en": "Added Chinese support", "de": "Chinesische Unterstützung hinzugefügt", "ru": "Добавлена ​​поддержка китайского", "pt": "Adicionado suporte chinês", "nl": "Chinese ondersteuning toegevoegd", "fr": "Ajout du support chinois", "it": "Aggiunto supporto cinese", "es": "Añadido soporte chino", "pl": "Dodano chińskie wsparcie", "zh-cn": "增加了中文支持" } }, "title": "Material UI", "desc": { "en": "Material UI based ioBroker user interface", "de": "ioBroker GUI für mobile Geräte auf dem Basis von Material UI", "ru": "ioBroker визуализация для мобильных устройств на Material UI", "pt": "Interface de usuário ioBroker baseada em UI de material", "nl": "Materiaal UI gebaseerde gebruikersinterface van ioBroker", "fr": "Interface utilisateur ioBroker basée sur l'interface utilisateur matérielle", "it": "Interfaccia utente ioBroker basata su UI materiale", "es": "Interfaz de usuario ioBroker basada en IU de material", "pl": "Interfejs użytkownika ioBroker oparty na interfejsie użytkownika", "zh-cn": "基于Material UI的ioBroker用户界面" }, "platform": "javascript/Node.js", "onlyWWW": "true", "loglevel": "info", "icon": "material.png", "enabled": true, "extIcon": "https://raw.githubusercontent.com/ioBroker/ioBroker.material/master/admin/material.png", "keywords": [ "user", "interface", "webapp", "jquerymobile", "ui" ], "readme": "https://github.com/ioBroker/ioBroker.material/blob/master/README.md", "singleton": true, "preserveSettings": "material", "nogit": true, "webPreSettings": { "materialBackground": "native.loadingBackground" }, "authors": [ "bluefox <dogafox@gmail.com>" ], "dependencies": [ { "web": ">=2.4.1" } ], "localLink": "%web_protocol%://%ip%:%web_port%/material/index.html", "type": "visualization", "license": "CC-BY-NC", "noConfig": true, "eraseOnUpload": true, "webByVersion": true, "welcomeScreen": { "link": "material/index.html", "name": "material", "img": "material.admin/material.png", "color": "black", "order": 2 }, "installedVersion": "0.10.6", "host": "BT3-PRO", "custom": { "material": { "admin": { "instances": true, "text2command": "0", "menuBackground": "rgba(51,51,51,1)", "ignoreIndicators": "", "startEnum": "enum.functions.fenster", "noCache": false, "debug": false } } }, "supportCustoms": true }, "native": { "loadingBackground": "rgba(51,51,51,1)" }, "from": "system.host.BT3-PRO.cli", "ts": 1555240965510, "acl": { "object": 1636, "owner": "system.user.admin", "ownerGroup": "system.group.administrator" }, "user": "system.user.admin", "enums": {} }

Apollon77 commented 5 years ago

Yes common is correct. My fault. Hm ...

Apollon77 commented 5 years ago

@GermanBluefox Any idea?

Diginix commented 4 years ago

Issue besteht weiterhin und ist nun neu im JS-Controller geöffnet: https://github.com/ioBroker/ioBroker.js-controller/issues/544