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

Value template none/null check takes several seconds

$
0
0

Hi!
I have a problem with an automation (blueprint) condition. The condition check takes several seconds. The time varies from .1 to 60 seconds. The condition check worked as intended (without delay) until a few days ago, with no changes since then.

Two passes in a row:
image
image

The condition is a simple value_template:

condition: template
value_template: >-
  {{ time_blocker_entity == none or
  states[time_blocker_entity].attributes.timestamp < now().timestamp() }}

The time_blocker_entity is not (and never was) defined in the automation config:

 time_blocker_entity: null

Any idea why this is happening? Could something be wrong with the null/none check?

Thanks
Lemming

1 post - 1 participant

Read full topic


Use input_number and input_boolean

$
0
0

Hello everyone, and sorry if I ask for something already addressed.
I have an esp32 that through esphome communicates with my Home Assistant installation.
So I need to create 4 input_number and 1 input_boolean
at the moment my configuration is as follows:

input_boolean:
   notify_on:
   name: "Salvataggio"
   icon: mdi:alarm-panel-outline
input_number:
   slider1:
     name: "Temperatura 1"
     initial: 0
     min: 0
     max: 25
     step: 0.5
  slider2:
     name: "Temperatura 2"
     initial: 0
     min: 0
     max: 25
    step: 0.5
  box1:
    name: "Ora"
    initial: 0
    min: 0
    max: 23
    step: 1
   mode: box 
  box2:
    name: "Minuti"
    initial: 0
    min: 0
    max: 59
    step: 1
   mode: box

Entities are successfully created and shared with esphome.
my problem is that I would like to give these entities clearer names, because then in the automations I have to write “input_number.box1” “input_number.box2” etc. etc. while it would be clearer to write “input_number.Ora” “input_number.Minuti” etc. etc.

2 posts - 2 participants

Read full topic

Template Sensor Help - Based between times

$
0
0

I have two Helpers set up for Time that are used to determine whether light automations should run.

(so the lights will start turning on at 17:00 and stop at 09:00)
image

  • input_datetime.lights_automation_lights_auto_on_after
  • input_datetime.lights_automation_lights_auto_on_before

I’m wanting to create a sensor that will be ‘ON/TRUE’ when within these times, but ‘OFF/FALSE’ when not.

  1. I’m not sure whether to create another Helper (toggle) and an automation to turn it on/off
    (rather than a template sensor)
  2. Next goal will be to add another Toggle Helper to determine whether to use these times OR the Sun Rise / Sun Set to run the Light Automations

1 post - 1 participant

Read full topic

Rest sensor - retry if there are connection issues

$
0
0
  - resource: "url"
    scan_interval: 59
    timeout: 300
    binary_sensor:
      - name: "Regen"
        value_template: >-
          {% if value_json %}
            {{ value_json.Regen }}
          {% else %}
            {{ None }}
          {% endif %}

A am using this rest template to get data. Sometimes the urls are not available for a short time or the json itself delivers None. In both cases the sensor goes to None and triggers my fail safe scripts.

However, I want the sensor to try again x times before setting the sensor to None. So for example it would retry two times - which means after three minutes the state would go to None if the issue persists.

1 post - 1 participant

Read full topic

How to target multiple entities based on their state

$
0
0

I vary the colour temperature of my bulbs over the course of the day from the value of a template entity that I use.

At the moment I use node red to target all bulbs that are on. I want to replicate this behaviour in HA automations.

How can I apply an action to all lights that are on?

Similarly when a light turns on I want that to trigger an automation that updates it’s colour temperature. How do I trigger when any light turns on and then use that triggering ID in the action?

1 post - 1 participant

Read full topic

How HA calculate forecast solar energy production

$
0
0

How HA (or what sensor HA use of forecast.solar) calculate forecast solar energy production? tnks.

1 post - 1 participant

Read full topic

Binary sensor template to compare two temperatures

$
0
0

Hi all,

Sorry, I know that in principle exactly the same question has been asked before (many times I guess) and I tried to use the existing answers but still my solution does not work.

I have got a thermometer (called: ‘sensor.office_temperature’) and a TRV (called: ‘climate.hahm_000a1d89a65220_1’).

Within a binary sensor template I am trying to compare the current temperature with the set temperature on the TRV. If the current temperature is lower than the set, I want to use this later on as a trigger to turn on the central heating. I am planning to do this for 5 rooms, combine those binary sensors in to a group so that whenever the group changes (from true to false, or off to on) the central heating gets turned on.

However, with the template code below it does not seem to work.

Both value are picked up and displayed currently but the value of the template never changes when I set the TRV temperature lower or higher than the current temperature.

I am sure it is a very small and stupid mistake but have not managed to figure it out.

binary_sensor:
  - platform: template
{% set current = state_attr('climate.hahm_000a1d89a65220_1', 'temperature')%}
{{ current}}
{{ states ('sensor.office_temperature')}}
      sensors:
      office_temp_too_low:
        
        friendly_name: Office Temperature too Low
        value_template: "{{ states('sensor.office_temperature') | float < states('climate.hahm_000a1d89a65220_1.temperature') | float }}"



This is the output it get:

binary_sensor:

  • platform: template

17.0
18.9
sensors:
office_temp_too_low:

  friendly_name: Office Temperature too Low
   value_template: "False"

Thanks for your help.
Merc

2 posts - 2 participants

Read full topic

Change Switch Entity Toggle to Button like in Media Player

$
0
0

Is there a way to achive having a switch shown like a media player entity. I would like to have a Swith On/Off button instead of the toggle switch.

Screen Shot 2022-03-20 at 14.33.34

this is jusnt an Entities Card

type: entities
entities:
  - entity: switch.ac
  - entity: media_player.denon_avr
state_color: true

1 post - 1 participant

Read full topic


Set helper to value of sensor

$
0
0

How can I set a helper to the value of a sensor (e.g. binary or number)?

service: input_number.set_value
data:
  value: {{ states('sensor.test')|int }}
target:
  entity_id: input_number.fehler_test

This does not work, also I am not sure about boolean helpers.

1 post - 1 participant

Read full topic

Tidying up the database

$
0
0

I’ve set up an input_number sensor to count up my electricity usage in kWh. It works fine but when i set it up some spurious data got logged that is way outside the proper range, so now my graph in Grafana is scaled wrongly.
So, I loaded phpMyAdmin, found the table that contained them, isolated the miscreant rows and deleted them from the table (there were 13 of them, around the zero point when the real reading should have been 16500 ish to match my electricity meter).
But the points are still there in the grafana graph!
I’ve rebooted HA as well as deleting the graph and recreating it, but they are still there. But, they are not in the database (InfluxDB).
Any ideas?

1 post - 1 participant

Read full topic

Switch status

$
0
0

Helllo all,

Is there the possibility on a dashboard to view the status of a switch without being able to modify it in any way? I would need for a switch that only needs to be activated via automation.
Thank you.

1 post - 1 participant

Read full topic

Input_select value in new play_media feature?

$
0
0

Is it possible to use the value of an input_select for the target entity_id (media player)?

I tried simply removing the speaker entity id with the input_select entity id that contains the speaker entity id, but that doesn’t seem to work.

1 post - 1 participant

Read full topic

Input_datetime format

$
0
0

I use a couple of input_datetime helpers in my setup, but when I display the value on a lovelace page, it is displayed as m-d-y, but here in Belgium we use d-m-y. My question is how can I modify the format of date values centrally (and also time values)? I can set metric or imperial, also the currency and time zone, but nothing helps to change the date format.

1 post - 1 participant

Read full topic

Wallpanel set lovelace url

$
0
0

Hi,

I use a tablet with wallpanel app on the wall of the living room. I can control it with mqtt command (ie wake).
On its GitHub page, I read that the url can be controlled by mqtt, but the command table doesn’t include this command.

How can I swith UI page of wallpanel via mqtt?

1 post - 1 participant

Read full topic

Rest command - Blinds

$
0
0

Hi everyone !

I’m fairly new to HA and I created a DIY linear actuator controller based on ESP32. I wrote a basic code to be able to receive the position with HTTP Get, and and interprate it to convert it in second forward or backward.
To send the position of the HA blind to the ESP, I found this :

rest_command:
  blinds_set_state:
    url: "http://x.x.x.x/api/moteur?pos={{ urlInput }}"
    method: GET

cover:
  - platform: template
    covers: 
      blinds:
        friendly_name: "Living Room Blinds"
        position_template: "{{ states('sensor.living_room_blind_status') }}"
        open_cover:
          service: rest_command.blinds_set_state
          data:
            urlInput: '100'
        close_cover:
          service: rest_command.blinds_set_state
          data:
            urlInput: '0'
        set_cover_position:
          service: rest_command.blinds_state
          data_template:
            urlInput: "{{position}}"

And I PERFECTLY get the slider information on my ESP32 ! But I still have a problem :
I can’t click on the down arrow on lovelace (greyed) and in HomeKit, if I click on the blind to open it, it stay on “opening”. I guess I need some kind of return postion information to tell HA the blind is fully open ?

Thank you for your help !

A. from France (Sorry for my English)

1 post - 1 participant

Read full topic


Alexa ipv6

$
0
0

