Shelly EM/3EM Implementation

Posted on
Thu Apr 01, 2021 3:47 pm
aaronlionsheep offline
Posts: 125
Joined: Feb 24, 2019
Location: Virginia, USA

Re: Shelly EM/3EM Implementation

Colly wrote:
Hi Aaron,
I've been meaning to create a few dashboards in Grafana with energy usage per day/week/month/year. Having looked at this for a bit tonight I think it would be beneficial to have the Total Energy data brought in to Indigo -
Code: Select all
"shellies/shellyem-<deviceid>/emeter/<i>/total

This is the total energy in Wh (accumulated in device's non-volatile memory). The data is stored in the device and will be included in the next value returned after if it went offline for a period. This would allow for more accurate comparison with the utility bill and in future when I get a smart meter. An example of the Shelly going offline could be a restart of my Mac Mini.
Colly


I will have to take a look at this, but I have some logic built in to have the Indigo energy value survive a device restart. At least, that is what is supposed to happen, but I do not rely on this feature myself.

Would you like the value from this topic represented as an additional device state, say "total-energy"?

Posted on
Thu Apr 01, 2021 3:50 pm
Colly offline
Posts: 405
Joined: Jan 16, 2016
Location: Ireland

Re: Shelly EM/3EM Implementation

aaronlionsheep wrote:
Would you like the value from this topic represented as an additional device state, say "total-energy"?

Yes this would be perfect. As I understand it this is also the most accurate way to calculate energy usage over a given period, subtracting starting total from ending total.

Posted on
Thu Apr 01, 2021 3:55 pm
aaronlionsheep offline
Posts: 125
Joined: Feb 24, 2019
Location: Virginia, USA

Re: Shelly EM/3EM Implementation

Colly wrote:
aaronlionsheep wrote:
Would you like the value from this topic represented as an additional device state, say "total-energy"?

Yes this would be perfect. As I understand it this is also the most accurate way to calculate energy usage over a given period, subtracting starting total from ending total.


Ok great, I can also pull in the value from this topic:
Code: Select all
shellies/shellyem-<deviceid>/emeter/<i>/total_returned


I don't think I will touch the native Indigo energy stuff because not all Shelly devices that report energy have these "total" topics and the Indigo energy code is shared among a lot of devices.

Posted on
Thu Apr 01, 2021 3:59 pm
Colly offline
Posts: 405
Joined: Jan 16, 2016
Location: Ireland

Re: Shelly EM/3EM Implementation

Once the value is available I can then take it into the Grafana plugin and do whatever I want after that. :)

Posted on
Thu Apr 01, 2021 4:46 pm
aaronlionsheep offline
Posts: 125
Joined: Feb 24, 2019
Location: Virginia, USA

Re: Shelly EM/3EM Implementation

Colly wrote:
Once the value is available I can then take it into the Grafana plugin and do whatever I want after that. :)


Take a look at 0.7.1 and let me know if everything looks good (I don't have any EM devices to validate with).

Posted on
Thu Apr 01, 2021 4:53 pm
Colly offline
Posts: 405
Joined: Jan 16, 2016
Location: Ireland

Re: Shelly EM/3EM Implementation

Just see 0.7.0 there at the minute..

Posted on
Thu Apr 01, 2021 4:54 pm
aaronlionsheep offline
Posts: 125
Joined: Feb 24, 2019
Location: Virginia, USA

Re: Shelly EM/3EM Implementation

Colly wrote:
Just see 0.7.0 there at the minute..


That link should take you to the 0.7.1 branch since I don't have a release created for it yet.

Posted on
Thu Apr 01, 2021 4:59 pm
Colly offline
Posts: 405
Joined: Jan 16, 2016
Location: Ireland

Re: Shelly EM/3EM Implementation

aaronlionsheep wrote:
That link should take you to the 0.7.1 branch since I don't have a release created for it yet.

And so it does! Updated and can see total energy.
That's what I call a quick turnaround. Many thanks.

Posted on
Thu Apr 01, 2021 5:03 pm
aaronlionsheep offline
Posts: 125
Joined: Feb 24, 2019
Location: Virginia, USA

Re: Shelly EM/3EM Implementation

Colly wrote:
aaronlionsheep wrote:
That link should take you to the 0.7.1 branch since I don't have a release created for it yet.

And so it does! Updated and can see total energy.
That's what I call a quick turnaround. Many thanks.


You're welcome! I'm glad the Shelly supplied the data you needed!

Who is online

Users browsing this forum: No registered users and 1 guest