Problem using Sonoff DW2

I am trying to use a Sonoff door/window sensor, Sonoff DW2, with Home Assistant to register when my patio door is opened.
Using the eWeLink app on my phone shows the DW2 responding normally but in Home Assistant, after working for a short while it then fails to register any more state changes. Also, the EweLink Smart Home add-on stops registering as well.
If anyone can help with this I would be most grateful but I am very much a HA newbie.
Thanks.