Influx continuous queries from openhab items

Tags: #<Tag:0x00007f616e29ff00>

I’d ask at influx forums.,…but I’ve seen other queries from my self, or other openhab users and the only answer is from the poster…

So anyway. I have a bunch of items that are putting watts into influx. Because of the way openhab does it, it makes a bunch of measurements (tables).

zwave_switch_Sewing_lamp_watts
zwave_switch_ballroom_spotlight_north_watts
zwave_switch_ballroom_spotlight_south_watts
zwave_switch_ballroom_watts
zwave_switch_carport_watts
zwave_switch_central_heating_watts
zwave_switch_coffee_machine_watts
zwave_switch_computer_watts
zwave_switch_entrance_lamp_watts
zwave_switch_frontdoor_light_watts
zwave_switch_hallway_light_watts
zwave_switch_hallway_watts
zwave_switch_lounge_lamp_watts
zwave_switch_lounge_spotlight_watts

Now I can easily query these with:

select mean(value) from /watts/ where time > now() -1d group by time(1h) fill(none)

And I get not 1 hour average from each, so I’d like to use this as a continuous query to roll up all these tables into one table with the average (1h) watts and the item name… I thought that:

create continuous query "watts_rollup_1h" on openhab begin select mean(value)   INTO "openhab"."2years"."watts_1h" FROM "openhab"."autogen"./watts/ group by time(1h) fill(none)  end;

might do it, but all I got was one single entry in to the "openhab"."2years"."watts_1h" table. Not getting all of the series, being each item.

Does anyone know how I might do it…as then I’d apply the same to my temp sensors etc.

Some thoughts: