diff --git a/schema b/schema new file mode 100644 index 0000000..d2b8611 --- /dev/null +++ b/schema @@ -0,0 +1,25 @@ +create table pv_power_measurement_t ( + time timestamp without time zone not null, + deviceid text, + status text, + state integer, + importEnergyActive double precision, + importEnergyReactive double precision, + exportEnergyActive double precision, + exportEnergyReactive double precision, + powerApparent double precision, + powerActive double precision, + powerReactive double precision, + powerDemandPositive double precision, + powerDemandReverse double precision, + powerDemand double precision, + factor double precision, + angle double precision, + voltage double precision, + current double precision +); + +select create_hypertable('pv_power_measurement_t', 'time'); + +grant insert on pv_power_measurement_t to nodered; +grant select on pv_power_measurement_t to grafana;