Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] Tool to edit easily json payloads for MQTT #578

Open
Jinuts opened this issue Jul 22, 2024 · 0 comments
Open

[FEATURE REQUEST] Tool to edit easily json payloads for MQTT #578

Jinuts opened this issue Jul 22, 2024 · 0 comments
Labels
feature request New feature or request

Comments

@Jinuts
Copy link

Jinuts commented Jul 22, 2024

Feature Request

Is your feature request related to a problem?

I often edit MQTT payloads in Home assistant, I can write it from the documentation.
It would be easier for me to fill a form with data I want and then copy paste the payload

Describe the solution / feature you'd like

I did a proof of concept using a JSON schema editor - here is a link to see the result

I guess it would be nice to maintain one schema and to share it together

Describe alternatives you've considered

I tried it with json-editor, I guess there are plugin in visual studio code, but an online solution seems easier

Additional context

I wrote this schema ; I hope it can help someone ; thanks for the good work of the team :)

{
"title": "App/Notify : [PREFIX]/custom/[appname] ; [PREFIX]/notify",
"type": "object",
"required": [],
"properties": {
"text": {
"type": "string",
"description": "The text to display. Keep in mind the font does not have a fixed size and I uses less space than W. This facts affects when text will start scrolling",
"minLength": 0,
"default": null
},
"textCase": {
"type": "integer",
"description": "Changes the Uppercase setting. 0=global setting, 1=forces uppercase; 2=shows as it sent.",
"default": 0,
"minimum": 0,
"maximum": 2
},
"topText": {
"type": "boolean",
"description": "Draw the text on top.",
"default": false
},
"textOffset": {
"type": "integer",
"description": "Sets an offset for the x position of a starting text.",
"default": 0
},
"center": {
"type": "boolean",
"description": "Centers a short, non-scrollable text.",
"default": true
},
"color": {
"type": "string",
"format": "color",
"description": "The text, bar or line color.",
"default": null
},
"gradient": {
"type": "array",
"format": "table",
"description": "Colorizes the text in a gradient of two given colors",
"items": {
"type": "string"
},
"default": null
},
"blinkText": {
"type": "integer",
"description": "Blinks the text in an given interval in ms, not compatible with gradient or rainbow",
"default": null
},
"fadeText": {
"type": "integer",
"description": "Fades the text on and off in an given interval, not compatible with gradient or rainbow",
"default": null
},
"background": {
"type": "string",
"format": "color",
"description": "Sets a background color.",
"default": null
},
"rainbow": {
"type": "boolean",
"description": "Fades each letter in the text differently through the entire RGB spectrum.",
"default": false
},
"icon": {
"type": "string",
"description": "The icon ID or filename (without extension) to display on the app. You can also send a 8x8 jpg as Base64 String",
"default": null
},
"pushIcon": {
"type": "integer",
"description": "0 = Icon doesn't move. 1 = Icon moves with text and will not appear again. 2 = Icon moves with text but appears again when the text starts to scroll again.",
"default": 0,
"minimum": 0,
"maximum": 2
},
"repeat": {
"type": "integer",
"description": "Sets how many times the text should be scrolled through the matrix before the app ends.",
"default": -1
},
"duration": {
"type": "integer",
"description": "Sets how long the app or notification should be displayed.",
"default": 5
},
"hold": {
"type": "boolean",
"description": "(Notification only) Set it to true, to hold your notification on top until you press the middle button or dismiss it via [PREFIX]/notify/dismiss. This key only belongs to notification.",
"default": false
},
"sound": {
"type": "string",
"description": "(Notification only) The filename of your RTTTL ringtone file placed in the MELODIES folder (without extension). Or the 4 digit number of your MP3 if youre using a DFplayer",
"default": null
},
"rtttl": {
"type": "string",
"description": "(Notification only) Allows to send the RTTTL sound string with the json.",
"default": null
},
"loopSound": {
"type": "boolean",
"description": "(Notification only) Loops the sound or rtttl as long as the notification is running.",
"default": false
},
"bar": {
"type": "array",
"format": "table",
"description": "Draws a bargraph. Without icon maximum 16 values, with icon 11 values.",
"items": {
"type": "integer"
},
"default": null
},
"line": {
"type": "array",
"format": "table",
"description": "Draws a linechart. Without icon maximum 16 values, with icon 11 values.",
"items": {
"type": "integer"
},
"default": null
},
"autoscale": {
"type": "boolean",
"description": "Enables or disables autoscaling for bar and linechart.",
"default": true
},
"progress": {
"type": "integer",
"description": "Shows a progress bar. Value can be 0-100.",
"minimum": 0,
"maximum": 100,
"default": 5
},
"progressC": {
"type": "string",
"format": "color",
"description": "The color of the progress bar.",
"default": null
},
"progressBC": {
"type": "string",
"format": "color",
"description": "The color of the progress bar background.",
"default": null
},
"pos": {
"type": "integer",
"description": "(App Only - Experimental) Defines the position of your custom page in the loop, starting at 0 for the first position. This will only apply with your first push. This function is experimental.",
"default": null
},
"lifetime": {
"type": "integer",
"description": "(App Only) Removes the custom app when there is no update after the given time in seconds.",
"default": 0
},
"lifetimeMode": {
"type": "integer",
"description": "(App Only) 0 = deletes the app, 1 = marks it as staled with a red rectangle around the app",
"minimum": 0,
"maximum": 1,
"default": 0
},
"stack": {
"type": "boolean",
"description": "(Notification only) Defines if the notification will be stacked. false will immediately replace the current notification.",
"default": true
},
"wakeup": {
"type": "boolean",
"description": "(Notification only) If the Matrix is off, the notification will wake it up for the time of the notification.",
"default": false
},
"noScroll": {
"type": "boolean",
"description": "Disables the text scrolling.",
"default": false
},
"scrollSpeed": {
"type": "integer",
"description": "Modifies the scroll speed. Enter a percentage value of the original scroll speed.",
"default": 100
},
"effect": {
"type": "string",
"description": "Shows an effect as background.The effect can be removed by sending an empty string for effect",
"default": ""
},
"save": {
"type": "boolean",
"description": "(App Only) Saves your custom app into flash and reloads it after boot. Avoid this for custom apps with high update frequencies because the ESP's flash memory has limited write cycles.",
"default": false
},
"overlay": {
"type": "string",
"description": "Sets an effect overlay (cannot be used with global overlays).",
"enum": [
"clear",
"snow",
"rain",
"drizzle",
"storm",
"thunder",
"frost",
null
],
"default": null
}
}
}

image

@Jinuts Jinuts added the feature request New feature or request label Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant