Comments (4)
The MQTT server can already store arbitrary JSON objects in arbitrary topics. For this, the retain flag of the message must be set. The payload must be structured as follows: {"v":{ any valid JSON object }}
However, the messages with retain flag are currently not yet persisted between restarts.
Another idea is to use a CCU system variable of type string to store and retrieve a stringified JSON object.
from ccu-jack.
MQTT retain would require to set it up once on startup. Thus I would have the necessity of a startup routine which holds the configuration. I want to keep the ui config (and ideally the broker IP, too) out of the react app.
I would appreciate the "string" variable path. For this I dont need the mqtt access, as the config might be big (currently I fetch it on load initially and create a device tree context with paths similar to the mqtt topics. So the value updates are done on mqtt websocket receive.
With this I would be able to configure the ui in the CCU3 without other dependencies and keep config code out of the project.
from ccu-jack.
This is already all possible as follows:
When loading the application, the configuration can be read out from a specific system variable via HTTP-GET, e.g. on the address /sysvar/1234/~pv
. For this purpose, the ID of the system variable must be known. The ID can be determined via an HTTP GET on address /sysvar
(system variable name must match property title
).
If the web application is provided by the CCU-Jack itself, the host name does not have to be configured. The web application can be copied into the subdirectory webui
.
from ccu-jack.
Thanks for clarification (and the web app path tip). For the record: Placing JSON in a string variable can cause code (JS) injection if someone is able to set the variable. Sparetime is rare but it works currently this way...
from ccu-jack.
Related Issues (20)
- Virtuelle Geräte: Leistungsmessung / Stromzähler
- Abhängigkeiten aktualisiert (Fehlerbehebungen, Performance, Sicherheit, ...)
- Erstinstallation auf CCU3 HOT 8
- Datenpunkt für Duty-Cycle der CCU HOT 4
- Senden der Log-Meldungen an einen SYSLOG-Server
- Umrechnung von Werten aus MQTT-Nachrichten
- Shelly Dimmer 2 HOT 19
- Läuft eine der Installationsvarianten auf dem Tinkerboard 2? HOT 2
- Nicht konforme Antwort vom HAP-HomeMatic Add-On ignorieren
- Home Assistant MQTT Autodiscovery HOT 1
- mqtt-server address not processed correct HOT 2
- Fehler in der Anleitung zur Anbindung eines Shelly Dimmer 2 HOT 1
- Zeige auch die von extern angelegten Topics im Navigator HOT 1
- Zeitstempel unter /~vendor/refresh HOT 1
- Decoding of connect message failed: EOF HOT 5
- Authentifizierung über die Benutzerverwaltung der CCU
- Authentifizierten Zugriff auf die Web-UI/API erzwingen
- CCU ruft undokumentierte Funktion firmwareUpdateStatusChanged auf
- Automatisches Anlegen der virtuellen Geräte für Shellies o.ä.
- Virtuelle Geräte: Funk-Türschlossantrieb KeyMatic HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ccu-jack.