create or replace view level_v as
  select time, 
         cast(values->'CorrectedDistance'->>'value' as float) as level,
         cast(values->'Battery'->>'value' as float) as battery,
         attributes->>'Status' as status,
         device
    from measurements
    where application = 'de-hottis-level-monitoring';
