Quantcast
Channel: Configuration - Home Assistant Community
Viewing all 108675 articles
Browse latest View live

Help - Automation/Condition no longer working

$
0
0

Hi!
I used this automation a while ago, which sent me a notification when a Zigbee device was no longer reachable.
The peculiarity was that every so many hours it sent me the notification with the updated time.

For example:

Zigbee Devices Offline:
Bedroom Light - from 5 hours

After 2 hours…

Zigbee Devices Offline:
Bedroom Light - from 7 hours

Unfortunately it doesn’t work anymore. If I trigger the automation manually, only the message arrives but without the entity.

At the scheduled times, however, the message does not even arrive, the automation does not trigger (probably a problem with the condition?)

- alias: ALERT Zigbee Offline Devices
  id: zigbee_device_missing_alert
  trigger:
    - platform: time
      at: "07:00"
    - platform: time
      at: "16:00"
    - platform: time
      at: "20:00"
  condition:
    - condition: template
      value_template: > 
        {% set ns = namespace(break = false) %}
        {% for state in states -%}
          {%- if state.attributes.last_seen %}
            {%- if (as_timestamp(now()) - as_timestamp(state.attributes.last_seen) > (5 * 60 * 60) ) and ns.break == false %}
              {%- set ns.break = true %}
              true
            {%- endif -%}
          {%- endif -%}
        {%- endfor %} 
  action:
    - service: notify.notification_service
      data:
        title: Z2M DEVICE ALERT
        message: >
          Zigbee Devices Offline:
          {% macro GetDroppedZigbee() -%}
          {% for state in states.sensor -%}
          {%- if ("linkquality" in state.name and state_attr(state.entity_id, "last_seen") != None and (as_timestamp(now()) - as_timestamp(state_attr(state.entity_id, "last_seen")) > (5 * 60 * 60))) -%}
          {{ state.name | regex_replace(find=' linkquality', replace='', ignorecase=False) }} -- Da {{ ((as_timestamp(now()) - as_timestamp(state.attributes.last_seen)) / (3600)) | round(0) }} ore {{- '\n' -}}
          {%- endif -%}
          {%- endfor %}
          {%- endmacro -%}
          {{ GetDroppedZigbee() }}

What could be the problem? I just can’t solve it
Thanks

1 post - 1 participant

Read full topic


Date with German days and month

$
0
0

Hi All

i’m pretty new to HA an i try to get a German based Date Card
i use Better moment with the following code:


type: custom:better-moment-card
parentStyle: |
  line-height:3em;
moment:
  - format: cccc,
    parentStyle: |
      font-size:2em; 
      text-align:center; 
      font-weight:600; 
      grid-area: date;
  - format: dd MMMM
    parentStyle: |
      font-size:4em; 
      text-align:center; 
      font-weight:600; 
      grid-area: date;

it gives me a wonderful card but unfortunately all in english.
how do i get German Days (Montag, Dienstag, …) und deutsche Monate (JAnuar, Februar, …)

thanks for your replys
Oli

3 posts - 2 participants

Read full topic

Atom Echo - Play Timer Audio On Another Speaker

$
0
0

Hello All,

For voice assistant testing i am using an Atom Echo, i have already changed the tts output so it uses another speaker and i have muted the device.

using the ESPHome Builder in the “atom-echo.yaml” file i have the following but it never plays on the media_player.living_room_2 is never triggered

      # Turn on the repeat mode and pause for 1000 ms between playlist items/repeats
      - lambda: |-
            id(echo_media_player)
              ->make_call()
              .set_command(media_player::MediaPlayerCommand::MEDIA_PLAYER_COMMAND_REPEAT_ONE)
              .set_announcement(true)
              .perform();
            id(echo_media_player)->set_playlist_delay_ms(speaker::AudioPipelineType::ANNOUNCEMENT, 1000);
      - media_player.speaker.play_on_device_media_file:
          media_file: timer_finished_wave_file
          announcement: true  
      - homeassistant.service:
          service: media_player.play_media
          data:
            entity_id: media_player.living_room_2
            media_content_id: https://xxxxx.com/local/media/sta_blackalert.mp3
            enqueue: replace
            media_content_type: audio/mp3
            announce: "true"   
      - delay: 15min
      - switch.turn_off: timer_ringing
      -

Any help would be appreciated

1 post - 1 participant

Read full topic

Companion app using Tor and .onion with RethinkDNS

$
0
0

Hi all. I’ve seen a 5 year old thread on using the Android Companion app with a Tor .onion URL but it doesn’t seem like it works the same way anymore?

I have the Tor add-on in my HA at my house, I have used torbrowser to connect to it ok.

I have the companion app on my Android phone. I have orbot installed and RethinkDNS app installed.

RethinkDNS sets up a virtual VPN and then intercepts stuff and filters/routes/etc. One option it has is to route certain apps over the orbot HTTP proxy.

I’ve set HomeAssistant to be routed over the Orbot HTTP proxy. And I set my external URL to http://blablablabla.onion the same blablabla that I have successfully used to connect via torbrowser on my laptop.

But the companion app says
“Webpage not available… ERR_NAME_NOT_RESOLVED”

It seems it doesn’t like the .onion URL. Has anyone gotten this working?

NOTE: I just tested my TOR setup by telling Rethink to route Firefox through Tor, and then loading a blog I visit a lot, it went through cloudflare’s “test if you’re a human” and then blocked me because my IP is on some block list (ie. the exit node of the Tor). As soon as I change Firefox back everything works. so Rethink IS routing working with orbot.

1 post - 1 participant

Read full topic

How to get a list filtering another list in a template?

$
0
0

I am trying to build an automation that sends me a notification if any of the entities inside a group of temperature sensors is above a given value.

First I am trying to build the template for it but I just can find how to create a new list from my filtered values.

Given this

{% set temp_sensors =  expand('sensor.home_inside_temperature_sensors') | map(attribute='entity_id') | list %}
{% set max_temp = 1 %}
{{ temp_sensors |   list }}

{% set filtered_list = [] %}
{% for item in temp_sensors %}
  {% if (states(item) | float) > 16 %}
    "{{states(item)}}"
  
    {% set filtered_list = filtered_list + [item] %}
  {% endif %}
{% endfor %}

{{filtered_list}}

I get this output

['sensor.2_hobbyraum_keller_temperature',
'sensor.1_abstellraum_keller_temperature',
'sensor.3_technikraum_keller_temperature',
'sensor.room_temperature',
'sensor.switchbot_temp_sala']

    "19.6"

    "20.5"
 
    "19.2"
    
    "21.6"
  
    "22.0"
  

[]

As you see the filtering is working correctly but {% set filtered_list = filtered_list + [item] %} is not working.

I also tried with {% set _ = filtered_list.append(item) %} but it is rejected.

I can not wrap y head around how to do this.

I would be grateful for any tip!

Thanks!

2 posts - 2 participants

Read full topic

Impossible to see Tuya TH01

$
0
0

Hey all. I just got three Tuya temperature and humidity sensors. Wanted to add them in HA, and went down the loop of Tuya local, as otherwise I won’t see neither temperature nor humidity.

Developer platform setted, app setted, now I see my devices on the phone and on the developer platform. On the developer platform they result online, working, can see everything. On the phone I can see the changes and the devices.

However… I DON’T see them on my network in anyway, I have no way of finding the devices’ IP adressess, neither in the router nor in the app, I get a connection error. So I have no way of finding the IP addresses to use in the app.

Any suggestion? Any idea of the why?

P.S. My router is the ISP one, pretty basic, but always shows IP addresses.

1 post - 1 participant

Read full topic

Z-wave device added but doesn't exist

$
0
0

I added a new z-wave device (zcombo smoke alarm) successfully via the z-wave JS UI integration. After the interview results showing successfull I clicked “view device” and I got an error “Device / service does not exist”. So I went to the to the Z-wave JS UI add-on and opened the web UI and in here I see that a new device was created and working fine with ID 42. So I restarted the Z-wave JS UI integration and navigated to the devices for this integration and it wasn’t in the list. I checked the filter which auto filters disabled devices but this did not change anything. Then I view the entities for the z-wave integration and I found several for the device which is very odd. When I click the gear icon on any of those entities it’s an empty modal window and if i click the the 3 vertical dots and view device, i get the same error mentioned above. I view the core, supervisor z-wave JS addon and integration logs and don’t see any errors.

