HowTo refresh a virtual device?

Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

HowTo refresh a virtual device?

Post by pz1 » 23 Sep 2016 13:26

ref: FAQ

I do have a problem with my Wunderground App (github) I moved some of the metrics to a newly created vDev for the wind direction
direction. However the metrics that I did move out, still show up in the JSON that I get from the device.

The image below show that "moved" metrics still showing up in the configjson file in folder stage
vDevClean.PNG
vDevClean.PNG (15.39 KiB) Viewed 2969 times
What can I do to resfresh these devices? The data marked in yellow is expired data. Even system reboot did not clean this up

Note: The device is found under the vdevInfo-branch

gsaw
Posts: 65
Joined: 22 Aug 2016 00:26

Re: HowTo refresh a virtual device?

Post by gsaw » 23 Sep 2016 14:36

pz1 wrote:I do have a problem with my Wunderground App (github) I moved some of the metrics to a newly created vDev for the wind direction
direction. However the metrics that I did move out, still show up in the JSON that I get from the device.

The image below show that "moved" metrics still showing up in the configjson file in folder stage
vDevClean.PNG
What can I do to resfresh these devices? The data marked in yellow is expired data. Even system reboot did not clean this up
I guess you should to stop server, remove metrics manually from configjson and start server again. I had to do this, as i reworked OpenWheather for me for multiple devices. But i removed from config whole old device entry, created new module, then changed id of newly created device to old one in configjson.

pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: HowTo refresh a virtual device?

Post by pz1 » 24 Sep 2016 12:01

gsaw wrote:I guess you should to stop server, remove metrics manually from configjson and start server again.
Thanks, I did just that, and it worked! Last time I edited this configjson 1-2 years ago it ended up in a big mess. Hence my question to the forum Apparantly the system and me have become more robust ;)

Side note: I do use Notepad++ as an editor. It does have a nice graphical tree browser on json, as can be seen in the first post
Since 29-12-2016 I am no longer a moderator for this forum

gsaw
Posts: 65
Joined: 22 Aug 2016 00:26

Re: HowTo refresh a virtual device?

Post by gsaw » 24 Sep 2016 12:53

pz1 wrote:
Side note: I do use Notepad++ as an editor. It does have a nice graphical tree browser on json, as can be seen in the first post
I installed a json pretty printing tool directly on my banana pi. It makes json file readable like on your screenshot. Then i can edit file using nano from my tablet, just i have to disable syntax highlighting in nano (alt-m) because configjson is to big for that.

Code: Select all

georg@bananapi:~$ cat /opt/z-way-server/automation/storage/configjson-06b2d3b23dce96e1619d2b53d6c947ec.json | json_pp
{
   "profiles" : [
      {
         "interval" : 2000,
         "hide_single_device_events" : [],
         "rooms" : [
            0
         ],
         "expert_view" : true,
         "name" : "Administrator",
         "password" : "admin",
         "lang" : "en",
         "dashboard" : [
            "ZWayVDev_zway_6-1-37",
            "ZWayVDev_zway_6-2-37",
            "LightScene_10",
            "LightScene_11",
            "LightScene_12",
            "ZWayVDev_zway_8-0-37",
            "ZWayVDev_zway_10-1-38",
            "ZWayVDev_zway_9-1-38",
            "ZWayVDev_zway_5-0-49-3",
            "LightScene_28",
            "ZWayVDev_zway_22-2-37",
            "ZWayVDev_zway_22-1-37",
            "Code_Device_sensorBinary_43",
            "Code_Device_sensorMultilevel_43",
            "Code_Device_sensorMultilevel_46"
         ],
         "hide_all_device_events" : false,
         "color" : "#dddddd",


pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: HowTo refresh a virtual device?

Post by pz1 » 24 Sep 2016 17:57

gsaw wrote:I installed a json pretty printing tool directly on my banana pi.
Thanks for sharing. Do you have a reference? May be of interest to others

gsaw
Posts: 65
Joined: 22 Aug 2016 00:26

Re: HowTo refresh a virtual device?

Post by gsaw » 25 Sep 2016 13:15

pz1 wrote:
gsaw wrote:I installed a json pretty printing tool directly on my banana pi.
Thanks for sharing. Do you have a reference? May be of interest to others
Oh, sorry, i dont know anymore, from which debian package exactly the script is. I just regulary installed several debian packages for json. There is one which is purposed for pretty printing.

Code: Select all

georg@bananapi:~$ apt-cache search json | grep pretty
aeson-pretty - JSON pretty-printing tool
libghc-aeson-pretty-dev - JSON pretty-printing library
libghc-aeson-pretty-doc - JSON pretty-printing library; documentation
libghc-aeson-pretty-prof - JSON pretty-printing library; profiling libraries
try to install it with

Code: Select all

sudo apt-get install aeson-pretty

Post Reply