Can't get notification with variable to work right

Using Developer Tools, I tried:

service: notify.sci1
data:
message: “WAN inbytes:{{states.sensor.firewall_interface_wan_inbytes }}”


I am hoping for an email that says: WAN inbytes: (number provided by sensor)

Instead I get a lot of extraneous information in the email:

<template TemplateState(<state sensor.firewall_interface_wan_inbytes=1488178777780; state_class=total_increasing, hwif=ix3, enable=True, if=ix3, macaddr=90:ec:77:74:d2:79, mtu=1500, media=1000baseT <full-duplex,rxpause,txpause>, unit_of_measurement=B, icon=mdi:server-network, friendly_name=WAN-inbytes @ 2024-03-17T00:38:31.437393-07:00>)>

You can see that the actual sensor value (1488178777780)
does get reported. How do I get rid of all the extraneous stuff?

;

try
states.sensor.firewall_interface_wan_inbytes.state

Don’t use the state object directly as per the templating docs.

{{ states('sensor.firewall_interface_wan_inbytes') }}