Define sensors from Json

I have a script that outputs a json content:

{
    "timestamp": 1626357199,
    "data": {
        "classic": {
            "name": "Classic Unit Type",
            "value": 150,
            "unit": ""
        },
        "rev": {
            "name": "Classic PCB Revision",
            "value": 4,
            "unit": ""
        },
        "firmdate": {
            "name": "Firmware Date",
            "value": "2015-11-23",
            "unit": ""
        },
        "firmver": {
            "name": "Firmware Version",
            "value": 2079,
            "unit": ""
        },
        "commver": {
            "name": "Revision of the communications code stack",
            "value": 2073,
            "unit": ""
        },
        "uptimeh": {
            "name": "Uptime hours",
            "value": 14,
            "unit": "hours"
        },
        "uptime": {
            "name": "Uptime days",
            "value": 0.58,
            "unit": "days"
        },
        "plifetime": {
            "name": "Lifetime kWh",
            "value": 10086.9,
            "unit": "kWh"
        },
        "ptoday": {
            "name": "kWh Today",
            "value": "4.4",
            "unit": "kWh"
        },
        "ftoday": {
            "name": "Float Time Today",
            "value": "5907",
            "unit": "seconds"
        },
        "cstate": {
            "name": "Charge Stage Raw",
            "value": 5,
            "unit": ""
        },
        "cstageword": {
            "name": "Charge Stage",
            "value": "Float",
            "unit": ""
        },
        "cstagelin": {
            "name": "Charge Stage Lin",
            "value": 5,
            "unit": ""
        },
        "state": {
            "name": "State Raw",
            "value": 3,
            "unit": ""
        },
        "stateword": {
            "name": "State",
            "value": "Active",
            "unit": ""
        },
        "restingreason": {
            "name": "Reason for resting",
            "value": "5",
            "unit": ""
        },
        "restingreasonword": {
            "name": "Reason for resting",
            "value": "Too low of power out and Vbatt below set point for > 90 seconds",
            "unit": ""
        },
        "restingreasonwordshort": {
            "name": "Reason for resting",
            "value": "Low Light",
            "unit": ""
        },
        "infoflags": {
            "name": "Info Flags",
            "value": 2986356740,
            "unit": ""
        },
        "tbat": {
            "name": "Battery Temp",
            "value": 25.2,
            "unit": "\u00b0C"
        },
        "tcc": {
            "name": "FET Temp",
            "value": "47.6",
            "unit": "\u00b0C"
        },
        "tcc2": {
            "name": "PCB Temp",
            "value": "49.2",
            "unit": "\u00b0C"
        },
        "pout": {
            "name": "Output Power",
            "value": "400",
            "unit": "W"
        },
        "vout": {
            "name": "Output Voltage",
            "value": "27.2",
            "unit": "V"
        },
        "iout": {
            "name": "Output Current",
            "value": "14.6",
            "unit": "A"
        },
        "vpv": {
            "name": "PV Voltage",
            "value": "101.1",
            "unit": "V"
        },
        "ipv": {
            "name": "PV Current",
            "value": "4.1",
            "unit": "A"
        },
        "whizbtemp": {
            "name": "WhizBangJr Shunt Temperature",
            "value": 28,
            "unit": "\u00b0C"
        },
        "ibat": {
            "name": "WhizBangJr Current",
            "value": "0.0",
            "unit": "A"
        },
        "soc": {
            "name": "State of Charge",
            "value": "99",
            "unit": "%"
        },
        "battahrem": {
            "name": "Remaining battery capacity",
            "value": "199",
            "unit": "Ah"
        },
        "battah": {
            "name": "Battery capacity",
            "value": "200",
            "unit": "Ah"
        },
        "iabsbat": {
            "name": "Battery Current Abs",
            "value": "0.0",
            "unit": "A"
        },
        "ichgbat": {
            "name": "Battery Current Charge",
            "value": "0.0",
            "unit": "A"
        },
        "idisbat": {
            "name": "Battery Current Discharge",
            "value": "0.0",
            "unit": "A"
        },
        "batstate": {
            "name": "Battery Current State",
            "value": "Discharging",
            "unit": ""
        },
        "iload": {
            "name": "Load Current",
            "value": "14.6",
            "unit": "A"
        },
        "pload": {
            "name": "Load Power",
            "value": "397.1",
            "unit": "W"
        },
        "eff": {
            "name": "Efficiency",
            "value": "104",
            "unit": "%"
        }
    }
}

From it I need to define the sensors with proper units and friendly names, is it possible ?

I must be misunderstanding the question, Cannot this be done with automation rules?

What is your final goal in this situation? Measurement? Notification of outage?

I just need all the sensors to be created in HA as per the json returned by my command line script. For now, I need to make many command line sensors (see below), but I don’t want the command to be called that much.

sensor:
  - platform: command_line
    name: midnite_soc
    command: "/usr/local/bin/midnite-classic-data --data-file=/var/lib/midnite-modbusd/stats/data.txt"
    value_template: "{{ value_json.data.soc.value }}"
    scan_interval: 3
    unit_of_measurement: "%"

  - platform: command_line  
    name: midnite_vout
    command: "/usr/local/bin/midnite-classic-data --data-file=/var/lib/midnite-modbusd/stats/data.txt"
    value_template: "{{ value_json.data.vout.value }}"
    scan_interval: 3
    unit_of_measurement: "V"