Hide the image of lights when it is daytime in the floorplan (picture elements)

Hi everyone,

I followed some videos on YouTube to create a 3D Floorplan with SweetHome; once I finished, everything works as desired.

However, I have a question: I set the background image to be illuminated in the morning (with the various shadows of the sun) while it becomes dark in the evening so that the effect of the lights being turned on is as realistic as possible. The problem is that even when there is the daytime background image, if I turn on a light the room lights up, creating a visually ugly play of lights since there is already sunlight. I would like that when there is the daytime image, and I click on a room to turn on the light, only the “state-icon” changes state by turning on but the room remains with the same background photo.


Example

For example, in this case, since it was daytime, the room should have remained lit by the sun. The room’s PNG with the light on should not have been loaded, as it would be if it were nighttime.


This is the code for the general background image and 3 blocks of code (1 per room) that I wrote:

type: picture-elements
image: /local/floorplan2p/2piano_night.png
elements:
  - type: image
    entity: sun.sun
    state_image:
      above_horizon: /local/floorplan2p/2piano_morning.png
      below_horizon: /local/floorplan2p/button_transparent.png
    style:
      top: 50%
      left: 50%
      width: 100%
    tap_action:
      action: none
    hold_action:
      action: none
 - type: image
    entity: switch.sonoff_10001a2bb4
    state_image:
      'on': /local/floorplan2p/bathroom_on.png
      'off': /local/floorplan2p/button_transparent.png
    style:
      top: 50%
      left: 50%
      width: 100%
    hold_action: none
    tap_action: none
 - type: state-icon
    entity: switch.sonoff_10001a2bb4
    icon: mdi:lightbulb
    style:
      top: 56%
      left: 71.5%
    tap_action: none
    hold_action: none
 - type: image ## This is a transparent button, added to make sure that the area that switches the light is not only relative to the icon, but is slightly larger.
    entity: switch.sonoff_10001a2bb4
    image: /local/floorplan2p/button_transparent.png
    style:
      top: 56%
      left: 71.5%
    tap_action:
      action: toggle
    hold_action: none

Will there be a need to add any conditions, especially considering that I had to add 64 conditions for the 6 different light points in the Kitchen room?

Thanks for reading, and I appreciate any help you can provide!