Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS0201 does not update frequently enough. #4202

Closed
SargonofAssyria opened this issue Aug 28, 2020 · 78 comments
Closed

TS0201 does not update frequently enough. #4202

SargonofAssyria opened this issue Aug 28, 2020 · 78 comments

Comments

@SargonofAssyria
Copy link

The TS0201 does only update a few times per day while temperature and humidity change a lot more.
The device presents it self as: Model is TS0201 by _TZ2000_a476raq2.
The steps of temp changes are high. Sometimes more then 2 degrees, but mostly 0.7 - 0.9 degrees between updates.
The setting I use in the configuration.yaml are:
temperature_precision: 2
temperature_calibration: -2
I have used other 'precisions' but the result is the same.
Is there a 'hidden' setting about the update frequency?
I have a Cresta, TFA TS34C nearby and that device change dozens of times per day in increments of 0.1 degree.

What did you expect to happen

The TS0201 should have (almost) same kind if updates.

Debug Info

Zigbee2MQTT version: 1.14.3-dev (commit #a78d0f6)
Adapter hardware: CC1352P-2
Adapter firmware version: 20200805

@Koenkk
Copy link
Owner

Koenkk commented Aug 28, 2020

You can check if it can be configured more often by changing the entry in devices.js to:

{
    zigbeeModel: ['TS0201'],
    model: 'TS0201',
    vendor: 'TuYa',
    description: 'Temperature & humidity sensor with display',
    supports: 'temperature and humidity',
    fromZigbee: [fz.battery, fz.temperature, fz.humidity],
    toZigbee: [],
    meta: {configureKey: 1},
    configure: async (device, coordinatorEndpoint) => {
        const endpoint = device.getEndpoint(1);
        const binds = ['msTemperatureMeasurement'];
        await bind(endpoint, coordinatorEndpoint, binds);
        await configureReporting.temperature(endpoint, {min: 1, max: 5, change 1});
    },
},

See https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html how to edit devices.js.

@sjorge
Copy link
Sponsor Contributor

sjorge commented Aug 28, 2020

I too have a bunch of them, they do indeed go hours without updates at times. A heiman next to it to compared logged 2-3 deg change over the time.

Not sure they support reporting, I got back an error. I will also try again next time I am at my computer if @SargonofAssyria doesn’t beet me too it

@sjorge
Copy link
Sponsor Contributor

sjorge commented Aug 28, 2020

Just a heads up, there is an error in your new device entry, there needs to be a : behind change.

@SargonofAssyria
Copy link
Author

SargonofAssyria commented Aug 29, 2020

I got messages that the device was configured and succesfully interviewed, but some what later I got.
error 2020-08-29 09:46:30: Failed to configure 'Woonkamer', attempt 3 (Error: ConfigureReporting 0xec1bbdfffea1474e/1 msTemperatureMeasurement([{"attribute":"measuredValue","minimumReportInterval":1,"maximumReportInterval":5,"reportableChange":1}], {"timeout":10000,"disableResponse":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null}) failed (Timeout - 29275 - 1 - 13 - 1026 - 7 after 10000ms) at Timeout._onTimeout (/home/pi/zigbee2mqtt/node_modules/zigbee-herdsman/dist/utils/waitress.js:46:35) at listOnTimeout (internal/timers.js:549:17) at processTimers (internal/timers.js:492:7))
Have to wait if the changes are accepted by the device.

@SargonofAssyria
Copy link
Author

Half a day later. The Cresta had several increments of 0.1 degrees. The TS0201 still is at the same temperature.
'Last seen' date and time still from the start of zigbee2mqtt.
So the solution did not work, also seen by the error in the logfile.

@Koenkk
Copy link
Owner

Koenkk commented Aug 29, 2020

@SargonofAssyria so it seems that we cannot configure the device to report more often unfortunately

@SargonofAssyria
Copy link
Author

To bad. Tnx for the effort.

@Bartekn86
Copy link

ive asked tuya to update firmware to fix problem, i have same issue

@sjorge
Copy link
Sponsor Contributor

sjorge commented Aug 30, 2020

Yep, same issue with mine I just retried, same error I as when i tried it a few weeks ago too. Device was awake because I kept it online by pushing the little button, to rule out it taking a nap.

@SargonofAssyria
Copy link
Author

SargonofAssyria commented Aug 30, 2020

After I left the device at rest, it seems to have a default step size of 0.7 degrees.
Is that something that could be investigated further, changing the step size?
It looks that the step size for humidity update is 2%. Below 2% change there is no update.

@jandy123
Copy link

In a desperate attempt to improve the reporting frequency (or alternatively decrease the reporting threshold), I've noticed that the device reports data every 1 minute if the button is continuously kept pressed. I, however, have no clue what the implication on battery life are. If anyone could do some measurements, I'd be very curious...

@SargonofAssyria
Copy link
Author

I tried that too, and it works some times. But I also get messages about leaving the network, so I have to include it again.
I looks like that every time you push the button Temp and hum is sent.
I tried to dissemble it without breaking it, but did not succeed yet.

@jandy123
Copy link

jandy123 commented Oct 16, 2020

@SargonofAssyria : I've managed to dissemble it without breaking and block the button in the pushed position. So far so good, for me it reports data every minute and the signal symbol on the LCD is blinking like every second. While this works here, I doubt battery life wilkl be great, but, as I said, I cannot measure such small current with the tools I have....

To disassemble, just start in the battery compartment, inserting some screwdriver forcing a bit, and at the same time popping the plastic clips all around. There are like 5 clips, I'd recommend starting below where there are a few holes (it's only one clip there).

Btw., I certainly don't have disconnections problems. Maybe in your case LQI is too small ???

@SargonofAssyria
Copy link
Author

Tnx, for the instructions how to open the TS0201. I block the switch and see the updates coming every minute.
Now wait how the battery holds.

@cpuks
Copy link

cpuks commented Oct 21, 2020

Any reports on battery life after modification as otherwise it's useless due to no updates.

@jandy123
Copy link

As I said, that's no way for me to measure actual current, so just looking at the battery voltage it's still at the starting value.

So, looks fine here !

@SargonofAssyria
Copy link
Author

SargonofAssyria commented Oct 22, 2020

After the modification ( 1 week ago ) battery is still at 100% and voltage dropped from 2.9 Volt to 2.8 Volt.
They where not fresh batteries. It could be that battery voltage changed from 2.86 to 2.84
So there is some impact, but have to wait until the devices dies on battery power.

@jandy123
Copy link

jandy123 commented Nov 7, 2020

Well, battery life is just about two weeks with good batteries. In my opinion this is simply not acceptable...

@sjorge
Copy link
Sponsor Contributor

sjorge commented Nov 7, 2020

I switched all of mine to the new sonoff ones, they u take annoying cell batteries but atleast update often enough for me to get nice data. And they were super cheap in bulk.

@SargonofAssyria
Copy link
Author

Mine are after more then 3 weeks still at 100% and voltage 2.700
Which "new sonoff ones"?

@sjorge
Copy link
Sponsor Contributor

sjorge commented Nov 7, 2020 via email

@SargonofAssyria
Copy link
Author

Tnx, I have a Xiaomi look a like. But this one does not have a display.

@Bartekn86
Copy link

is there any firmware update ?

@SargonofAssyria
Copy link
Author

Device does not support OTA.

@Bartekn86
Copy link

how they flashed firmware first time ? :-)

@sjorge
Copy link
Sponsor Contributor

sjorge commented Nov 8, 2020

how they flashed firmware first time ? :-)

Factory bakes them in, sometimes making fuses burn in the result to make it truly read only...
Theoretically you could probbaly use a romflasher to dump and then flash the chip again. But you need:

  • figure out the exact chip and pin layout of the rom
  • a compatible rom flasher
  • a device with a new firmware to dump
  • dump the firmare
  • flash the firmware on the rom chip of a device with the old firmware
  • oops nope, you need to back that one up first in case the new one works
  • hope it still works after.

Realistically speaking if the device does not support Zigbee OTA you're not going to get fimrware updates for it, and if it does... it's still a difficult to get the firmware files.

@SargonofAssyria
Copy link
Author

Mine are after more then 4 weeks still at 100% and voltage 2.600
I think the 100% is wrong, but device still working, although voltage is going down rapidly.

@jandy123
Copy link

jandy123 commented Nov 15, 2020 via email

@falmanna
Copy link

I have 20 of these sensors, the battery lasts for 2 months at max. This is definitely not acceptable since it is being advertised as a one-year battery lifetime, and in reality, it is not even 1/4 of that.

@jandy123
Copy link

jandy123 commented Nov 3, 2021

@eloo

i hope the battery is not going to be drained too fast but we will see.

I hope so, please report here for comparison. I've just changed batteries (alkaline) in a modded device.

i have also slightly improved your setup. so i can get the VCC from a pad like the others

Sure, but I'd be careful when physically pushing the button on the device, if the Attyni is powered/working.

I did enable BOD (1.8V), since the device stops working anyhow at 1.9V.
Also I used 1.2 MHz internal oscillator.

Let's see what happens!

@jandy123
Copy link

jandy123 commented Nov 3, 2021

Btw., I'm also considering powering the devices using eneloops. Has anyone tried this? Any figures regarding battery life?

Thanks!

@falmanna
Copy link

falmanna commented Nov 3, 2021

@jandy123 I got 30 of these sensors and the battery life was poor. They used to last for 3 months on energizer batteries.

@jandy123
Copy link

jandy123 commented Nov 3, 2021

@falmanna Hmm, that's not much. Curious about rechargeables even more...

@dim6003
Copy link

dim6003 commented Dec 7, 2021

Hello,
Having the same sensor, and of course same issue. Maybe some resistor or capacitor on the board manages the frequency of sending? but was unable to find any schematics... Also some components are missing from the board.

@3615JMD
Copy link

3615JMD commented Dec 23, 2021

Hello, @jandy123: thank you for providing this solution that works fine. ATTiny adds 4µA of current drain. not so much. that is 35 mAH per year.
I have improved the code so that the ATTiny output does not interfere with the push button. this is very simple: Program digital pin level as LOW (always) and then program the pin as INPUT. therefore the pin is Hi-Z except during the ISR where you program the PIN as OUTPUT for a while just to pull down the button signal, then INPUT = Hi-Z again for some minutes.

@jandy123
Copy link

@3615JMD Great, thanks for sharing!

===

Btw., battery life with eneloops is by no means great. (I suspect the zigbee chip + lcd screen are the biggest consumers; not much to do here.)

I get about 3-4 weeks of a pair of new eneloops 750ma. Well, at least I can recharge them quite a number of times ;).

@eloo
Copy link

eloo commented Dec 23, 2021

@jandy123 do you plan to provide an updated version of your code?

and maybe we should make a gist out of it

@jandy123
Copy link

@eloo Please do so; sorry no time for it ;) Would be great to include the latest contribution by @3615JMD.

Cheers and happy holidays!

@eloo
Copy link

eloo commented Dec 27, 2021

@jandy123 @3615JMD
i've created a gist for the TS0201 with ATTiny13

I've also added the mod from @3615JMD, maybe you can give feedback if this is what you have explained above.

Feel free to give feedback

edit:
forgot to add the link :D
https://gist.github.com/eloo/517396236af87f29495d31fb0f868401

@3615JMD
Copy link

3615JMD commented Dec 28, 2021

@eloo,
Yes, that was exactly my Idea. It works fine at home on 3 x TS0201 for the moment.
Sorry for not sharing my code, but I adapted & compiled it in Atmel Studio and it is quite different regarding I/O control. Showing my code would probably add confusion to arduino users.
Cheers to everybody here !
Jean Marc.

@petitchti
Copy link

Hi everyone,

Just got some TS0201 and have the same problem. However the hack with Attyni13 seems promising.

But what about the battery life with this hack? I see 3-4weeks with 750mA batteries in the previous posts. Is it with the hack? Does anyone have a kind of comparison of battery life with and without this hack?

Thanks :)

@eloo
Copy link

eloo commented Jan 2, 2022

Hi @petitchti,

my current battery life experience is that 2/4 are still running the original batteries (around 6 month now in total and 2 month with the ATTiny in place)
The other two have 750 mA eneloops. One was already empty (but this one is battery drainer in general, i guess quality issues) and the other one is running since over 2 month with ATTiny and without battery change.

So IMHO we can expect a runtime more than 2 month in general. I guess 3 or 4 month could be possible.

@jandy123
Copy link

jandy123 commented Jan 4, 2022

@eloo 6 months is crazy... Are they connected to Zigbee?

I (re)placed on the 22nd December 2021 eneloops 750ma in one device and it's still running. I'll report again when it dies.

@RuneNyhuus
Copy link

So im in the same boat..
And think i will try with this Attyni13 to hack mine too..
What is the cheapest way to configure the Attyni13? is it an Adriuno uno ?
Im pretty new to this.

@eloo
Copy link

eloo commented Jan 18, 2022

@RuneNyhuus
i'm using an usbasp with isp programmer..
like this
https://www.amazon.de/Paradisetronic-com-Programmierger%C3%A4t-ISP-Adapter-Programmer-Arduino/dp/B07Y3B8H91/ref=pd_lpo_1?pd_rd_i=B07Y3B8H91&psc=1

@jandy123
Copy link

jandy123 commented Feb 9, 2022

I promised to report battery life using eneloops 750mah.

Well, here it is: after 7 weeks of working, today voltage dropped to 1.0v per cell and device stopped working.

Still, I find 7 weeks quite reasonable.

@mecrean
Copy link

mecrean commented Mar 28, 2022

Hi,
Thanks @eloo for the mod to force TS02210 refresh !
I am installing the ATTiny13 in mine.
But after test, TS0201 refresh informations 2x after 15 min remaining (second refresh 1 second after first).
See attach
Is this normal ?
Mecrean
TS201_ATTtiny13aMod-histo.csv

@jandy123
Copy link

jandy123 commented Apr 3, 2022

@mecrean Looks more like you need to enable debouncing. In case you use zigbee2mqtt, check out this option https://www.zigbee2mqtt.io/guide/configuration/devices-groups.html#common-device-options

@MiG-41
Copy link

MiG-41 commented Jul 13, 2022

@jandy123 , in your code there is sentence
when pushed, button is pulled down by 10k resistor in the device

I looked on PCB of TS0201 ,and found a 10k with is in series with the button ( button gives shortcut Pin3 of P1 socket on TS0201 to the ground thru 10k resistor) , but connecting directly to pins P1 of TS0201 this resistor is bypassed ( ATTINY13 is shortcuting it directly , unless there is some internal 10k resistor in ATTINY13 ?) . I modified this solution by adding 10k resistor beetween ATTINY13 PIN6 and Pin3 of P1 field on TS0201 and still works ok.

@lorenzoconforti
Copy link

lorenzoconforti commented Oct 14, 2022

I was really disappointed by this temperature sensor but then I found this page. I have a few of these that I'm planning to use to control TRVs so I need them sending data regularly. Ideally more frequently in winter.
I've made some changes to the code and added a dip switch with two switches so that I can set the transmission frequency on one of four options. In my case: 1 (mainly for testing purposes), 3, 8 or 20 minutes.
So far it has been working great. Battery life isn't fantastic on these devices but the flexibility of being able to control send frequency is great.
20221008_235153
20221008_235230
20221008_235950
Screenshot_20221014-102410_Chrome~2

@KipK
Copy link

KipK commented Dec 9, 2023

You can now flash those device with firmware from https://github.com/pvvx/ZigbeeTLc

Default intervals for temperature and humidity reporting are set to 30-120 (min-max) seconds, reportableChanged to 0.1C and 0.5%.
Additional adjustments to consumption consumption and correction of the report transmission functions algorithm.
Switch temperature between Celsius and Fahrenheit
Added Poll Control Cluster

@petitchti
Copy link

Hello KipK,
Good to know! Thanks for the notification!
Original device concerned by this topic is the TS0201_TZ2000.
I don't see it in the compatible devices of the GitHub link you shared...
Do you know if this firmware update is then compatible?

@KipK
Copy link

KipK commented Dec 10, 2023

there's a firmware for the TS0201_TZ3000.
I haven't found any difference between the TZ2000 & TZ3000 but the form factor. Untested though.

@Lipown
Copy link

Lipown commented Jan 9, 2024

In Z2M the TS0201 is not appearing in OTA tab, how to flash it please?

@PetrP2B
Copy link

PetrP2B commented Feb 8, 2024

TS0201 TZ3000 arrived today, compared to the original TZ2000 version, it does not have a rear leg as a stand. The send temperature button also toggles between ˚C and ˚F, I modified the TZ2000 with a timer to send the temperature every minute, unfortunately it will also toggle C/F here. Otherwise, I use NIMH Ikea Ladd in them and they last more than 1/2 year without problems.

@KipK
Copy link

KipK commented Feb 8, 2024

@PetrP2B , have you tried to flash it with the custom fw mentioned above?

@PetrP2B
Copy link

PetrP2B commented Feb 9, 2024

@KipK , I guess I don't quite understand how to do it, I tried to start the search on the NTB, which I have to BT, according to the description, but it doesn't find the thermometer. Specifically, it is this model https://www.aliexpress.com/item/1005005951863680.html?spm=a2g0o.order_detail.order_detail_item.5.4977f19cqKfAJO, unlike the TZ2000, it does not have a rear foot and switches C/F with a button.

@KipK
Copy link

KipK commented Feb 9, 2024

If it's already using ZigBee you can't flash it using the web panel. It's only for Bluetooth ones. You need to flash it with an usbttl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests