Foto notte e giorno luce

buongiorno a tutti,
problema con un codice, ho una piantina 3d fatta con floorplan nel mio home assistant e sto cercando aiuto per fare questa azione, praticamente quando la luce es cucina e accesa e l’orario e compreso tra le 6.00 e le 18.00 deve mostrarmi la foto cucina giorno altrimenti tra le 18.00 e le 6.00 foto cucina sera. chat gpt mi ha fornito il codice seguente che non funziona, tutta la parte dove c’è entità on non la vede proprio

type: picture-elements
image: local/images/tutto/tuttospento.png
elements:

  • type: image
    entity: switch.10018a70e4
    hold_action: none
    state_image:
    ‘off’: local/images/tutto/bottone_trasparente.png
    ‘on’: |-
    {% if is_state(“switch.10018a70e4”, “on”) and
    now().hour >= 6 and now().hour < 18 %}
    local/images/tuttozoom/giorno.png
    {% else %}
    local/images/tuttozoom/notte.png
    {% endif %}
    style:
    left: 50%
    top: 50%
    width: 100%
    tap_action: none
  • type: image
    entity: switch.10018a70e4
    image: local/images/tutto/bottone_trasparente.png
    style:
    left: 51%
    top: 18%
    width: 3%
    tap_action:
    action: toggle
  • type: state-icon
    entity: switch.10018a70e4
    style:
    left: 50%
    top: 15%
    tap_action:
    action: null
  • type: state-icon
    entity: switch.10018a70e4
    style:
    left: 50%
    top: 15%
    tap_action:
    action: toggle

spero possiate aiutarmi grazie

Also, you need to paste your code as preformatted text (</> in the cogwheel menu in the toolbar) - very hard to read otherwise.

Or alternatively, use Google Translate…

“O in alternativa, utilizza Google Traduttore”

ok excuse me no speek englis i use translator

Good morning everyone,
problem with a code, I have a 3D map made with floorplan in my home Assistant and I’m looking for help to do this action, basically when the kitchen light is on and the time is between 6.00 and 18.00 it has to show me the kitchen photo day otherwise between 6.00 pm and 6.00 am evening kitchen photo. chat gpt gave me the following code which doesn’t work, the whole part where there is entity on doesn’t see it at all

I don’t understand this
you need to paste your code as preformatted text (</> in the cogwheel menu in the toolbar) - very hard to read otherwise

type: picture-elements
image: /local/fp/night.png
style: |
  ha-card:first-child {
    background: rgba(42, 46, 48, 1)
  }
elements:
  - type: image
    action: none
    entity: sun.sun
    hold_action:
      action: none
    state_image:
      above_horizon: /local/floorplan/day.png
      below_horizon: /local/floorplanp/transparent.png
    style:
      height: 100%
      left: 50%
      opacity: ${ states['sensor.sunlight_opacity'].state }
      top: 50%
      width: 100%
    tap_action:
      action: none