Notifications for solar panel inverter problems

For your information, so others may benefit from it.

We have a satisfactory integration for our solar panel inverter.
To understand this, two things are important:

  1. The inverter automatically switches off when the light level reaches a certain threshold. The power entity then changes to ‘unavailable’.
  2. In our living room, we have a smart light sensor that we primarily use for automations to switch lights on and off.

We’ve now also created an automation that sends a notification if the status of the solar panel power entity changes to ‘unavailable’ while the light sensor indicates there is sufficient light. This tells you something is wrong. This automation has the following general structure:

trigger: sensor.solar_panels_power goes to 'unavailable'

condition: sensor.light above 200 lux

action: notification

The condition is necessary because the inverter is not available ‘by design’ when there is insufficient light.

This works if the inverter or the integration fails during the day. However, it doesn’t work if the sensor.solar_panels_power entity remains in the ‘unavailable’ state in the morning, even though there is sufficient light. This happens very occasionally because, for reasons I haven’t been able to determine yet, the inverter’s network connection gets a different IP address. We then have to adjust this in the integration to get it working again.
I had to think about how to generate a notification for that situation. A trigger is by definition an event, and in this case, nothing happens to the sensor.solar_panels_power entity; it remains in the ‘unavailable’ state. The solution is to reverse the trigger and condition. The general structure:

trigger: sensor.light above 200 lux

condition: sensor.solar_panels_power state = unavailable

action: notification

To test this automation, you can, of course, shut down the inverter ‘hard’ during the day. I prefer not to do that unless it’s strictly necessary. Here’s another reversal for a “soft” test: shine a flashlight on the light sensor in the evening. And… it works :wink: