-
Notifications
You must be signed in to change notification settings - Fork 27
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
Tuya energy metering polling interval #397
Comments
Can you uninstall the binding, change the JSON 3rd Party Marketplace configuration to |
Thanks a lot J. I tried the new developer version, now it let's me enter a polling interval, but the value the sensor doesn't get updated at the desired interval (in this case it's a voltage sensor). Running some tests I've noticed that when the voltage changes substantialy, the value of the sensor automatically gets updated (for example, from 230V to 220V) but for small changes it doesn't, but If I open SmartLife App and access the sensor it gets updated instantly and shows minor changes (230.1V, 230.0V, 228V) so it seems that this polling interval does not really have any effect. I get updates in OH only when voltage changes substantially. Please let me know if there's any debug information I can look at to check if the binding works as it should. Many thanks for your work! |
Please set the binding to TRACE debugging (
of course with your device-id instead of |
Hi, I set up the TRACE log and I can see those HEART_BEAT messages, but there's an error at the end "Could not find channel..." I haven't defined all available channels in the Thing definition. BUT the value of the voltage (which is dp 20) is not updated in Openhab frontend, it still gets updated only when a signicative change in Voltage happens. I can see that the log, in the JSON Decoded raw payload, dps 20 is always the same: 2215 in this case. It doesn't get updated with DP_QUERY
Another thing that troubles me is that yesterday night I set poll_interval to 10, today it was automatically set to 0. Thanks. |
It looks like the polling is correct, a DP_QUERY is send and the response contains the values. What I do not understand what is missing here: the channel for the voltage is not updated with the value from the response? It seems it is found (because there is no "Could not find channel for dp '20'" message) and I can't imagine what might go wrong here. Or is the issue that always the same value is in the response to the DP_QUERY message even if it changed in reality? In that case it seems that no read is triggered when the status is queried. |
That's it! DP_QUERY runs fine, dp 20 is read, but the value of the sensor (voltage in my case) is always the same value, but, if I query it with SmartLife App it changes every time I open the device. It seems that the device does not update the "real voltage" when it's polled, only when a significant change in voltage exists (better explained in the first post). Do you think there's a way to trigger the device to update the values to the real ones? |
No idea. Maybe sending a command to one of the other channels would do the trick. What are they named? Do you use the smartLife or the TuyaSmart app? Edit: I have an EP2 (https://www.amazon.de/Usmart-Steckdose-Smart-WLAN-Sprachsteuerung/dp/B09ND8PRH8) which also measures voltage and current and even without polling the value is updated very often (I believe this is the last digit of the A/D-converter flipping from 0 to 1):
|
Hi J! I see... what do you mean "Sending a command to one of the other channels"? Here's the device attributes got from Tuya Developer API:
I use SmartLife. Every time I check the App voltage is updated, and when it's updated in the App it's also updated in OH, but without using the App, the updates only happen when there's a substantial change in real voltage. Maybe it's my device (DIN Wifi Switch. What do you think SmartLife App does when I access the device in order to trigger an update of the the values? do you think there's a way to trigger this update locally using your binding? Any ideas where to explore? Many thanks for your time! |
If you cut off internet access, can you still update the measured voltage in the app? If this is the case, you can see what is sent to the device in the cloud later with "Debug Device". Maybe we can copy that. If you can't update the value without Internet access, then I think it's not possible to do it locally. |
Thanks J. At the time I don't have much time to look at the issue, sorry, but I will look into it when I have more time. I've ordered some different power outlets with energy meter and I can see if they updates the state more often and compare. By now I will go on with my setup, which is not perfect but half-works. Thank you again. |
I have changed the code after a discussion with the ioBroker guys. Can you uninstall/re-install and try again? |
Awsome! it works like a charm now, sensor values updated every 10 secons (the parameter I wrote) I hope this would be useful to other users as well. Many many thanks! |
Hi! Similar issue here with another Tuya Power Meter. Every time I hit refresh from the Tuya app I can see the consumption value (19) updated both in the app and in Openhab. Tried to set polling to 10 seconds without any luck. This is the message I receive when I trigger a refresh from the app: 2024-01-30 21:33:57.077 [DEBUG] [.internal.local.handlers.TuyaDecoder] - xyz1234bogo/192.168.50.196:6668: Received MessageWrapper{commandType=STATUS, content='TcpStatusPayload{protocol=4, devId='', gwId='', uid='', t=1706650436, dps=null, data=Data{dps={20=2162.0, 18=11399.0, 19=24185.0}}}'} Is there anything I could do to help diagnose the problem / fix it? Thanks in advance! |
OpenHab version 3.2.0 running on a Debian Buster VM
SmartHomeJ version 3.2.14
Hi, I recently got a DIN format wifi circuit breaker with power metering, I used smarthomej Tuya Plugin with great results (great job with this plugin, by the way!) I can switch on / off and also I get power readings (Voltage, current, etc...) but this readings are refreshing at a very irregular interval, sometimes minutes, but sometime hours. If I open SmartLife App and select the device, the values are refreshed instantly, so there should be a way to force the device to refresh those values. I haven't tested on other devices (I have ordered 4 wifi socket plugs, also with power monitor, and I will try when they arrive).
I found this in localtuya plugin for HA, which looks like the same issue, and if you read localtuya Readme, it seems they have solved the issue because you can set a "scan interval" down to 10 seconds.
I think it would be a very interesting to have an option like this in smarthomej Tuya binding, in my case is mandatory, because I relay in those readings to be able to run a water pump.
Do you see it possible to integrate in this fabulous plugin?
Many thanks in avance,
Jaume Obrador.
The text was updated successfully, but these errors were encountered: