Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
- platform: template
sensors:
hochrechnungeur:
friendly_name: 'Hochrechnung Monat'
icon_template: " mdi:sun-wireless-outline"
value_template: "{{ states('sensor.netzeinspeisung_monat')|float(0) * states('input_number.einspeisevergutung')|float(0) / (now().replace(month = now().month , day = 1) - now()).days *-1* (now().replace(month = now().month + 1, day = 1) - timedelta(days = 1)).day }}"
unit_of_measurement: €
{{ (now().replace(month = now().month + 1, day = 1) - timedelta(days = 1)).day }}
{% set this = now().replace(hour=0).replace(minute=0).replace(second=0).replace(microsecond=0) %}
{% set next = this.month + 1 if this.month + 1 <= 12 else 1 %}
{% set last = this.replace(year=this.year + 1, month=1, day=1) if now().month == 12 else this.replace(month=next, day=1) %}
{{ (last.date() - this.date()).days }}
{% set this = now().replace(hour=0).replace(minute=0).replace(second=0).replace(microsecond=0) %}
{% set next = this.month + 1 if this.month + 1 <= 12 else 1 %}
{% set last = this.replace(year=this.year + 1, month=1, day=1) if now().month == 12 else this.replace(month=next, day=1) %}
{{ (last.date() - this.date()).days }}
{{ (last.date() - this.date()).days - 1 }}
Was auch immer den großen Vorteil mit sich bringt, dass "hier, schau, die Lösung" nicht irgendwann als toter Link nutzlos für die Nutzer werden kannals Hardcopy
{{ (now().replace(month = iif( now().month == 12, 1, now().month + 1 ), day = 1) - timedelta(days = 1)).day }}
Was auch immer den großen Vorteil mit sich bringt, dass "hier, schau, die Lösung" nicht irgendwann als toter Link nutzlos für die Nutzer werden kann![]()
Kann man machen, aber spätestens beim c&p für Code wirds dann eventuell ein klitzekleines bisschen suboptimal