Error rendering template: UndefinedError: 'value_json' is undefined

I’m attempting to use this sensor

  - platform: mqtt
    name: "washer_watts"
    state_topic: "tele/SNF-Washer/SENSOR"
#    value_template: "{{value_json.energy['Power']}}"
    qos: 2
    unit_of_measurement : "W"
    icon: mdi:flash-circle
    availability_topic: "tele/SNF-Washer/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"

so that I can see how many watts are being used - to base n automation that will tell me when my washing machine has finished.
I get told that the sensor is unavailable, and in the template editor I get this error

Error rendering template: UndefinedError: ‘value_json’ is undefined

I’m probably muissing something really obvioius and or simpl but I’ve spent days pulliing my hair out over this. can’t get it to to work. Other than the above error I see none anywhere else.

Help Please.

Is the payload in JSON format? Please provide an example of the payload published to tele/SNF-Washer/SENSOR.

Also, why did you comment out the value_template?

Looks like sonoff with tasmota?

value_template: "{{value_json['ENERGY'].Power }}"

works for me.
But first you need to look why the sensor is unavailable.

the value template being commented out was an accident, it’s been fixed, but had no impact one way or the other. I don’t see anything puplished to tele/SNF_Washer/SENSOR. I do however have things being published to SNF-Washer/tele/SENSOR

{“Time”:“2019-10-29T04:15:11”,“ENERGY”:{“TotalStartTime”:“2019-10-28T12:48:04”,“Total”:0.038,“Yesterday”:0.000,“Today”:0.038,“Period”:1,“Power”:35,“ApparentPower”:54,“ReactivePower”:42,“Factor”:0.65,“Voltage”:118,“Current”:0.462}}

Should that be an underscore or a hyphen between SNF and Washer? You used an underscore here and a hyphen in the sensor’s configuration. Which character is the correct one for the MQTT topic?

i8t should be a hyphen, it’s write in the sensor, typed it wrong here