• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pilight config editor
#1
hi,
I created the last days a simple editor for config.json. It is not ready, but you can do some changes with it.
You can
- load and save config.json
- edit the devices name
- create a new device
- delete a device
- create a gui element
- edit a gui element
- delete a gui element
- edit rules,
- delete rules
- create new rules

In future:
the settings shall be editable too
create a simple new config.json file
simple sorting

To create a new device in my opinion it is the best way to load a file with a json object of the protocol. In this file all editable elements are place holders (for example \s for strings or \i for integers).
So every body can add new "generic protocols". See the json files in the Template folder.
It is a java application so if it don't start with double click, you must start it with "java -jar".
If anybody wants to help (ideas, bug report, coding other help), he is welcome.
 
Reply
#2
hi,
no comments? no wishes? no bugs found (there are several in the old version)?
I attach the latest version. If some body in future is interested in having the newest version the source or some thing else, he can contact me.

oops, I cannot attach a zip file, the board says:
"The file upload failed. Please choose a valid file and try again. Error details: There was a problem moving the uploaded file to its destination."
What is wrong? My last upload was a zip file too.
 
Reply
#3
Probably because i moved servers. Will check soon.

Uploads are fixed.
 
Reply
#4
ok, thanks. Here is the upload...


Attached Files
.zip   piConf.zip (Size: 66.62 KB / Downloads: 57)
 
Reply
#5
@ktams

I have tried your config editor (good iniatitive by the way) and here is some feedback.

Loading an existing config fails if the base name of the config file is not just "config". It would be nice if config files with other names could be loaded and saved too. That will make it easier to maintain multiple config versions.

I can edit the name of an existing device, but the "new" button is inactive (gray), so I cannot create new devices.

The "delete" button looks active, but when I click on it, the selected device is not deleted from the devices window.

GUI elements that exist in the loaded config file are not visible in the GUI elements window. Clicking on the >> button has no effect. No new GUI elements can be created either.

Rules that exist in the loaded config are not visible in the Rules editor window, so cannot be edited.

And then the rules editor itself which I think is by far the most complex and most important part of the tool.

I think the option buttons (like ".state" and ".dimlevel") could better be replaced by cotext sensitive drop down boxes containing only the options relevant for the selected device. Otherwise you will end up with way too many buttons and have a big risk of selecting an option that is invalid for the given device.

Buttons for operators (if not replaced by drop down boxes) should be made context sensitive too (dependent on the selected action), to prevent using operators that are invalid for a given action.

Buttons for actions ("switch", "dim" and so on) are missing.

My comments may seem negative, but that is certainly not my intention. As I said this is a good initiative and I know it is quite a job to create such an editor. I hope these comments are helpful for you.
 
Reply
#6
(12-03-2015, 03:08 PM)Niek Wrote: @ktams

I have tried your config editor (good iniatitive by the way) and here is some feedback.

Thank you for your comments. I feared, no one is interested in it....

Quote:Loading an existing config fails if the base name of the config file is not just "config". It would be nice if config files with other names could be loaded and saved too. That will make it easier to maintain multiple config versions.

I tried t o make sure, it is a config file for pilight. But I can make it sure in another way (looking after "pilight" in the file).
Quote:I can edit the name of an existing device, but the "new" button is inactive (gray), so I cannot create new devices.

At the moment the editor works only correct, if a working config.json is loaded. So you must load a file and than the button works.

Quote:The "delete" button looks active, but when I click on it, the selected device is not deleted from the devices window.

did you load a config.json first? I tried it with my file and it works...

Quote:GUI elements that exist in the loaded config file are not visible in the GUI elements window. Clicking on the >> button has no effect. No new GUI elements can be created either.

Only new GUI elements will be created if a device has no GUI element. Can you send me your test file so I can see, what is wrong?

Quote:Rules that exist in the loaded config are not visible in the Rules editor window, so cannot be edited.

Here the same. With my test files it works. May be, the file parser crashes with your.

Quote:And then the rules editor itself which I think is by far the most complex and most important part of the tool.

I think the option buttons (like ".state" and ".dimlevel") could better be replaced by cotext sensitive drop down boxes containing only the options relevant for the selected device. Otherwise you will end up with way too many buttons and have a big risk of selecting an option that is invalid for the given device.

I have seen it as I implemented it. My intention was to make it as simple as possible, but there are to much buttons now. That is one of the things, I want to change.

Quote:Buttons for operators (if not replaced by drop down boxes) should be made context sensitive too (dependent on the selected action), to prevent using operators that are invalid for a given action.

The tool is more like a makro assembler now than a C compiler ;-) That is the next step.

Quote:Buttons for actions ("switch", "dim" and so on) are missing.

Yes. I stopped placing buttons when I see, it is too much. Until now you had to add some words per hand until I changed the handling.

Quote:My comments may seem negative, but that is certainly not my intention. As I said this is a good initiative and I know it is quite a job to create such an editor. I hope these comments are helpful for you.
Yes, very helpful. There are two types of negative comments.
1. You say: "All bad and not usable and never will be".
2. You say: "this is not working ant that".
You can guess what is more helpfull ;-)
many thanks
 
Reply
#7
Yes I did load my current working config file and my devices are actually shown in the left panel, so loading seems to work at least partially.

One thing I found by accident, is that the config won't load if it contains blank lines.

Attached is the config.json I have used for testing, renamed to config.json.txt. Of course I removed sensitive values (replaced them with "xxxxx")


Attached Files
.txt   config.json.txt (Size: 21.09 KB / Downloads: 23)
 
Reply
#8
hi,
I attach a new version.
I think the behavior of the rule editor is now better.
It is a first suggestion and must be tested with several config files and devices/rules.
Any comments, wishes or bugs?
BTW blank lines are still not allowed in this version.


Attached Files
.zip   piConf.zip (Size: 65.9 KB / Downloads: 14)
 
Reply
#9
I killed some bugs (specially in loading and saving the config file) and added some functionality. Now you can use it to edit your config (I hope).


Attached Files
.zip   piConf.zip (Size: 66.66 KB / Downloads: 26)
 
Reply
#10
@ktams

I did some testing with your latest version. This is what I experienced so far:
  • Loading the config file now works well, also with different file names
  • suggestion: in load and save config dialogs set the default filetype to .json
  • suggestion: allow changing the width of the devices window
  • Creating new devices is working now.
  • Clicking the new button opens the file manager, but not the Template folder, so you always have to navigate to get the desired template first.
  • Adding your own protocol template to the Template folder works fine.
  • Creating/editing a GUI element for a new device works, but the GUI editor adds trailing double quotes (") to the protocol and the group names evey time a GUI element is saved by clicking the OK button.
  • suggestion: add a copy function for devices.
  • The editor should allow only valid state values (eg "on"and "off" for switch or and "running" and "stopped" for program). Maybe these can be added to the templates as a list of valid option values.
  • Rule editor works for creating new rules, but editing existing rules is not very easy and can easily lead to invalid rules. Maybe the rules can be stored in a structure, so when editing, the program knows what device, action, option, operator one tries to edit and can prevent making the rule invalid.
  • suggestion: order the lists (dropdowns) alphabethically
  • Having just one button to enter an option (like .state) is not enough. Some protocols have several options. You created a dropdown for the datetime protocol, but that seems to be hard coded in the program. Imho these options should also be defined in the protocol template, so you don't need to modify the program when a protocol is changed or added.
  • When selecting an option for the datetime protocol, the program adds ==, but other operators like >.< >= are also valid here. Maybe you could add a dropdown where one of the valid operators can be selected.
  • Waiting for a version where a device can be edited completely (now only the name can be edited)


These are my comments so far. Hope they are helpful
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  Does piSchedule work with pilight 8.1.1-nightly Peter S 0 1,403 06-29-2018, 07:57 PM
Last Post: Peter S
  pilight-console - an LCD / keypad interface for pilight frenchie71 3 1,140 11-21-2017, 11:15 PM
Last Post: curlymo
  Connect pilight to your hue bridge hannemann 3 2,400 01-03-2017, 11:26 PM
Last Post: hannemann
Wink PHP class using pilight socket connection Dan 0 1,357 11-03-2016, 11:41 AM
Last Post: Dan
  piScheduler -- A pilight extension for the daily switch plan gneandr 159 59,930 08-09-2016, 04:33 PM
Last Post: gneandr
  Controlling a RGB Led Strip over pilight mightyuhu 2 2,266 08-06-2016, 09:10 PM
Last Post: JohannK
  HomeBridge with pilight on raspbian Jurre 10 10,735 04-06-2016, 07:45 AM
Last Post: tomtom
  pilight voice commands kniazio 11 5,255 01-29-2016, 07:51 PM
Last Post: sral
  Python Ping pilight detect mobilephone Cryptomaster 0 2,022 01-10-2016, 04:17 PM
Last Post: Cryptomaster
  command processing between pilight and openhab royhofman1989 3 2,682 07-13-2015, 11:26 AM
Last Post: curlymo

Forum Jump:


Browsing: 1 Guest(s)