Yes, that's correct, this is done via the primary energy factor.
Heating oil 1.1
Natural gas, liquefied gas 1.1
Hard coal 1.1
Lignite 1.2
Wood 0.2
Electricity 2.4
A heat pump is powered by electricity. Electricity has a high primary energy factor, but a heat pump does not convert electricity into heat energy one-to-one; instead, it does so with a factor depending on the COP/annual performance factor, which in turn depends on the type of heat pump. For example, consider an air-source heat pump that works with a factor of 3. It would theoretically produce 3 kWh of heat energy from 1 kWh of electricity. Or conversely, 1 kWh of heat energy requires 0.333 kWh of electricity. Multiplying this by the primary energy factor results in 0.333 kWh * 2.4 = 0.8 kWh of primary energy. For heating oil or gas, it would be 1 kWh of heat energy * 1.1 = 1.1 kWh of primary energy.
This way, I can manage that a house with the same insulation requires less primary energy than another house. However, the primary energy says nothing about the costs one has to bear oneself. In this case, for a heat pump, at a price of 22 cents/kWh for electricity, you would pay (0.333 kWh * 0.22) 7.3 cents per kWh of heat energy. For natural gas, at a price of 6 cents per kWh, you would pay 1 kWh * 6 cents = 6 cents. (Of course, you also have to assign an efficiency to the gas heating, which I have simplified and omitted.)
Since the Energy Saving Ordinance requires not only a value for insulation (Ht) but also for primary energy (Qp), the heat pump is thus favored. Your primary energy demand is calculated by multiplying your heat demand by the primary energy factor, which is determined by your heating system technology. The heat demand depends on your insulation (Ht) in connection with the building size and ventilation losses.