At this point I decided somthing was very wrong and maybe I should start over.
I went back to the integration and excluded and then re-added the device. This time I had the same symptoms with the only difference being that the add-on web ui showed the device had ID 43. I also noticed that when in the integration page, it says there are 39 devices but if I click configure, it says there are 40 devices.

Other things to mention. The controller is a silicon labs 700 series connected via USB and the network is stable for other devices. The firmware is 7.21.4 which is recommended for stability. A couple months ago I removed all of my z-wave devices and re-added many of them. What I noticed is that the old IDs are somehow still in some backend database so when I get around to adding a device, it will name it one of the old devices I had previously removed. I see this with the smoke detector: when it was ID 42 it named it ‘front door’ and when i removed it and added it at 43, it named it ‘backyard slider’. I don’t usually have any issue with this because I just rename the device. But in this case I can’t rename it because HASS says it doesn’t exist so I’m stumped.

I am pretty tech savy and am willing to use a CLI to edit the backend database but I don’t know where that is and what software is needed. Any tips would be appreciated.

2 posts - 1 participant

Read full topic

Mushroom Card Animation Help

$
0
0

What the heck am I missing? I can’t get this to work!! I have card_mod. Am I missing something else?


type: custom:mushroom-template-card
primary: Backyard Main
secondary: ""
icon: mdi:sprinkler
entity: switch.back_yard_main_zone
icon_color: blue
multiline_secondary: true
fill_container: false
card_mod:
  style:
    mushroom-shape-icon$: |
      ha-icon { 
        --icon-animation: sprinkle 2s linear infinite;
        transform-origin: 29% 88%; 
      }
      @keyframes sprinkle {
        0%, 15%, 30%, 45%, 60%, 100% { clip-path: inset(0 55% 0 0); transform: rotate(0deg); }
        1%, 16%, 31%, 46% { clip-path: inset(0 0 0 0); transform: rotate(-10deg); }
        6%, 21%, 36%, 51% { transform: rotate(2deg); }
      }

5 posts - 2 participants

Read full topic


Looking for an HA local (WiFi/Matter) switch that fits here with no Neutral?

$
0
0

(Forgive the dirty setup there, it’s about to be cleaned up and replaced with something new.) Note the below photo, I am in the USA on 110V, I would like to replace the bottom combo Switch/Outlet with a simple HA local (WiFi/Matter) smart switch that fits in the bottom 3rd there - normal size USA 110v smart switch - and does not require a neutral (as there is none available there)? Anyone have any ideas if there is anything on the market that would fit the bill?

1 post - 1 participant

Read full topic

HELP - Zigbee2MQTT - Shelly Mini1 gen4 Integration

$
0
0

Good evening,

can anyone explain my how to add unsuported devices? The shelly 1mini gen4 is recogniced but bot supported. I read about codes an how to manual add ist, my problem is i dont understand or dont know what to do with this…
foi
I tried to find a how to with pictures or a video on youtube, but i didnt find.
Could anyone help me with the procedure step by step?

Here are the informations i found:

Thx

1 post - 1 participant

Read full topic

Show the value of an mqtt message in lovelace

$
0
0

Im trying to show the value of an mqtt message in lovelace. As far as i can tell i need to create a sensor entity. I have spent the entire day trying to figure this out and i cant seem to do it.
I have added this to my config.yaml

input_number:

  slider:
    name: Set Pool Temperature
    min: 60
    max: 95
    step: 1
    

sensor:
  - platform: mqtt
    name: "Target Temperature"
    state_topic: "poolcontrol/mem1"

This is not creating any entity that i can see. I look in developer tools/states and i cant find it.
I have also tried

Any help?

2 posts - 2 participants

Read full topic

Issue with Zigbee Bulbs Resetting After Power Outages

