Parse data from one sensor to another

Assuming that the problem is the fancy single quotes and that this is not just a cut/paste formatting error* you need to replace them with double quotes, then it is a valid JSON string according to an on-line parser I tried:

This template sensor will do that, but you have not given anywhere near the amount of information required to complete this fully so you will have to fill in the blanks.

- platform: template
  sensors:
    a_sensor_containing_a_json_attribute:
      friendly_name: "A sensor containing a JSON attribute"
      value_template: "{{states('sensor.where_the_value_comes_from') }}"
      attribute_templates: >-
        the_jason_string: >-
          {{ states('sensor.original_sensor_object_id').replace('’','"').replace('‘','"') }}

You need to change and or add:

a_sensor_containing_a_json_attribute: # the name you want to call the new sensor, likewise with the friendly name

sensor.where_the_value_comes_from # the sensor you want to add the attribute to. You’re actually making a new sensor. You can’t add an attribute to the existing one.

the_jason_string # replace with the name you want to call the attribute.

sensor.original_sensor_object_id # the sensor that contains the JSON string you want to add.

*If the fancy single quotes are due to a cut/paste formatting error you need to learn how to format your post correctly. See point 11 here: How to help us help you - or How to ask a good question In which case the attribute template becomes:

      attribute_templates: >-
        the_jason_string: >-
          {{ states('sensor.original_sensor_object_id').replace("''","\"") }}

This replaces single quotes with double quotes in the JSON string.