Create a state based on the netto produced power value of your P1 meter.

By using the production value, the state can be set and reset depending on the current power produced for the whole installation.

For example, if your home has a photovoltaic system, you can define a state "excess power" to be set when the measured production power is above 5000W. To account for short periods of cloud cover, you can set a duration and minimum threshold which the produced power needs to be below to trigger state reset.

The UDS can then be used to trigger an action, such as turning on a specific electric consumer, like E-car charger or water heater.