Entity Unavailable (SmartLife Dimmer) - my solution

This may be useful to others with related problems.

I’m in the initial phases of setting up HA for the first time. I had an issue with a Martin Jerry dimmer switch that suddenly was reported as “unavailable”. As it turned out, the problem was with a change I made to my router’s configuration. I turned off PPTP and L2TP passthrough in the “NAT Forwarding” section of my router configuration. When I re-enabled those, the dimmer became available both in HA, and became “online” in Tuya SmartLife app on my phone.
As a general rule, if I recall correctly PPTP is considered a security risk, which is why I turned it off. But apparently one of those two passthroughs is required. I did not test to determine which one yet.

Similarly, the router itself was “unavailable” until I re-enabled uPNP.