rospogrigio / localtuya

local handling for Tuya devices
GNU General Public License v3.0
2.87k stars 552 forks source link

Shows Unavailable when blocking Internet & DNS #1480

Open Nuuki9 opened 1 year ago

Nuuki9 commented 1 year ago

I'm struggling with getting a fully localised setup working. I've gone through discussions here and thought I understood what was needed, but no luck. I'm using a UniFi Dream Machine Pro SE.

I have a number of bulbs that are provisioned and working - I can control them using LT just fine, when they have Internet access. They sit in a dedicated VLAN (separate VLAN to Home Assistant) and I've now configured the firewall to limit outbound connections as follows:

This works initially, but if I reboot a device, it shows an Unavailable in Home Assistant. I hoped that blocking DNS would resolve this, but no luck. Once I open up Internet access again, it works (even with DNS still blocked). I have uninstalled the Smart Life app from all devices.

So, am I misunderstanding what I need to filter, or do I have the right understanding? If this should work then presumably I'm implementing the firewall rules wrong. I'd be fine with that, but wanted to check I had the right undertanding.

Nuuki9 commented 1 year ago

@xZetsubou I'll give that a try.

feene commented 10 months ago

@xZetsubou I'll give that a try.

What did you give a try? I am in the same boat. Blocking access to DNS servers in my home vlan and internet. Tuya Devices go unavailable.

Nuuki9 commented 10 months ago

That's odd - pretty sure there was a response that I replied to. No matter - I haven't yet been able to resolve it. Having gone through what I felt were fairly systematic checks, I wasn't able to spend more time on it at that point. I guess my hope is that when I next get around to looking at it, that someone else will have provided some clarity on what's needed.

Certainly if you dig into this and want to compare notes, I'm happy to do that.

lankhaar commented 2 months ago

This is an older post, but in case you still haven't got this to work I'll share an important detail here, I hope it helps.

Make sure that you don't block ALL incoming/outgoing traffick from/to the devices, only the traffick from/to ethernet. If you'd block all traffick, this would also block the requests done over your LAN (which home assistant uses to communicate to your tuya devices).

Nuuki9 commented 2 months ago

Thanks for the comment @lankhaar. Indeed I did not get this resolved, and it went into my homelab backlog. As I recall, these are the rules I applied:

So to your point, I was indeed allowing connections to HA, but no luck. Ubiquiti have added some new features for configuring rules so I may take another look in due course. Right now I only have a coupld of Tuya bulbs so I may simply reaplce those in time, but its still annoying not to have solved this.