Skip to content

DynamiteAndy/TP-DataParser

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Touch-Portal-DataParser

Downloads Forks Stars License

Description

TP-DataParser allows you to parse and edit Json or HTML formatted data. If you have other type of data that aren't on the list feel free send a request to me. and I'll try my best!.

This documentation generated for Touch Portal DataParser V100 with Python TouchPortal SDK.

Features

Actions

Category: Data Parser (Click to expand)
Action NameDescriptionFormatData
choices/default (in bold)
On
Hold
Create HTTP ListenercreateHTTPListener is a action that allows to setup a base connection and use it to make actual request.Create listener name[listenerName] host url[host] and Header[header]
  1. Type: text   <empty>
  2. Type: text   <empty>
  3. Type: text   <empty>
No
Setup endpoint calls using listenerThis will use listener that you've created using `Create HTTP Listener` action as a base. And then use this to actually send request to a endpoint with a intervel aka it will automatically update x seconds and save the result.Use[listeners][requestMethod] to endpoint[endpoint]and optional body[body]and request every[intervel]seconds and save result to[result]
Click to expand
  1. Type: choice   <empty>
  2. Type: choice   Default: GET Possible choices: ['GET', 'POST', 'PUT', 'DELETE']
  3. Type: text   Default: /
  4. Type: text   <empty>
  5. Type: text   Default: 5
  6. Type: text   <empty>
No
Resume, Pause or Delete a listenerThis will Pause, Resume, and Delete a listener. once deleted it will remove all the states that's created from this listener[listenerControl] [listeners] update
  1. Type: choice   Default: Delete Possible choices: ['Pause', 'Resume', 'Delete']
  2. Type: choice   <empty>
No
Parsing dataParseData action allows you to get specific data field from Json or HTML. for example {'website host': 'blah blah'} you can get value of `website host` which is `blah blah`.Parse[dataType]data[data]to get[dataPath]and save result to[result]
Click to expand
  1. Type: choice   Default: Json Possible choices: ['Json', 'Html']
  2. Type: text   <empty>
  3. Type: text   <empty>
  4. Type: text   <empty>
No
Editing json data fieldEditJson allows you to change specific json field to a new data. for example if I have `{'name': 'someone'} I can change from `someone` to `something` as a example.Change [data] at path[jsonPath] to [newData] and save to[result]
Click to expand
  1. Type: text   <empty>
  2. Type: text   <empty>
  3. Type: text   <empty>
  4. Type: text   <empty>
No

States

Category: Data Parser (Click to expand)
Id Description DefaultValue parentGroup
.state.totalListenerCreated DataParser total listener created 0

Examples

If you want to retrieve the 'state' of the light from the json below then you would use [state], if you wanted to get the last_updated_again value then you would use [context][last_updated_again] image

{
     "entity_id": "light.key_light",
     "state": "on",
     "attributes": {},
     "last_changed": "2023-02-15T02:42:52.525643+00:00",
     "last_updated": "2023-02-15T02:42:52.525643+00:00",
     "context": {
	"last_updated_again": "2023-02-15T02:42:52.525643+00:00"
     }
 }

Another example when you want to access an array, you would simply do the same thing as above but add which array you are entering first [0][context][last_updated_again] image

[
{
     "entity_id": "light.key_light",
     "state": "on",
     "attributes": {},
     "last_changed": "2023-02-15T02:42:52.525643+00:00",
     "last_updated": "2023-02-15T02:42:52.525643+00:00",
     "context": {
	"last_updated_again": "2023-02-15T02:42:52.525643+00:00"
     }
 }
]

Installation

  1. Goto Releases and Download latest version for your system.
  2. After downloading the .tpp file goto open TouchPortal GUI and click on the gear icon and click Import Plug-in
  3. After imported the plugin you may or may not need to restart TouchPortal but it should pop up something says do u want to allow this plugin to run. Click Trust Always

Bugs and Suggestion

Open an issue or join offical TouchPortal Discord for support.

License

This plugin is licensed under the [GPL 3.0 License] - see the LICENSE file for more information.

About

TP-JsonParser allows user to create http request and if data type is json It can parse them

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 99.1%
  • Shell 0.9%