Shelly devices units don't match in SmartThings

Offtopic

Hello @nayelyz
I have a Shelly EM with 2 clamps: one to read the production of my solar panels and the other to read the house consumption.
When I look at Shelly App I see these values:

image

Panels with 1.5kW of production
And I’m sending 957.82W to the grid
When I look at the ST App, what I see is this:

image

image

(When I took the print, the values already changed :slight_smile: )

What I mean is 1.5kW are being showed as 1.5Mw

Is this normal?

Hi @andre_petinga please, can you enable the support access to check it?

In this case, I need to check how is the device sending the information to understand what is happening

  1. Confirm the email account registered in the forum is the same one you use for SmartThings. If not, please share it with me over DM.
  2. Enable support access to your account:
  1. Go to the SmartThings Web (my.smartthings.com)
  2. Log in to your Samsung Account
  3. Select Menu (⋮) and choose Settings
  4. Toggle on Account Data Access
  5. Select the time period and confirm - In this step, please select “Until turned off”, once the team finishes, we’ll let you know so you can disable it again.

Hello @AlejandroPadilla.
The Account Data Access is now enabled.

I have checked the devices and they both have unit "kWh, so let me some time to investigate the possible reason

"unit":"kWh"
1 Like

Hi @andre_petinga I’m back, sorry for the delay

I made some tests and I was able to confirm some things, first the app rounds values for example I send this value

component: 'main',
capability: 'st.energyMeter',
attribute: 'energy',
value: 21200.34,
unit: 'kWh'

and the app shows the following


so, my conclusion is that the app rounds the value and this is the reason for mWh, I have been able to see the manufacturer’s logs, and they only sent the value, not the unit, so I don’t know how they are managing this or if when a value is sent it means kWh or mWh.

you can confirm if the values are correct by rounding by yourself (on my test it works correctly) and if something is wrong you should contact the manufacturer to check how they are handling the value

Ok, thank you for your time.
The values are correct, just need to now that W in Shelly are kW in ST, and kW in Shelly are mW in ST.
That’s ok.

One other thing, if you can help me…

Since this Shelly devices are shown in ST as a Switch, is there a way to make a virtual device that can show the value in the tile? Mirroring the value from the Shelly device??

What do you mean? you can create virtual devices on https://my.smartthings.com/advanced/devices but I’m not sure what is the problem that you want to solve

If you have SmartThings / Aeotec Hub you can use this driver and Energy virtual device

It is possible to define scaling in the Energy virtual device’s settings.
I think that using Rules API is possible to copy Shelly energy values to Energy virtual device.

1 Like

Yes, I think this is what a want…
An Energy device will show the value (kwh) in the tile.
So I will only have to discover how to copy the Shelly value to the Virtual Device :slight_smile:

Thanks.

You can use these as a template

You have to modify rules to use correct capabilities, commands and device ids.

I made some testing.
I think that is only possible to only select unit in the Energy virtual device’s settings.

You can ask from T Austin if he can add scaling to Energy virtual device.

Thanks!!
It works! I’ve never made a Rule API before, but after your example and some reading of Rules API documentation, I was able to make my first 2 rules :slight_smile:
Now I have these 2 devices, that show the values in the tile:

Just don’t understand why do you need the 2nd rule to update every 10 minutes. In my case, the values are constantly updating, with just 1 rule…

Yes, going to the device settings I can choose between Wh and kWh, but the problem remains (like I said on the first post…
As you can see in the picture above, I have selected the Wh option, and the 1256.9wh value corresponds to 1.25kWh, and that is what I would like to see on the tile…
If I change to kWh this 1256.9wh changes to 1.256Mwh :frowning:

I just don’t understand what do you mean with “You can ask from T Austin if he can add scaling to Energy virtual device.

1 Like

Temperature or humidity can remain unchanged for a long time.

@TAustin
Is it possible to add scaling option (setting) to Energy virtual device?
André knows what kind of scaling is needed.

Yes, I see what you mean…

Another question for you @TapioX : How can I make a calculation using a Rule API ???

Example: I want to create another virtual device that will give me the “House Real Consumption”.
For this I need to make the sum of both Shelly devices values: “Production + Consumption”.

How can I construct a sum with Rules API ?

Calculations are not possible as far as I know.

Calculations could be done with a Raspberry Pi for example.
I use a cheap Raspberry Pi Zero, Python Code and MQTT communication.

1 Like

I’m not sure I have any control over what the SmartThings app shows in terms of units. In my experience, it doesn’t matter what value and unit combination I ‘send’ to SmartThings - it will display the value/unit that it wants to.

If I have understood right Shelly is measuring power values (W).

Can you use Energy virtual device’s powerMeter capability?
Power Meter’s default unit is watt (W).

You are now using energyMeter which default unit is kilowatt hour (kWh).

Yes, I can. And you are correct, this way is more accurate…

I just don’t understand one thing.
The value in the tile stays like this:

image

But when I access the device, it show like this:

And this is the correct thing, because it changes automatically to kW because it is greater than 999.

Why this doesn’t replicates in the tile info???
Instead of 1417.7W it should show 1.4kW, right???

I don’t have an answer for this. You better ask SmartThings people.

1 Like

@AlejandroPadilla any ideia ??? :slight_smile: