From 4ab69d40ef6494de6d7cd96507fc7c099e62d25c Mon Sep 17 00:00:00 2001 From: xbgmsharp Date: Wed, 26 Jul 2023 10:42:11 +0200 Subject: [PATCH] Update api views, expost new etra logbook metric --- initdb/02_1_3_signalk_api_views.sql | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/initdb/02_1_3_signalk_api_views.sql b/initdb/02_1_3_signalk_api_views.sql index 6a21a2d..bd503dd 100644 --- a/initdb/02_1_3_signalk_api_views.sql +++ b/initdb/02_1_3_signalk_api_views.sql @@ -85,7 +85,8 @@ CREATE OR REPLACE VIEW api.log_view WITH (security_invoker=true,security_barrier track_geojson as geojson, avg_speed as avg_speed, max_speed as max_speed, - max_wind_speed as max_wind_speed + max_wind_speed as max_wind_speed, + extra as extra FROM api.logbook l WHERE _to_time IS NOT NULL ORDER BY _from_time DESC; @@ -427,10 +428,12 @@ CREATE VIEW api.monitoring_view3 WITH (security_invoker=true,security_barrier=tr FROM api.metrics m, jsonb_each_text(m.metrics) ORDER BY m.time DESC; - -- WHERE key ILIKE '%257.voltage'; + -- WHERE key ILIKE 'electrical.batteries%voltage'; -- WHERE key ilike 'tanks.%.capacity%' -- or key ilike 'electrical.solar.%.panelPower' -- or key ilike 'electrical.batteries%stateOfCharge'; + -- key ILIKE 'propulsion.%.runTime' + -- key ILIKE 'navigation.log' COMMENT ON VIEW api.monitoring_view3 IS 'Monitoring Timeseries whatever data from json web view';