Does anyone know how to edit PFsense Mqtt?

since im still learning and i realyl dont understand alot unless i have someone sit with me explaining from questions i have i doing trial and error

my question is i have issues with my modem where it needs to physically reboot. but unplugging power and back in… as i loose internet and my WAN connection is “-” reboots or reconnect of pfsense does nothing has to be physical pull power

and i know i have MQTT pfsenses sends some info just packets transfered…
but how do i edit the PFsense MQTT file on pfsense to send the WAN connection

and then i dont know how to write it yet

but when HA sees WAN connection from number to “-” (-) means lost connection
it waits 1-2 min say if nothing happens then have a raspberry pi or an ardunio thats attached to raspberry pi or ESP i been learning about that a little… but it be attached to the pfsense box… with a Relay so it can cycle the power on the modem like simulate unplug and plug back … wait 10 min for an IP address if i still get ="-" then cycle the modem or send me a Text Message internet connection is down modem cycled numbered x times

as with this home assistant stuff u gotta have internet and if internet goes down in middle of the night what good is it if has no internet (future use) stuff like the alexia google.

but for now how could i edit Pfense to send like Uptime WAN connection Wanc connection up time.
as it only sends like 10 packet transfers