How to get IP from a sensor and use it inside my config

Hey guys,
For some reason, the DuckDNS add-on on a remote hassio keeps turning off so, I’m trying to set up a backup system for my ‘remote_homeassistant’ component.
I set up an automation on the remote home assistant to email me its ip every x hours, and i have created an SMTP sensor to read the ip.
So now i have a sensor.remote_ip which is (almost) always up to date.
I have been trying to enter its state {{states.sensor.remote_ip.state}} into my configuration but im getting errors:

  - host: {{states.sensor.remote_ip.state}}
    port: !secret ha_remote_port
    secure: true
    access_token: !secret ha_remote_access_token
    entity_prefix: !secret ha_remote_entity_prefix

This wont let me go past configuration check .
If i use quotes or double-quotes, i get the whole thing in the address:

Could not connect to wss://{{states.sensor.remote_ip.state}}:8124/api/websocket, retry in 10 seconds...

Is there a way to do this?
Also any ideas as to why duckDNS might be stopping?
( I have tried re-installing it as suggested in the forums but ill have to wait and see)