create or replace view badesee_temperature_v as
  select time, 
         cast(values->'Temp_Red'->>'value' as float) as Temp1,
         cast(values->'Temp_White'->>'value' as float) as Temp2,
         cast(values->'Temp_Black'->>'value' as float) as Temp3,
         cast(values->'Battery'->>'value' as float) as battery,
         attributes->>'Status' as status,
         device
    from measurements
    where application = 'de-hottis-saerbeck-monitoring' and
          device = 'eui-a84041318187ec13';