Hello, I’m coming to you because I’ve been having a connection problem since at home I switched to ipv6. I had integrated Alexa into home assistant and it no longer works. I’ve been struggling for several weeks so if a charitable soul has a solution I’m a buyer. Thanks

1 post - 1 participant

Read full topic

Automation use trigger entity_id as part of the action

$
0
0

Hi,

I’ve been struggling with an actionable notification to turn off a specific light.

I have three bathroom lights using Shelly switches, and have the following script:

alias: Bathroom Lights Left On
description: >-
  Notify and offer to turn off any of the bathroom lights left on longer than
  20min
trigger:
  - platform: state
    entity_id: >-
      switch.shelly_shsw_pm_d8bfc019b60d, switch.shelly_shsw_pm_8caab574c685,
      switch.shelly_shsw_pm_98cdac1e2737
    from: 'off'
    to: 'on'
    for:
      hours: 0
      minutes: 0
      seconds: 2
condition: []
action:
  - data_template:
      message: '{{ trigger.to_state.name }} has been left on'
      title: Bathroom light left on!
      data:
        actions:
          - action: turn_off_bathroom_light
            title: Turn off {{ trigger.to_state.name }}
    service: notify.mobile_app_nick
  - wait_for_trigger:
      - platform: event
        event_type: ios.notification_action_fired
        event_data:
          actionName: turn_off_bathroom_light
    continue_on_timeout: false
  - service: switch.turn_off
    data: {}
    target: 
      - entity_id: '{{ trigger.to_state.name }}'
mode: single

I get the correct friendly_name in my notification, but I’m then wondering how to turn off the light that triggered the automation?

Currently I’m getting a ‘Message malformed: expected a dictionary for dictionary value @ data[‘action’][2][‘target’]’ error but not sure how to address it.

Can anyone advise?

1 post - 1 participant

Read full topic

Representing the status of a switch using light with one automation

$
0
0

My goal is to represent the state of my ikea tradfri outlet using my led panel, but use only one automation. With 2 automation I can easily do this, but I want less clutter in the automations UI.
My current setup looks like this:

alias: StatusBadAP
description: ''
trigger:
  - platform: device
    type: changed_states
    device_id: dd078cc22f66841edbbf3a272fb07afc
    entity_id: switch.ikea_of_sweden_tradfri_control_outlet_0586bbfe_on_off
    domain: switch
condition:
  - condition: state
    entity_id: binary_sensor.pc
    state: 'on'
action:
  - wait_for_trigger:
      - platform: device
        type: turned_on
        device_id: dd078cc22f66841edbbf3a272fb07afc
        entity_id: switch.ikea_of_sweden_tradfri_control_outlet_0586bbfe_on_off
        domain: switch
  - type: turn_on
    device_id: 37ea63788980e0982773985e02cd909b
    entity_id: light.wled
    domain: light
  - wait_for_trigger:
      - platform: device
        type: turned_off
        device_id: dd078cc22f66841edbbf3a272fb07afc
        entity_id: switch.ikea_of_sweden_tradfri_control_outlet_0586bbfe_on_off
        domain: switch
  - type: turn_off
    device_id: 37ea63788980e0982773985e02cd909b
    entity_id: light.wled
    domain: light
mode: single

This works kinda, but only every second time I turn the outlet on, the light turns on as well. Can you point my to my mistake?

1 post - 1 participant

Read full topic

Sum of sensor values on hourly basis (for solar NBC charges)

$
0
0

I currently track the amount of energy I import from the grid into my home on an hourly basis. This is because in California, we have to pay a Non-Bypassalbe Charge for all power we import when using solar. All calculations are done on hourly basis, netting out any power I put back into the grid. I am using the following to track that import:

utility_meter:
  house_energy_net_import_hourly:
    name: house Energy Net Import Hourly
    source: sensor.house_energy_net_import
    cycle: hourly

which gives me a nice saw-tooth pattern of data over the day. But what I really need is a summation of the values at the end of each hour (top of each saw-tooth). So 24 data points added together for each day giving me to total power I actually imported that day. What is the best way to do that? Some way to add the values at xx:59:59 (one second before each hour) for each day?

Thanks for any help.

1 post - 1 participant

Read full topic

How to change the more info from graph to list

$
0
0

Hi guys.
I have a sensor for my climate “sensor.target_temperature” and when i click on it for the more-info the history graph pops up but when on my mobile i would prefer the info displayed as a list.
Has anyone any idea how i can force it to display a list?
I’ve been trying the browser_mod.more_info and browser_mod.popup services but they just display the same.
Thanks for any help

1 post - 1 participant

Read full topic

Viewing all 108392 articles
Browse latest View live


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