$
0
0

Hi everyone,

I have a lot of Zigbee bulbs in my network, and I live in an area where power outages are very frequent. The problem is that the power goes out intermittently for a few seconds, which makes my bulbs think I’m trying to reset them. As a result, they go into pairing mode (after a lot of frustration) and lose many configurations, including Zigbee2MQTT groups, scenes, and automations, which I then have to manually restore.

Installing a UPS is not really an option since I would need to cover my entire electrical installation, and I haven’t found any reasonably priced UPS that could handle that. Also, modifying my electrical panel to integrate a UPS would be quite complicated.

Is there any way to prevent the bulbs from resetting after the typical “three power cuts in a row”? Or does anyone have any suggestions on how to deal with this issue?

This is becoming a major inconvenience, as I have a lot of groups and automations that depend on these configurations, and I end up having to redo everything almost every week.

Has anyone else experienced this? How did you solve it?

Thanks a lot!

1 post - 1 participant

Read full topic

Generic thermostat created from helpers UI can't use toggle as actuator

$
0
0

I have converted all but a few items from YAML config to UI based config where available. I tried to create a thermostat helper in the UI, but I find that the UI does not allow me to use a toggle/input-boolean as the actuator entity.
The same thermostat in YAML works fine using the input-boolean as the the control output.

Bug, not supported, or not yet supported?

1 post - 1 participant

Read full topic

Wall Tablet display managing

$
0
0

Should HA create his own display managing system instead of using fully kiosk, which is not always working 100% well?

2 posts - 2 participants

Read full topic

JRiver DLNA player display Card on Google Home Hub

$
0
0

I have the Following:
Home Assistant latest version running on an X86 PC
JRiver Media Center 33 on Windows 10 PC
Matrix Audio DAS-M0408 whole house audio with speakers in each room
Multiple Google Home Displays and Minis
Home Assistant sees the the JRiver DLNA player fine and I can right click on the Card and cast it to one of my google displays but I also get the rest of the Dashboard.
I would like to play the JRiver Media Player through the Matrix Audio unit and have the control screen show up on all my Google Home Displays. I tried to add a picture of the screen but it wouldn’t work.

1 post - 1 participant

Read full topic


Can't restore backup (20MB)

Money cannot increase?

$
0
0

I have a sensor for my total energy consumption, which is a continuously increasing value. From this, a sensor for the energy cost is derived, which also increases. Now, HA complains: ‘is using state class ‘total_increasing’ which is impossible considering device class (‘monetary’).’

Why is this impossible? My costs are increasing—I’m sure of it!

1 post - 1 participant

Read full topic

Tailscale and remote devices -- remote Ecowitt integration

Slider control with personalized valued?

$
0
0

I need to create an slider control with personalized values. Input_number let me choose the min and max, and step value, but I need to change between 13 personalized values, because are the values accepted by the device (it’s a light). Are (0,2,5,10,20,30,40,50,60,70,80,90,and 100%) of intensity.Is there any helper I can configure my own values for every step?

3 posts - 2 participants

Read full topic

Error: UndefinedError: 'str object' has no attribute 'pv_estimate'

$
0
0

Hi,

I want to use the sensor sensor.solcast_pv_forecast_forecast_today of the solcast integration to switch on my boiler at the most perfect time (using solar energy) :

