azerty9971 / xtend_tuya

eXtend Tuya's integration
GNU General Public License v3.0
30 stars 4 forks source link

Should this add-on work with local tuya integration? #5

Closed kartturikartturi closed 3 weeks ago

kartturikartturi commented 5 months ago

Hi, I have Homeassistant OS 11.4 and Home assistant Core 2024.1.3 installed. I use local tuya integration and tried to install your add-on. I have made directory and copied files to it. I restarted home assistant but I cant find your add-on Hacs -> Integrations.

Please assist.

azerty9971 commented 5 months ago

Hello, I don't know if this will work with localtuya. This add-on is meant to be used with the "regular" tuya...

Also, to add it, it's not in HACS but in the regular integrations :).

Have a nice day, Azerty

Rilkf commented 2 months ago

Hi, like the user above, I'm using local tuya integration and I tried to install your integration. In my case the integration show up but when i press it, nothing happens 2024-04-11 17_29_46-Settings – Home Assistant – Mozilla Firefox 2024-04-11 17_28_47-Settings – Home Assistant – Mozilla Firefox

Any idea?

2024-04-11 17_33_02-Settings – Home Assistant – Mozilla Firefox

azerty9971 commented 2 months ago

Hello, I've never used localtuya myself, do you have a good tutorial on how to start using it? Do you need to flash your devices for it to work? I'll try to look into it but for now the xtend_tuya integration is only compatible with the regular tuya integration.

Have a nice day, Azerty

Rilkf commented 2 months ago

Hi, I followed this tutorial: https://www.youtube.com/watch?v=vq2L9c5hDfQ

You don't need to do anything on the devices. You just need to extract the keys from each device somehow (as shown in the video above) and add the integration via HACS.

Unfortunately, I was unable to extract the local keys via the Tuya developer account. Instead, I used this method (which I am still using to extract local keys from the Smart Life App): https://www.youtube.com/watch?v=YKvGYXw-_cE&

I'm not so good with coding, but if you need assistance in any way, here I am :D

azerty9971 commented 2 months ago

Hello, I've tested with LocalTuya and it uses a completely different approach. I don't think it would work with it.

The think with LocalTuya is that you are pulling values directly from the device, but the plug is supposed to send delta consumptions (so the consumption that occured between now and the previous delta consumption message). If you do this using LocalTuya, there is no way to reliably tell for which time frame the delta consumption you are pulling in is applying to. (Because you could have multiple delta consumptions with the same value that follow each other)

If you find a way to fix this issue then it becomes possible to implement the energy consumption in LocalTuya (but I'll be a totally new project because LocalTuya and regular Tuya integrations are totally different).

Have a nice evening, Azerty