David Sanner - Bug or odd behavior w/ Data Brow...
Bug or odd behavior w/ Data Browser (w/ notifications paths).
If I view json via http://localhost:3000/signalk/v1/api/vessels/self/
I see a well formed entry for:
notifications.tanks.freshWater.starboard.currentLevel (w/ $source: "self.notificationhandler")
However this does not show up under 'Data Browser' (unless modified later by Kip or something)
(tanks.freshWater.starboard.currentLevel does show up under "Data Browser' )
Anyone else missing notifications or other paths under "Data Browser" or when subscribing?
Side note: If my plugin pauses a few seconds at startup and then does app.getSelfPath('notifications') I see all the notifications but if I don't pause and just subscribe to notifications.* / instant, I miss some notifications like the one above (its src is SensESP).
4 Replies
Issues with steps to reproduce would be good for these two
I wrote a simple test plugin and I'm seeing the same behavior when I subscribe to notifications but here's a test that I hope illustrates the issue.
I have a SensESP sending a tank value every 15s or so: 'tanks.freshWater.starboard.currentLevel' and all looks good (values shown in Data Browser). After SK server restart I added a zone to it - shown in baseDeltas.json:
{
"path": "tanks.freshWater.starboard.currentLevel",
"value": {
"units": "ratio",
"description": "Data should be of type number.",
"alertMethod": [
"visual",
"sound"
],
"zones": [
{
"upper": 0.1,
"lower": 0,
"state": "alert",
"message": "testing"
}
]
}
}
---------
As soon as I add the zone a notification for that zone pops up in 'Data Browser' however if I restart SK server it doesn't repopulate the notification and only shows the path to the tank level measurement.
However if I then view via http://localhost:3000/signalk/v1/api/vessels/self/ I find the notification:
notifications.tanks.freshWater.starboard.currentLevel
With proper values (eg. $source "self.notificationhandler")
Again, at this point, when I look under "Data Browser" the notification doesn't show up. If I then edit the measurement's zone values it shows up but if I then restart SK server again it doesn't show up in the 'Data Browser' (or subscription) but does w/ URL above.
-- So that's the inconsistency -- (I hope that makes sense / good example)
Final oddness/clue: If I then go and delete the zone & method from the measurement meta data baseDeltas.json has:
{
"path": "tanks.freshWater.starboard.currentLevel",
"value": {
"units": "ratio",
"description": "Data should be of type number.",
"zones": null
}
}
But this time after restart it does show the notification path (w/o zones or methods) under both 'Data Browser' and URL above. Thanks
I can't reproduce this. Once I restart the server, and get a new value for the tank, the notification shows in the browser.
And to be clear here, you said the value is sent ever 15 seconds, that means it could take up to 15 seconds for the notification to show up.
This seems to be happening for only some notification paths (only 20% are missing?), working discovering a pattern.
If you have many zones/notifications can you compare the number found under the URL to the number under the Data Browser?
Thanks for the check that I'm waiting for up to 15s. I am waiting long enough... the data/measurement is there, just not the notification in some places but not all. (btw, most notification paths don't show up until data is there - plugins may be different)
Key bit I think, is that the measurement and the related notification is showing up under:
http://localhost:3000/signalk/v1/api/vessels/self/
But not under "Data Browser" or subscription.
In my plugin I'm using "app.getSelfPath('notifications')" which it does show up under.
I redid my baseDeltas.json to have only a single zone (for this tank) and it's the same behavior. Thx. On further thought I don't think startup sync explains what I'm seeing. (Data Browser showing different notifications data than http://localhost:3000/signalk/v1/api/vessels/self/ ) I have three paths defined below for the tank measurement - one from SenseEsp (currentLevel) & two from derived-data. What is really odd is if all three are there everything is fine but if I remove tanks.freshWater.starboard.capacity then no notifications.tanks... information shows up under "Data Browser" - I'll report back if I see anything else (or others see this) but we may just have to put this on the "that's odd" list. { "path": "tanks.freshWater.starboard.capacity", "value": { "units": "ratio", "description": "Level of tank as ratio", "zones": [ ] } }, { "path": "tanks.freshWater.starboard.currentLevel", "value": { "units": "ratio", "description": "Level of tank as ratio", "alertMethod": [ "visual", "sound"], "zones": [ { "upper": 0.125, "lower": 0, "state": "alert", "message": "1/8 Fresh Water Tanks" } ] } }, { "path": "tanks.freshWater.starboard.currentVolume", "value": { "units": "m3", "description": "Starboard Water Tank Volume.", "zones": [ { "upper": 0.01209,"lower": -10,"state": "warn", "message": "Starboard Water Tank Low" }, { "upper": 0.0266, "lower": 0.0121, "state": "alert","message": "Starboard Water Tank 7 Gallons" } ], "alertMethod": [ "visual", "sound" ] } }
I redid my baseDeltas.json to have only a single zone (for this tank) and it's the same behavior. Thx. On further thought I don't think startup sync explains what I'm seeing. (Data Browser showing different notifications data than http://localhost:3000/signalk/v1/api/vessels/self/ ) I have three paths defined below for the tank measurement - one from SenseEsp (currentLevel) & two from derived-data. What is really odd is if all three are there everything is fine but if I remove tanks.freshWater.starboard.capacity then no notifications.tanks... information shows up under "Data Browser" - I'll report back if I see anything else (or others see this) but we may just have to put this on the "that's odd" list. { "path": "tanks.freshWater.starboard.capacity", "value": { "units": "ratio", "description": "Level of tank as ratio", "zones": [ ] } }, { "path": "tanks.freshWater.starboard.currentLevel", "value": { "units": "ratio", "description": "Level of tank as ratio", "alertMethod": [ "visual", "sound"], "zones": [ { "upper": 0.125, "lower": 0, "state": "alert", "message": "1/8 Fresh Water Tanks" } ] } }, { "path": "tanks.freshWater.starboard.currentVolume", "value": { "units": "m3", "description": "Starboard Water Tank Volume.", "zones": [ { "upper": 0.01209,"lower": -10,"state": "warn", "message": "Starboard Water Tank Low" }, { "upper": 0.0266, "lower": 0.0121, "state": "alert","message": "Starboard Water Tank 7 Gallons" } ], "alertMethod": [ "visual", "sound" ] } }