state_class: total
01a5-a421-b8ea-86e2: 50.7099
estimate-01a5-a421-b8ea-86e2: 50.7099
estimate10-01a5-a421-b8ea-86e2: 36.0587
estimate90-01a5-a421-b8ea-86e2: 50.9801
estimate: 50.7099
estimate10: 36.0587
estimate90: 50.9801
dayname: Saturday
dataCorrect: true
detailedForecast:
  - period_start: "2025-03-29T00:00:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T00:30:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T01:00:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T01:30:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T02:00:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T02:30:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T03:00:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T03:30:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T04:00:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T04:30:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T05:00:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T05:30:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T06:00:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T06:30:00+01:00"
    pv_estimate: 0.041
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T07:00:00+01:00"
    pv_estimate: 0.181
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T07:30:00+01:00"
    pv_estimate: 0.806
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T08:00:00+01:00"
    pv_estimate: 1.7331
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T08:30:00+01:00"
    pv_estimate: 2.6946
    pv_estimate10: 2.4683
    pv_estimate90: 2.6946
  - period_start: "2025-03-29T09:00:00+01:00"
    pv_estimate: 3.5805
    pv_estimate10: 3.5672
    pv_estimate90: 3.5805
  - period_start: "2025-03-29T09:30:00+01:00"
    pv_estimate: 4.4041
    pv_estimate10: 3.846
    pv_estimate90: 4.4041
  - period_start: "2025-03-29T10:00:00+01:00"
    pv_estimate: 5.1745
    pv_estimate10: 4.9705
    pv_estimate90: 5.1745
  - period_start: "2025-03-29T10:30:00+01:00"
    pv_estimate: 5.7289
    pv_estimate10: 4.5828
    pv_estimate90: 5.7994
  - period_start: "2025-03-29T11:00:00+01:00"
    pv_estimate: 6.0873
    pv_estimate10: 4.3277
    pv_estimate90: 6.186
  - period_start: "2025-03-29T11:30:00+01:00"
    pv_estimate: 5.6245
    pv_estimate10: 3.7872
    pv_estimate90: 5.6916
  - period_start: "2025-03-29T12:00:00+01:00"
    pv_estimate: 5.4651
    pv_estimate10: 3.8016
    pv_estimate90: 5.6668
  - period_start: "2025-03-29T12:30:00+01:00"
    pv_estimate: 6.3516
    pv_estimate10: 4.4035
    pv_estimate90: 6.6996
  - period_start: "2025-03-29T13:00:00+01:00"
    pv_estimate: 6.7974
    pv_estimate10: 4.6978
    pv_estimate90: 7.1772
  - period_start: "2025-03-29T13:30:00+01:00"
    pv_estimate: 6.8296
    pv_estimate10: 4.654
    pv_estimate90: 7.0957
  - period_start: "2025-03-29T14:00:00+01:00"
    pv_estimate: 6.7452
    pv_estimate10: 4.5965
    pv_estimate90: 6.9176
  - period_start: "2025-03-29T14:30:00+01:00"
    pv_estimate: 6.4362
    pv_estimate10: 4.3989
    pv_estimate90: 6.5771
  - period_start: "2025-03-29T15:00:00+01:00"
    pv_estimate: 6.0156
    pv_estimate10: 4.1055
    pv_estimate90: 6.1572
  - period_start: "2025-03-29T15:30:00+01:00"
    pv_estimate: 5.4543
    pv_estimate10: 3.7162
    pv_estimate90: 5.6452
  - period_start: "2025-03-29T16:00:00+01:00"
    pv_estimate: 4.7551
    pv_estimate10: 3.2456
    pv_estimate90: 4.9884
  - period_start: "2025-03-29T16:30:00+01:00"
    pv_estimate: 3.933
    pv_estimate10: 2.6768
    pv_estimate90: 4.1708
  - period_start: "2025-03-29T17:00:00+01:00"
    pv_estimate: 3.06
    pv_estimate10: 2.0343
    pv_estimate90: 3.2911
  - period_start: "2025-03-29T17:30:00+01:00"
    pv_estimate: 2.1006
    pv_estimate10: 1.3617
    pv_estimate90: 2.3154
  - period_start: "2025-03-29T18:00:00+01:00"
    pv_estimate: 1.1516
    pv_estimate10: 0.7101
    pv_estimate90: 1.35
  - period_start: "2025-03-29T18:30:00+01:00"
    pv_estimate: 0.2641
    pv_estimate10: 0.1603
    pv_estimate90: 0.3724
  - period_start: "2025-03-29T19:00:00+01:00"
    pv_estimate: 0.0049
    pv_estimate10: 0.0049
    pv_estimate90: 0.0049
  - period_start: "2025-03-29T19:30:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T20:00:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T20:30:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T21:00:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T21:30:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T22:00:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T22:30:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T23:00:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T23:30:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
detailedHourly:
  - period_start: "2025-03-29T00:00:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T01:00:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T02:00:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T03:00:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T04:00:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T05:00:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T06:00:00+01:00"
    pv_estimate: 0.0205
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T07:00:00+01:00"
    pv_estimate: 0.4935
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T08:00:00+01:00"
    pv_estimate: 2.2138
    pv_estimate10: 1.2342
    pv_estimate90: 1.3473
  - period_start: "2025-03-29T09:00:00+01:00"
    pv_estimate: 3.9923
    pv_estimate10: 3.7066
    pv_estimate90: 3.9923
  - period_start: "2025-03-29T10:00:00+01:00"
    pv_estimate: 5.4517
    pv_estimate10: 4.7767
    pv_estimate90: 5.487
  - period_start: "2025-03-29T11:00:00+01:00"
    pv_estimate: 5.8559
    pv_estimate10: 4.0575
    pv_estimate90: 5.9388
  - period_start: "2025-03-29T12:00:00+01:00"
    pv_estimate: 5.9084
    pv_estimate10: 4.1025
    pv_estimate90: 6.1832
  - period_start: "2025-03-29T13:00:00+01:00"
    pv_estimate: 6.8135
    pv_estimate10: 4.6759
    pv_estimate90: 7.1364
  - period_start: "2025-03-29T14:00:00+01:00"
    pv_estimate: 6.5907
    pv_estimate10: 4.4977
    pv_estimate90: 6.7473
  - period_start: "2025-03-29T15:00:00+01:00"
    pv_estimate: 5.7349
    pv_estimate10: 3.9108
    pv_estimate90: 5.9012
  - period_start: "2025-03-29T16:00:00+01:00"
    pv_estimate: 4.344
    pv_estimate10: 2.9612
    pv_estimate90: 4.5796
  - period_start: "2025-03-29T17:00:00+01:00"
    pv_estimate: 2.5803
    pv_estimate10: 1.698
    pv_estimate90: 2.8033
  - period_start: "2025-03-29T18:00:00+01:00"
    pv_estimate: 0.7078
    pv_estimate10: 0.4352
    pv_estimate90: 0.8612
  - period_start: "2025-03-29T19:00:00+01:00"
    pv_estimate: 0.0024
    pv_estimate10: 0.0024
    pv_estimate90: 0.0024
  - period_start: "2025-03-29T20:00:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T21:00:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T22:00:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
  - period_start: "2025-03-29T23:00:00+01:00"
    pv_estimate: 0
    pv_estimate10: 0
    pv_estimate90: 0
unit_of_measurement: kWh
attribution: Data retrieved from Solcast
device_class: energy
friendly_name: Solcast PV Forecast Forecast Today

With the help of ChatGPT I wrote this automation :

alias: Bepaal boiler inschakeltijd op basis van zonneproductie
description: ""
triggers:
  - event: sunrise
    trigger: sun
conditions: []
actions:
  - variables:
      forecast: >-
        {{ state_attr('sensor.solcast_pv_forecast_forecast_today',
        'detailedHourly') | default([], true) }}
      sorted_forecast: "{{ forecast | sort(attribute='period_start') }}"
      energy_needed: 6
      accumulated_energy: 0
  - if:
      - condition: template
        value_template: "{{ sorted_forecast | length > 0 }}"
    then:
      - variables:
          best_start_time: >
            {% set energy_sum = 0 %} {% set start_time = none %} {% for entry in
            sorted_forecast %}
              {% if start_time is none %}
                {% set start_time = entry.period_start %}
              {% endif %}
              {% set energy_sum = energy_sum + entry.pv_estimate %}
              {% if energy_sum >= energy_needed %}
                {% break %}
              {% endif %}
            {% endfor %} {{ start_time | default('12:00:00', true) }}
      - target:
          entity_id: input_datetime.tijdstip_boiler_starttijd
        data:
          time: "{{ best_start_time[11:16] }}"
        action: input_datetime.set_datetime
mode: single

Unfortunately I get an error :

Can somebody help out of this ?

1 post - 1 participant

Read full topic

Viewing all 108675 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>