#Smart Plugs and mistake ?

1 messages ยท Page 1 of 1 (latest)

scarlet finch
#

So a month ago I bought 3 of these TuYa smart plugs (with power monitoring). (https://www.zigbee2mqtt.io/devices/TS011F_plug_1.html#tuya-ts011f_plug_1)

My main goal is to monitor all energy usages for individual devices. I've been told that these TuYa smart plugs are bad.
Right now, on the energy dashboard for the three devices that have this smart plug are showing the energy total usage over the past week slowly rising. (no energy on the third one cause the heating is off for a few days now)
I have not made any special dashboards or connected a new DB (mariaDB) to Home Assistant to create special dashboards/graphics but I am going to do that.

My question is, because I have been told these are bad, I don't wanna make the mistake of buying these again. What am I missing right now in HA because I bought these bad TuYa smart plugs?

Am I missing any specific attributes cause of it? potential information points of the individual devices? I don't mind paying more for the smart plugs to get better quality and more potential.

Or should I just buy the same ones with the attributes and options they are giving me because it's the same as any other more expensive versions?

Clarification: These smart plugs do have the 'energy attribute' or else they couldn't have been added to the dashboard.

Extra information:
EU (The Netherlands)
Z2MQQT protocol.
Installed on an old Laptop (for now)
Setup HA on Docker with docker-compose
Zigbee2mqtt, Mosquitto 2.0 and HA have their own container and it all works good.

hard scroll
#

I don't know what's purportedly BAD about the Tuyas. And, I can't help you with EU device recommendations. As for missing attributes, I think you are fine. If you really want apparent power, you could multiply Volts * Current to get VA. Do you need Frequency? Probably not at the device level.

Have you checked in with the HA zigbee channel? (I use zwave, and all but a few are in-wall switches or dimmers). I don't have that many plugged in loads I care about monitoring. Server, Freezer, Furnace/AC Blower are about it for now...

Since the Tuyas have both power and (lifetime?) energy, you could proceed two ways. 1) Feed the power through a Rhimann integration (method: left) to compute your own lifetime energy, or 2) use the lifetime energy directly. Either energy sensor can be the source: for utility_meter:s which will create, hourly, daily, monthly, etc. energy values that reset at the end of the specified period. You can also specify tariffs which will further split energy into, generally, time-of-day specific sensors. But you need an automation to do that.

scarlet finch
# hard scroll I don't know what's purportedly BAD about the Tuyas. And, I can't help you with...

Hey @hard scroll thank you for your response, I have to questions for a new HA user like me.

If you really want apparent power, you could multiply Volts * Current to get VA.
Where do I do this? is there a guide on this? (assuming config yaml file)

Since the Tuyas have both power and (lifetime?) energy
At the end of the day the energy dashboard (resets) (I didnt do anything for this) per device but when you click on it, it shows ALL time energy usage. I bet you mean this with the (lifetime) part?

Either energy sensor can be the source: for utility_meter:s which will create, hourly, daily, monthly, etc. energy values that reset at the end of the specified period.
Is there a guide on setting this up? is this in the config yaml file? I'd like to figure this out before buying more smart plugs I guess.

#

in the next few days I might be adding MariaDB to my docker setup and then connecting it to HA resetting all my data (thats fine)

hard scroll
#

You will need a template sensor to compute VA. See HA's Template integration documentation. https://www.home-assistant.io/integrations/template/

The energy dashboard does its own thing, apparently. I don't use it. I'm building my own dashboard, everything I have is in yaml fil;es, not the frontend editor.

I use a package that contains all aspects of my electric configuration. See: https://www.home-assistant.io/docs/configuration/packages/
Add packages under homeassistant: in configuration.yaml:

homeassistant:
  packages: !include_dir_named packages

where the directory packages is a child of /config.
Here is a shortened example of my utility package:
https://pastebin.com/5bGJjw5v
See also the HA utility_meter documentation:
https://www.home-assistant.io/integrations/utility_meter/

Its up to you, but there is no hurry getting mariadb running if you are focused on electric data right now, particularly if you don't care about wiping the data.

I would, however, appreciate your docker-compose for mariadb and how you set up credentials for it. I played with it a while back and didn't have much luck.

scarlet finch
#

Tbh jumper, I am learning more and more, the attributes that the TuYa smart plugs have are very complete.

I have the entities:
Current
state_class: measurement
unit_of_measurement: A
device_class: current
#I thought that current would be the one for total current usage at a moment but not sure about it, seems like 'Power' attribute is for that cause of the unit_of_measurement being 'W' for Power and 'A' for Current.

Energy
state_class: total_increasing
unit_of_measurement: kWh
device_class: energy
#the state_class and unite_of_measurement make it so the attribute never resets and just keeps adding on the total usage. I would think I can use this for daily/weekly/monthly dashboard graphs.

Power
state_class: measurement
unit_of_measurement: W
device_class: power
#The state_class 'measurement' here + the W for Watt gives me the option to see the current usage of the device and with that I can see on what moments of the day it used the most energy when I am gaming or streaming. Example: at 4PM you saw the current energy usage spike above a certain amount of watt for a longer period of time.

Voltage
state_class: measurement
unit_of_measurement: V
device_class: voltage
#I am not sure what I can use voltage for yet or what the normal thing is that people do with this.

My gut feeling is telling me that these are the most important attributes that you can get from a smart plug and that I can create any graphs I can think of with some basic math. Are there any attributes I am missing that you can think off?

#

So I might just stick to my TuYa smart sockets even though I've heard they are 'bad'.

scarlet finch
#

hope my explanation of the entities and attributes isn't completely wrong just a bit above here

#

๐Ÿ˜…

hard scroll
#

A very basic electrical equation: V * A = W. (Pressure * volume = work). All are instantaneous readings sampled as often as you tell Tuya to do so.

The integral of Watts over time is Energy (Wh or kWh). It appears Tuya is computing kWh for you so you don't have to integrate Watts using the Rhimann integration to derive kWh .

Really, for now, just just look at energy and watts. You can use the energy (total_increasing) as the source: for utility_meters to get daily, monthly, and, tariffs for time of day if you care. Use Watts for plots that show real-time demand (Tuya devices or mains meter) or supply (solar). Don't get hung up on precision as a substitute for useful.

scarlet finch
#

Yes, so for now look at energy (kWh output) and Power (watts output).

#

I dove into the Utility_meters helper after your message as i've never used that before and (I think) it works

#

I made an Entity ID called 'Sensor.dennispcmonthly' with the helper.

#

These are the stats I used.
for 'Meter reset offset' I wasn't sure but I saw in a guide that he made it 1 instead of 0 so I went with that.
I turned on Net consumption and Periodically resetting.
Net consumption cause of the information it provides in the screenshot, a PC uses more energy/power when being used so that fluctuates obviously.
Periodically resetting I turned on cause I dont want everything to reset the moment I turn off my PC or it goes into sleep mode.

scarlet finch
#

So I am getting somewhere ๐Ÿ˜„

hard scroll
#

If you want the monthly reset to occur at midnight the first of each month, use a Zero offset, not One. The cron entry that shows in your one screenshot shows
" 0 0 2 * * ". That's midnight on the second of each month. See: https://crontab.guru/#0_0_2_*_* You don't need net_consumption since you don't have something like solar that will cause the cumulative total (load) to decrease.

scarlet finch
#

I will be getting solar in 5 months

#

but thats a problem for future me ๐Ÿ˜„

#

Ill replace the utility helpers and make it 0 again

hard scroll
#

When you get solar, you will need to have sensors on your Mains (Service Panel) and on the Solar inverter to monitor whole home gross and net usage/production.

scarlet finch
#

Yeah when we get solar we will have a new filled up utility closet with new groups.