ndg63276 / smartathome

GNU General Public License v3.0
50 stars 15 forks source link

only last one #1

Closed SaferIT closed 4 years ago

SaferIT commented 4 years ago

Hi, thanks for your work! Congratulations I don't know if it just happens only to me. I have tried with Chrome (without extensions) and with Firefox. Same result. I have 6 switches and when I click on them: always and only the status of the last one in the list changes. Thank you

ndg63276 commented 4 years ago

Which type of switch are you using? Sonoff or smartlife? Though the bug is probably in both!

ndg63276 commented 4 years ago

Ok, I found a problem with my smartlife code, it was asking for a full status update every time you turned on or off a switch, and the Tuya site was getting upset with this frequency. It will now only update every 30s. Hopefully that will solve your problem.

SaferIT commented 4 years ago

thanks for the quick reply and sorry for my delay. the problem persists my switches are sonoff here's what happens: https://streamable.com/ebzi5u

ndg63276 commented 4 years ago

Ah, thanks, that's useful. Can I just check, is the last item actually turning on and off, in reality? And not the others?

ndg63276 commented 4 years ago

Ok, I think I found the bug. I was trying to push the device_id into the html, but actually just sending a variable called device_id, which defaulted to the last switch it found. So it would always toggle the last one. Let me know if that fixes the problem.

SaferIT commented 4 years ago

now it works perfectly! thanks!thanks!thanks!