Change GAS graph from Column to line graph

Moderator: leecollings

Post Reply
MaxHipshot
Posts: 5
Joined: Sunday 04 July 2021 18:50
Target OS: Linux
Domoticz version:
Contact:

Change GAS graph from Column to line graph

Post by MaxHipshot »

Hi Guys,

I have Domoticz 2021-1 running

A Youless (LAN) device is added to retrieve P1 counters. Works like a charm.
Power (taken from network and delivered to network from solar) is represented as a line graph with multiple values. Love it.

Gas is presented as hourly columns in m^3 used.

I'd like to convert this graph to a line-graph with a 5 minute granularity, similar to the power graph.

Is this possible at all?
User avatar
waltervl
Posts: 5851
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Change GAS graph from Column to line graph

Post by waltervl »

Sorry, not possible or use a custom sensor device but it has no history logging.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
MaxHipshot
Posts: 5
Joined: Sunday 04 July 2021 18:50
Target OS: Linux
Domoticz version:
Contact:

Re: Change GAS graph from Column to line graph

Post by MaxHipshot »

Forgive me that I don't understand.

The data for KWH and M^3 is obtained from one single P1 device. "It is not possible" does not seem a reasonable answer

KWH is displayed as line graph for 24 hours, column graphs for historical graphs.
I would like the gas graphs follow the same design principle. LineGraph for 24hours, columns for history graphs.
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Change GAS graph from Column to line graph

Post by EddyG »

I also think it is possible, but the heating does not use gas fluently in this time of the year every 5 minutes like electricity does.
So you will get a graph that will jump up and down to zero frequently. I don't think that will look nice.
I think that is why the developers decided to use columns.
But you can also use influxdb and grafana to make your own graphs, I did that.
I can tell you is does not look nice when the heating season starts.
User avatar
waltervl
Posts: 5851
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Change GAS graph from Column to line graph

Post by waltervl »

It is indeed only possible if you reprogram the charting Js scripts or use an external charting application. So within Domoticz it is not configurable or easily changed. As it is software, everything is possible if you know how to do it.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Change GAS graph from Column to line graph

Post by EddyG »

It so happens that I still upload Gas data to my influxdb (on a Synology NAS in a Docker container) so I grasped a picture of the last 24 hours of my upload to influxdb. It is not so nice imho.
21.10.2021_15.25.53_REC.png
21.10.2021_15.25.53_REC.png (20.89 KiB) Viewed 828 times
glipman
Posts: 1
Joined: Sunday 28 November 2021 14:34
Target OS: -
Domoticz version:
Contact:

Re: Change GAS graph from Column to line graph

Post by glipman »

You may apply a tiny hack to domoticz\www\js\domoticz.js on your webserver.

In function ShowCounterLog() around line 5902 change line

Code: Select all

type: 'column',
to

Code: Select all

type: 'spline',
and in line 5907 change

Code: Select all

$.getJSON("json.htm?type=graph&sensor=counter&idx=" + id + "&range=day",
to

Code: Select all

$.getJSON("json.htm?type=graph&sensor=counter&idx=" + id + "&range=day&method=1",
This wil change your hourly gas bar graph to a 5 minute line graph.
It indeed has many spikes as the heater is 'modulating' and my meter sends updates only once every 10 minutes but it is more detailed than the bar graph.

Note: whenever you upgrade the software in the future you may lose the patch (or it should make it into the core).
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest