This paper investigates the vibration characteristics of a sandwich nanosensor plate composed of piezoelectric materials, specifically barium and cobalt, in the upper and lower layers, and a core material consisting of either ceramic (silicon nitride) or metal (stainless steel) foams reinforced with graphene (GPRL). The study utilized the novel sinosoidal higher-order deformation theory and nonlocal strain gradient elasticity theory. The equations of motion for nanosensor sandwich graphene were derived using Hamilton's principle, considering the thermal, electroelastic, and magnetostrictive characteristics of the piezomagnetic surface plates. These equations were then solved using the Navier method. The core element of the sandwich nanosensor plate can be represented using three distinct foam variants: a uniform foam model, as well as two symmetric foam models. The investigation focused on analyzing the dimensionless fundamental natural frequencies of the sandwich nanosensor plate. This analysis considered the influence of three distinct foam types, the volumetric graphene ratio, temperature variation, nonlocal parameters, porosity ratio, electric and magnetic potential, as well as spring and shear viscoelastic support. Furthermore, an analysis was conducted on the impact of the metal and ceramic composition of the central section of the sandwich nanosensor plate on its dimensionless fundamental natural frequencies. In this context, the use of ceramic as the central material results in a mean enhancement of 33% in the fundamental natural frequencies. In contrast, the incorporation of graphene into the core material results in an average enhancement of 27%. The thermomechanical vibration behavior of the nanosensor plate reveals that the presence of graphene-supported foam and a viscoelastic support structure in the core layer leads to an increase in thermal resistance. This increase is dependent on factors such as the ratio of graphene, porosity ratio of the foam, and parameters of the viscoelastic support. Metal foam or ceramic foam has been found to enhance thermal resistance when compared to solid metal or ceramic core materials. The analysis results showed that it is important to take into account the temperature-dependent thermal properties of barium and cobalt, which are piezo-electromagnetic materials, and the core layer materials ceramics and metal, as well as the graphene used to strengthen the core. The research is anticipated to generate valuable findings regarding the advancement and utilization of nanosensors, transducers, and nano-electromechanical systems engineered for operation in high-temperature environments.