Shelly 3em monitor

Python and python framework

Moderator: leecollings

Post Reply
ssk17051980
Posts: 112
Joined: Thursday 08 December 2022 22:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: ROMANIA
Contact:

Shelly 3em monitor

Post by ssk17051980 »

I use a shelly 3em, integrated in domoticz with Shelly MQTT.
I don't know how to see the total consumption per month or at least per month. for example from 01.01.2023 to 31.01.2023. is there someone who can make me a script or another solution for the event, even for a fee?
Attachments
shelly 3 EM.jpg
shelly 3 EM.jpg (140.44 KiB) Viewed 1741 times
dmitrij
Posts: 1
Joined: Monday 22 January 2018 7:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Shelly 3em monitor

Post by dmitrij »

In my Shelly Android app i have a tab named "Monthly Reports". This tab is empty with a comment, which says "To receive the monthly reports, you need to be a premium user."
So, If you plan to have monthly stats from Shelly - you need premium subscription. If you want to calculate such stats in Domoticz - you need process data there.
I just started using Shelly 3EM and also look for same solution.
User avatar
waltervl
Posts: 5741
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Shelly 3em monitor

Post by waltervl »

Just go to the report page of the device (click on Log and then Report) and you can go back for years. See wiki page https://www.domoticz.com/wiki/Managing_ ... ice_Report

Also the Log page gives already a lot of data
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
imautohuttraeger
Posts: 112
Joined: Saturday 14 March 2020 13:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Shelly 3em monitor

Post by imautohuttraeger »

I also have a Shelly 3EM via Shelly MQTT. How do you get the "instant consumption"? I only have things like voltage, ampere and powerfactor, but not the actual power in watt.

Do I have to calculate it via script? I am strugling with this.
User avatar
gizmocuz
Posts: 2486
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Shelly 3em monitor

Post by gizmocuz »

You could use MQTT Auto Discovery and create config objects for the shelly MQTT outputs

For example:

homeassistant/sensor/shellyem-1-0/power/config

Code: Select all

{
  "dev": {
    "ids": [
      "485519DABF59"
    ]
  },
  "name": "shellyem-1 Power 0 R",
  "stat_t": "~emeter/0/power",
  "avty_t": "~online",
  "pl_avail": "true",
  "pl_not_avail": "false",
  "enabled_by_default": true,
  "uniq_id": "485519DABF59_0_power",
  "qos": 0,
  "~": "shellies/shellyem-1/",
  "dev_cla": "power",
  "stat_cla": "measurement",
  "unit_of_meas": "W",
  "val_tpl": "{{value|float|round(1)}}"
}
homeassistant/sensor/shellyem-1-0/total/config

Code: Select all

{
  "dev": {
    "ids": [
      "485519DABF592"
    ]
  },
  "name": "shellyem-1 Total 0",
  "stat_t": "~emeter/0/total",
  "avty_t": "~online",
  "pl_avail": "true",
  "pl_not_avail": "false",
  "enabled_by_default": true,
  "uniq_id": "485519DABF592_0_total",
  "qos": 0,
  "~": "shellies/shellyem-1/",
  "dev_cla": "energy",
  "la_te": true,
  "stat_cla": "total_increasing",
  "unit_of_meas": "Wh",
  "val_tpl": "{{value|round(2)}}"
}
Make sure all id's are unique and you group the power/usage like above

Example for the voltage

homeassistant/sensor/shellyem-1-0/voltage/config

Code: Select all

{
  "dev": {
    "ids": [
      "485519DABF59"
    ]
  },
  "name": "shellyem-1 Voltage 0",
  "stat_t": "~emeter/0/voltage",
  "enabled_by_default": true,
  "uniq_id": "485519DABF59_0_voltage",
  "qos": 0,
  "~": "shellies/shellyem-1/",
  "dev_cla": "voltage",
  "stat_cla": "measurement",
  "unit_of_meas": "V",
  "val_tpl": "{{value|float|round(1)}}",
  "avty_t": "~online",
  "pl_avail": "true",
  "pl_not_avail": "false"
}
I am using a application called MQTT Explorer.
Make sure the config objects you publish with the 'retain' topic set, so the will always be there

Once they are in Domoticz you should get monthly year graphs/reports

Once you have all 3 phases in Domoticz, you could create a script that generates a P1 Meter from these values
Quality outlives Quantity!
imautohuttraeger
Posts: 112
Joined: Saturday 14 March 2020 13:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Shelly 3em monitor

Post by imautohuttraeger »

Thank you! I will have a look on it (will last a while until I will have enough time) and try if I can work it out. But I think it will be too sophisticated for a guy like me, who is just a user with very little programming skills and knowledge.

However, what I managed meanwhile is, to sum up Voltage, Ampere and Powerfactor via dzVents Script (a lot of copy and paste and help by ChatGPT 😉) and fill a virtual device with it. It works wit a custom device. But when I try to use a virtual device of Type electric usage, it receives no data.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest