Local Tuya - missing comma in values (Problem solved)

Hello, supermen!

I want to praise this Home Assistant is great! And the remote control is great I’m glad I subscribed to it.

But to my problem.

I have one device running on Local Tuya (I configured it with IOT tuya it all works great) the problem I have is with the result values. I am using the ATORCH-Temperature Controller (S1TW) and I am getting data like Volts, Amps, Temperature, kwh etc. as a result the data is not displayed correctly, the values are fine but there is a decimal point error. Can you advise me?
I have tried different procedures from different forums (and github) but none of them solved my problem.

udaje

As I write I tried different tricks ( Smart Life (tuya) show wrong temperature - Configuration - Home Assistant Community (home-assistant.io) but still nothing values are the same or it doesn’t work at all when changing / editing climate.py in localtuya
thank you for any help.

My server info
Home Assistant 2023.9.3
Supervisor 2023.09.2
Frontend: 20230911.0 - latest

//////////////// UPDATE ////////////////
When I change the language of Home Assistant some components appear fine. So I’m asking is this a problem with Home Assitant and not the LocalTuya integration?
After changing the language to English


After language change to Slovak

correct values
“Amper:” 0,213A
“Celkova spotreba:” 13,711 kWh
“Cena spotreby:” 31,809 €
“TempAchor:” 21,2 C
“Volt:” 232 (this is ok)
“Watt:” 43,11 W
I also changed the number format in the profile and then some components get the correct result

The “Scaling” of an(any) entities is an option when you add your device to the LocalTuya-Integration
I don’t know your Device but , you can get a full Spec of your device in IOT Tuya, however when you now have the “faulty” result it’s obvious how you should have “Scaled” the various entities. a more “common” overview you can find in below link, there are a few more Topics in this Forum , in regards to the same.

I’n your case
A= Devide by 1000 ( or maybe factor 0.01, or 0.1)
kWh= same as above
€uro= same
Temp= Devide by 10 (or maybe factor 0,1)
W= devide by 1000 ( or maybe factor 0,01, or 0.1)

best is to find the Spec for your device in IOT Tuya
But as it’s your first Device you might aswell just “try by error”

link to overview on the principle

Another Topic, where you get some hints and links to Device-Specs

As i havn’t touched my LocalTuya for ages, it turns out i have to look up my Tokens/Secrets again
But maybe you can just go to the integration and click “Edit Device” an can “tamper” with the scaling-factor, there

1 Like

@boheme61 Thank you for the answer. i will look into it. It’s my first TUYA-based device.
i have many devices at home that i already control (xiaomi thermostat, 3d print - octoprint, sonoff switches, switches, cameras, etc.) These all work for me.
The only problem I have so far is with this TUYA, it’s an excellent device at a good price so I’m trying to get it into home assistant . But I will look at your advice and let you know if I solve the problem to help others.

When I change the language of Home Assistant some components appear fine. So I’m asking is this a problem with Home Assitant and not the LocalTuya integration?
After changing the language to English


After language change to Slovak

correct values
“Amper:” 0,213A
“Celkova spotreba:” 13,711 kWh
“Cena spotreby:” 31,809 €
“TempAchor:” 21,2 C
“Volt:” 232 (this is ok)
“Watt:” 43,11 W
I also changed the number format in the profile and then some components get the correct result

Nothing have change in the sensors-state-value( beside increases/variations ) , only in your dashboard, language on your entities/dashboard
You need to either “mutiply in a template” or edit the devices ( i believe it’s called "factor or something, when you added the devices/sensors.

You can now change that by go to /Settings/Devices-Integration/click LocalTuya, Click Configure, Tick(devices) click the device you want to make changes on, Click through, sumit, submit, until you come to “last” there you will see " Scaling Factor " , then try your luck, as mentioned in my previous posts ( 0.1 or 0.01 ) this is == multiply, you will notice the result, Before you click finnish, If the result is not correct, try another) , but basically it’s Math, use ur calculator …i.e temp 212X0.1=21.2

1 Like

How can this be correct ? this means either that this devices-usage cost, ( 31 thousand 890 Euro AND 00 cents ) OR it means that the cost is, ( 31 Euro AND 890 Cents ) 890cents=8.9Euro :wink:

EDIT: ok it could be because of the way the “stock-prices” is calculated, also your kwh sensor i would “check” so you are sure that it’s i.e 13.7kWh for the total price of 31.8Euro ( that would be about +2.3 euro per kwh … hmmm, very expensive :slight_smile:

1 Like

I have shut down this sensor. It’s nonsense. It’s miscalculating. It’s a device error. I didn’t notice in tuya that it’s not the euro but some Chinese currency. I apologize. :smiley:

I don’t know, but i wouldn’t bet on it, it can be a little tricky to get it right in LocalTuya, but if you reset a device and start from scratch ( AND know how much the device “draws” i.e 43W in 24 hour is 1.032kWh ) from this you can estimate which “Scaling Factor” you need to use for kWh, and for the price-sensor … I Wonder !, this can impossible be a “fixed amount per kwh” nor a “fixed currency”, so somehow this sensor must have additional-settings you have to apply correctly

Thanks mate. I’m learning thanks to you. The temperature is already sitting, I set the scaling to 0.1. And I’m trying the rest.

the temperature is set and the dashboard is already showing accurately.

Ampere raw data comes from the device (iot tuya) 1500a (on the display of the device 1.5a). which means to calculate 1500/1000 = 1.5a which is correct. but when I set the scaling to 1000 home assistant displays 1 506 000.0a. Does it also depend on how I set the device class?

tuya app

achor hardware display

Great you didn’t give up :wink: , tha amp(scaling factor) should be 0.001 , good luck

Sorry ive never seen such a display, next would be figure out where the price/cost comes from

PS: device-class for AMP should be “Current” for V it’s voltage

I bought the device a year ago for 20e. Now it’s more expensive. but it’s a great thing, it has a lot of features. But I can’t buy more pieces anymore because in the country where I live in Austria is banned the sale of Aliexpress can not order anything anymore.
https://de.aliexpress.com/item/1005004882580753.html

Thank you it works !!! I’ll just try to further map other functions of this great hardware. Such as the power switch (it has spinning even at certain temperatures etc.) and more and more sensors.

1 Like

Yeah, it looks to have many options !, i don’t know if iot.tuya.com can reconice all ? but you can find a full spec(cording to tuya ! :slight_smile: )
login: then " Cloud → API Explorer → Smart Home Device System → Device Management " go through the various menu-topics, even above(the menu to the left) , there you are asked to paste in the device id, you have registered in your “Project”
Always nice to have a spec, of details people normally don’t have a clue what means, or have use for :slight_smile:

How many “probe-sensors” can you plug-in to it ?

sensors - mine only had a choice of humidity or temperature when I bought the device. And now I see that there is probably a model that has two connections. not sure on aliexpress on that link there is a last model with about two probes

I still have to learn from IOT Tuya. I’ve barely managed to capture the sensor IDs through the browser development tools, which is what tuya transmits. I’m going to see what else it can do. I still have a lot to learn.

1 Like