# Power usage "graphs" from Tasmota device

**URL:** <https://discourse.nodered.org/t/power-usage-graphs-from-tasmota-device/85231>\
**Category:** Dashboard\
**Created:** [5 February 2024 21:18 UTC](https://discourse.nodered.org/t/power-usage-graphs-from-tasmota-device/85231 "2024-02-05T21:18:53Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [5 February 2024 21:18 UTC](https://discourse.nodered.org/t/power-usage-graphs-from-tasmota-device/85231/1 "2024-02-05T21:18:53Z")

</div>

I've got a Tasmota device that spits out messages with power usage.  
(yeah, I'm anal.) 😉

This is what I'm getting as an example.  
Sorry there is no actual values.

```auto
{"Time":"2024-02-06T07:10:47",
"ENERGY":{"TotalStartTime":"2024-02-02T06:22:14",
"Total":0,
"Yesterday":0,
"Today":0,
"Period":0,
"Power":0,
"ApparentPower":0,
"ReactivePower":0,
"Factor":0,
"Voltage":241,
"Current":0}}

```

And yes, if I don't know what I want: what's the point in me asking.....

I'm just starting and am _feeling_ what is available.

Yes, a _chart_ is/would be the obvious choice. But....

To me it takes up too much real estate on the screen for what it gives./shows me.

A multi-needle gauge would be good here IMO.

Today's power on one,  
Yesterday's on another one.  
The Power value on another

So that's 3.

I get it that the first 2 would be on a different scale than the third.  
Hey: nothing is perfect. 😉

Would something like that be possible?  
A Multi pointer gauge?

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [5 February 2024 21:50 UTC](https://discourse.nodered.org/t/power-usage-graphs-from-tasmota-device/85231/2 "2024-02-05T21:50:56Z")

</div>

Andrew, if you want to track power usage, then a chart is the best option. A gauge will only show momentary values.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [5 February 2024 22:13 UTC](https://discourse.nodered.org/t/power-usage-graphs-from-tasmota-device/85231/3 "2024-02-05T22:13:47Z")

</div>

Yeah, I do understand that.

At this stage, I am only interested in looking at the _there and then_ values.

As said: screen real estate is kind of limited.

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [5 February 2024 22:26 UTC](https://discourse.nodered.org/t/power-usage-graphs-from-tasmota-device/85231/4 "2024-02-05T22:26:38Z")

</div>

I have a PZEM-004T that sends readings via MQTT to Node-RED.  
 ![PZEM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/1/01bbf7f899bb25c8bf28eafec9153c0d8ef9d269.png)

My dashboard shows instantaneous readings on the gauges and a graph of the last 3-hrs power usage.

 ![home_energy](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/1/71f24cb39f1caca029b7a7da5fbd15cdcbc8b46a.png)

Here's part of my Node-RED flow.

 ![energy_flow](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/f/9f2f8b5420fcee3df909f1d3e2918e81f2a83444.png)  
A well as directing the readings to the dashboard, I also log them on a local MySQL dB and send them to Clarify so I can inspect them with their interactive graphing tools and viewer.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [5 February 2024 22:32 UTC](https://discourse.nodered.org/t/power-usage-graphs-from-tasmota-device/85231/5 "2024-02-05T22:32:35Z")

</div>

Looks good.

But (sorry) I am wanting to try and _optimise_ the gauges.

Alas yours are very different ranges so can't be combined as is.

But say you multiplied the current by 100, then you would have two with similar ranges

Then you put them both on one gauge showing their values.  
Kind of like a _speedometer_ is on a car.  
Or, hands on a clock.

But then you halve the screen space needed/used.

Again: screen real estate is kinda limited.

But I'll keep it in mind.

All this is new to me and I haven't yet got a full picture of what/how I want to display it.  
But couldn't really think about this until I got a working set of readings.

(Catch 22)

I know there are other graph ones like the LED STRIP one and a couple of other _gauges_ but they don't allow/have/give you the option of merging two indicators into one range.

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [5 February 2024 22:39 UTC](https://discourse.nodered.org/t/power-usage-graphs-from-tasmota-device/85231/6 "2024-02-05T22:39:51Z")

</div>

Note: In my flow I've 'engineered' the current and wattage gauges to have dynamic ranges.  
Here's part of one of the function nodes that changes the 'min' 'max' values on a guage.

```auto
var current = flow.get("current") || 1.0;
var power = voltage * current;
power = power.toFixed(0);

if (power > 10000) {
    max = 20000;
    min = 10000;
}
else if (power > 9000) {
    max = 10000;
    min = 9000;
}
else if (power > 8000) {
    max = 9000;
    min = 8000;
}
else if (power > 7000) {
    max = 8000;
    min = 7000;

```

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [5 February 2024 22:42 UTC](https://discourse.nodered.org/t/power-usage-graphs-from-tasmota-device/85231/7 "2024-02-05T22:42:59Z")

</div>

Yes, that is a nice trick and handy to know.

But again I ask:

Is there a way (_trick_?) so on a gauge I can have 2 (or more) needles (different colours) indicating different things?

Like a line chart where you have a key below showing what colour represents what for each needle.  
But it is strictly a _here and now_ measurement.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [5 February 2024 23:10 UTC](https://discourse.nodered.org/t/power-usage-graphs-from-tasmota-device/85231/8 "2024-02-05T23:10:00Z")

</div>

I don't think that the basic gauge widget lets you have two needles.

Probably need to consider a template mode containing a more sophisticated gauge, such as some of the September Giveaway series.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [5 February 2024 23:10 UTC](https://discourse.nodered.org/t/power-usage-graphs-from-tasmota-device/85231/9 "2024-02-05T23:10:07Z")

</div>

Are you sure that it's power that you want to monitor, and not energy?

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [5 February 2024 23:11 UTC](https://discourse.nodered.org/t/power-usage-graphs-from-tasmota-device/85231/10 "2024-02-05T23:11:06Z")

</div>

Probably.

I need to do a bit of research on that.

Thanks.

Yikes, seems I will have to really study that.

I hear that multi pointer gauges are mentioned - which is good.

But quickly going through the video it kinda frightens me with all the CSS/HTML stuff.  
Ok, they are _hidden behind the scenes_ and not really of importance if I try to stratify how I look at it.

But thanks again.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [5 February 2024 23:12 UTC](https://discourse.nodered.org/t/power-usage-graphs-from-tasmota-device/85231/11 "2024-02-05T23:12:15Z")

</div>

Well, again I am keeping the question general more than specific as it is more a _test case_ here.

As said, it is all new and I am wanting a compact thing to display stuff and a multi-needle gauge would/may/could be what I needed.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [5 February 2024 23:13 UTC](https://discourse.nodered.org/t/power-usage-graphs-from-tasmota-device/85231/12 "2024-02-05T23:13:31Z")

</div>

> [@Trying\_to\_learn](#):
>
> Well, again I am keeping the question general more than specific

I think specific would be preferable 😁

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [5 February 2024 23:15 UTC](https://discourse.nodered.org/t/power-usage-graphs-from-tasmota-device/85231/13 "2024-02-05T23:15:03Z")

</div>

Yeah, well, just now my `vocabulary()` is not working as well as I would like.

So who knows if i am even asking the right question. 😉

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [6 March 2024 23:15 UTC](https://discourse.nodered.org/t/power-usage-graphs-from-tasmota-device/85231/14 "2024-03-06T23:15:42Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
