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

Template error converting wind degrees to compass

$
0
0

Hello to community, I’m a newcomer of 3 weeks to HA jumping ship after 2 years with "OpenHab’ (which became exceedingly geeky & fiddly). Enjoying and coping ok with HA so far.
My System: Home Assistant Blue, Core ver core-2022.2.2, Supervisor ver 2022.01.1.

Trying to config a Template sensor to convert wind degrees (bearing) to a Compass value so that I can use it in a Lovelace entity card for weather. The code is in my config yaml.
Code verifies ok both in Developer tools and in HA but HA unable to ‘render’ (is that the term?) the Template.
Getting the error below after restart: “Invalid config for [template]: invalid template (TemplateSyntaxError: tag name expected)”

Screen shot of Template non-working code below:

I think it must be some silly syntax mistake I’m making…even though I have adopted the new coding guidelines for templates.

I made a similar Template for converting a zwave Aeotec Door sensor which is wired to a 'B+B Thermo-Technik" hardware rain sensor (it provides open/closed contacts with rain) on the roof and acts as a Rain Sensor. This template converts the ‘off/on’ states to ‘Raining/Dry’ for my lovelace card. This template sensor works perfectly. Screen shot of code:

In summary, I’d be delighted if anyone could spot the problem with my Wind Compass code and advise. Thanks in advance.

2 posts - 2 participants

Read full topic


Use group with media_players, or media_player group

$
0
0

tried this in Discord #integrations, and somewhat unresolved, so please allow me here too:

is there a preference of any kind using a media_player group over a regular group with the same media_players? Asking because up to now Ive always used a regular group with media_player entities, and that works just fine. My intercom plays/pauses/stops tts, music files etc etc o er the regular groups.

It was because I also do

      service: group.set
      data:
        object_id: broadcast_available
        name: Broadcast available
        entities: >
          {{expand('group.broadcast')|rejectattr('state','in',['unknown','unavailable'])
            |map(attribute='entity_id')|join(',')}}

to auto create a group with only available players that I had a look at the media_player group, hoping it would do something like that built in. But I dont think it does… And we can not create a media_player group like that (I think).

Unless, this is valid?:

    action:
      - service: group.set
        <<: &select_players
        data:
          object_id: broadcast_available
          name: Broadcast available
          entities: >
            {{expand('group.broadcast')|rejectattr('state','in',['unknown','unavailable'])
              |map(attribute='entity_id')|join(',')}}
      - service: media_player.join
        <<: *select_players

as far as I can see, the main difference is:

{{expand('group.broadcast')
   |rejectattr('state','in',['unknown','unavailable'])
   |map(attribute='entity_id')|list}}

{{expand(state_attr('media_player.broadcast_group','entity_id'))
   |rejectattr('state','in',['unknown','unavailable'])
   |map(attribute='entity_id')|list}}

in iterating them, but other than that, why would one choose a media_player group over a regular group?

1 post - 1 participant

Read full topic

Control Alexa Media-Volume

$
0
0

Hello,

I am totally new to HA and I really appreciate your Work and in general your documentation. I could fix some problems on my own… But now I need YOUR HELP…

I use an Alexa Echo for Music-Streaming… So I use BT-Speakers which are connected to the ECHO. So I want to control the MEDIA-Volume from Alexa via HA. Is that possible? If yes could you explain to me how I can control the Volume of Alexa within HA…

Because I want to use an Zigbee-Remote for the Volume of Alexa…

Many thanks for your Time and your effort.

1 post - 1 participant

Read full topic

How to template/config for Monday cost sensor reset

$
0
0

Hi everyone , i installed 3 x powr3 sonoff and made several sensor for energy management and i need help with resetting the weekly cost senors

The daily one is working correctly, but the weekly one did not reset on Monday :frowning:

utility_meter.yaml

  consumption_bbb_zi:
    source: sensor.consumption_bbb
    cron: "0 0 * * *" #próximo reset at mid-nights

  consumption_bbb_saptamana:
    source: sensor.consumption_bbb
    cron: "0 0 1 * *" #próximo reset on Mondays: 2022-01-24 00:00:00, 2022-01-31 00:00:00

  consumption_bbb_luna:
    source: sensor.consumption_bbb
    cron: "0 0 1 * *" #próximo reset on 1st: 2022-02-01 00:00:00, 2022-03-01 00:00:00

  consumption_bbb_an:
    source: sensor.consumption_bbb
    cron: "0 0 1 1 *" #próximo reset on 1st Jan: 2023-01-01 00:00:00, 2024-01-01 00:00:00

sensor.yaml

  sensors:
    cost_zi_bbb:
      friendly_name: "Cost Zi BBB"
      unit_of_measurement: "Lei/kWh"
      value_template: "{{ (states('sensor.consumption_bbb_zi') | float * 0.75) | round(2) }}"
      availability_template: >
        {{ states('sensor.consumption_bbb_zi') not in ['unknown', 'unavailable', 'none'] }}
    cost_saptamana_bbb:
      friendly_name: "Cost saptamana BBB"
      unit_of_measurement: "Lei/kWh"
      value_template: "{{ (states('sensor.consumption_bbb_saptamana') | float * 0.75) | round(2) }}"
      availability_template: >
        {{ states('sensor.consumption_bbb_saptamana') not in ['unknown', 'unavailable', 'none'] }}
    cost_luna_bbb:
      friendly_name: "Cost Luna BBB"
      unit_of_measurement: "Lei/kWh"
      value_template: "{{ (states('sensor.consumption_bbb_luna') | float * 0.75) | round(2) }}"
      availability_template: >
        {{ states('sensor.consumption_bbb_luna') not in ['unknown', 'unavailable', 'none'] }}

This is what is showing :

please help setting up the reset for weekly and monthly , thank you

1 post - 1 participant

Read full topic

Trouble editing and adding glance card to lovelace

$
0
0

I am having trouble with the glance card on my androind device.

If I try to add a glance card (specifically), I cannot remove the pre-suggested entities using the gui but I can if I instead edit the yaml with the ‘show code’ option.

This happens in the app, chrome, and duckduckgo so the problem is pervasive. Interestingly the issue doesnt happen on chrome on my computer. I just updated to the latest version of everything, and I ‘think’ it was working before.

Is it an android problem/bug? Any suggestions?

1 post - 1 participant

Read full topic

HTML5 Push Notifications without google

$
0
0

Hello,

I just enabled HTML5 push notifications, and it works really well.
however I would like to have a solution without google.
now I need a google vapid key, not really sure what a vapid key is.
but is this possible using another party, or maybe without registering at all?

1 post - 1 participant

Read full topic

Switch with static energy usage

$
0
0

I am on a quest to visualize my energy usage.
I already have a bunch (~20) of energy meters, and they work like a charm, but there are also a few devices that do not give any energy measurements, but the energy usage is constant when “on” or “off” (like a light dimmer or even a simple light switch).

I mostly have Tuya devices. Regarding the energy meters, they only give Volt, Amps and Wattage. Not kWh.
Therefore, I did the following:

sensor:
  - platform: integration
    source: sensor.sw_bureau_kamer_wout_power
    name: verbruik_wout_bureau
    round: 2
    method: left

This gives me a Wh sensor that is visible in the energy dashboard.

BUT (and this is the question), I also have a light switch. I know that when the light is on, the usage is 18W and when it is off, the usage is 0W.
(actually it is a dimmer, and later on I will adjust the code for usage between 0-20% brightness, 21-40%, etc… But for now I want to keep it simple.)

So I made this sensor; when the light is on, I have a usage of 18W; when it is off 0W.

  - platform: template
    sensors:
      bureau_licht_power:
        unit_of_measurement: "W"
        value_template: >-
          {% if is_state('light.licht_bureau_light', 'on') %}
            18
          {% else %}
            0
          {% endif %}

Next, I did the same as with the energy meters

  - platform: integration
    source: sensor.bureau_licht_power
    name: verbruik_bureau_licht
    round: 2
    method: left

Now for the weird stuff.
When I look in the Developer tools, I see results. 18W / 0W and even the usage in Wh. But it does not show up in the energy dashboard. Not even on Year totals. What am I doing wrong. I have the feeling that I am making a dummy mistake :slight_smile:, but I cannot see it afer more than a week of searching.

Thank you for anyone that can help me!

1 post - 1 participant

Read full topic

HA-OS updates reset HomeKit for Restful Switches

$
0
0

Hi,

I recently moved into a home that has Feller ZeptrionAIR wifi controlled light switches. I have been able to configure the switches in Home Assistant using the Restful configuration like so:

switch:
  - platform: rest
    name: "Breakfast Nook Chandelier"
    resource: http://zapp-xxxxxxxxx.local/zrap/chctrl/ch1
    state_resource: http://zapp-xxxxxxxxx.local/zrap/chscan
    body_on: "cmd=on"
    body_off: "cmd=off"
    is_on_template: "{{ value.find('<ch1><val>0') == -1 }}"
    headers:
      Content-Type: application/xml
    verify_ssl: false

This works fine in Home Assistant. And with the HomeKit integration I can see these switches in the Apple Home app. In the Home app, I assigned the switches to different rooms and added them to the “Leave Home”, “Arrive Home”, “Goodnight”, and “Good morning” scenes.

However, every time there is a Home Assistant OS update, all the switches lose their configurations in the Apple Home App and I have to assign them all over again. This is probably the result of the ‘aid’ (accessory ID) not being persistent over OS updates.

According to the documentation (HomeKit - Home Assistant), the accessory id gets generated from the entity_id. If there is no unique_id for the entity, all configurations in the Home app will be lost when the entity_id changes.

Using the developer tools in Home assistant, I can see that my switches do not have unqiue ids. I get sent to this page for more info: This entity does not have a unique ID? - Home Assistant

I tried assigning an entity_id to one of the switches in the hope of keeping the unique_id persistent over OS updates, but this entity_id is not an accepted configuration option for rest switches.

Is there anything else I can do?

1 post - 1 participant

Read full topic


Changed HA port to 80, get invalid client id or redirect uri when trying to log in via IPv6

$
0
0

Hi,

I want to access HA via IPv6 but can’t forward the port in the router. Thats why I decided to change HA port to 80. I can still log in no problem with the IPv4 address, but when I try via the v6 I get an error saying “invalid client id or redirect uri”

Both methods worked befor and I honestly got no idea what causes this error.

1 post - 1 participant

Read full topic

Optimize automation water pump

$
0
0

Hi guys,

At first, sorry for my English, it isn’t my native language. I have starting to use Home Assistant to optimize my heating setup between two houses. We have one stove to heat two water reservoirs. One in each house. I would like to avoid to push cold water to the second reservoirs.

I have two D1 mini with two DS18B20 sensors. One top and one bellow on each reservoirs. Each sensor are connected with MQTT broker. I see each temperature on the dashboard to have all information.

I’m not sure what is the best practice. I would like to avoid to push colder water to the other house as it is already present.

The current setup: Fill the reservoirs in house one completely. Start the pump to exchange the whole water. Stop the pump fill the same reservoirs again. Done

I need to compare some values to catch different cases but I’m not sure how I’m able to do it. I can only add one sensor on the web-template.

  • id: ‘1643902379100’
    alias: heating pump on
    description: ‘’
    trigger:
    • platform: numeric_state
      entity_id: sensor.house1_below
      above: ‘76’
      condition: []
      action:
    • service: switch.turn_on
      data: {}
      target:
      device_id: 1b51872fc40c2f44e07e9e20c33d5957
      mode: single
  • id: ‘1643902766863’
    alias: heating pump off
    description: ‘’
    trigger:
    • platform: numeric_state
      entity_id: sensor.house2_below
      above: ‘75’
      condition: []
      action:
    • service: switch.turn_off
      data: {}
      target:
      device_id: 1b51872fc40c2f44e07e9e20c33d5957
      mode: single

The second case doesn’t happened because have to stop the pump per hand because the temperature in house1 went to down. As I have already wrote I want push colder water to house2.

Thanks for any help

Best regards

1 post - 1 participant

Read full topic

How do I get value of the Energy consumption from the energy dashboard?

$
0
0

image

I want to use the total daily consumption in other locations and wondering how i can easily obtain this value?

1 post - 1 participant

Read full topic

Unable to sort/order entities in statistics card

$
0
0

The history card is quite customizable and gives me the opportunity to order all entities exactly the way I want but I can’t seem find a way to achieve the same with the statistics card. I have been playing around with the statistics card for quite some time now but I don’t understand how entities are sorted. Can anybody explain to me how it works and (even better) how I can manipulate the ordering?

What I found out so far:

  • It’s no alphabetic order (not by entity ID, not by friendly name)
  • It’s no ‘first added entity ends up on top’

type: statistics-graph
entities:
  - sensor.aquarea_inlet_temperature
  - sensor.aquarea_outlet_temperature
  - sensor.aquarea_outlet_target_temperature
  - sensor.aquarea_outdoor_ambient
  - sensor.tze200_yvx5lh6k_ts0601_7c6b5bfe_temperature
  - sensor.hue_outdoor_motion_sensor_1_temperature
days_to_show: 7
stat_types:
  - mean
title: Verwarming - 7 dgn

Different order in the configuration results in the same output order:

type: statistics-graph
entities:
  - sensor.aquarea_inlet_temperature
  - sensor.aquarea_outdoor_ambient
  - sensor.aquarea_outlet_temperature
  - sensor.tze200_yvx5lh6k_ts0601_7c6b5bfe_temperature
  - sensor.aquarea_outlet_target_temperature
  - sensor.hue_outdoor_motion_sensor_1_temperature
days_to_show: 7
stat_types:
  - mean
title: Verwarming - 7 dgn

1 post - 1 participant

Read full topic

Need Alarm Recomendation

$
0
0

I have a series 2 Simplisafe alarm system and will soon be replacing or upgrading it. The Simplisafe system has been pretty good but the HA integration is not the most reliable and needs to be reconfigured pretty regularly. The system is several years old and just needs to be updated.

Here are the most important things that I want in a new alarm system:

  1. Reliable integration to HA. Hopefully with a supported integration if possible.
  2. Ability for HA to see individual contact sensors and motion sensors and for those sensors report their status to HA.

I have looked at the Ring Alarm and the new Simplisafe system. I have also seen systems from ADT, Vivent, and Wyze. I’m pretty sure Wyze will never be available in HA (I had the Wyze contact sensors working in HA but I know those are no longer sold). I’m not sure what they other systems are capable of within HA, so I’m hoping ya’ll will tell me what systems you are happy with and any recommendations.

1 post - 1 participant

Read full topic

The switch does not include the entity that is inside it

$
0
0
  - platform: template
    switches:
        switch_test1:
         value_template: "{{ is_state('binary_sensor.bin_sensor_test1', 'on') }}"
         turn_on: 
          service: input_boolean.turn_on
          data:
            entity_id: input_boolean.test1
         turn_off:
          service: input_boolean.turn_off
          data:
            entity_id: input_boolean.test1

When the binary sensor is enabled, the test switch is enabled, but it does not include the entity that is inside (input_boolean.test1). Only if you manually turn on the test switch, only then does the entity itself turn on. How to make an entity (input_boolean.test1) turn on from a binary sensor (bin_sensor_test1) inside a switch (switch_test1)?

1 post - 1 participant

Read full topic

Button with MQTT Discovery

$
0
0

I would like to create a doorbell device, running on RPI. I am using Python and Paho to send MQTT messages to HA.

I have managed to configure a button using MQTT discovery and the topic

homeassistant/button/doorbell/config

and the following msg:

‘name’:‘doorbell’, ‘unique_id’:‘doorbell_button’, ‘payload_press’:‘press’, ‘command_topic’:‘homeassistant/button/doorbell/commands’

On the integration page I can see the new entity. Great.

My question is what topic & message do I need to send/publish to the MQTT server to trigger the button?

I went over a bunch of options but the button is never updated.

On the developer page I can click on the entity and click the PRESS button and that updates the ‘state’ timestamp, not sure if that means anything?

Thanks!

1 post - 1 participant

Read full topic


Template Sensor with if then for unit_of_measurement

$
0
0

I’ve tried to create a template sensor with 2 differnt units of measurement and calculating state (value) depending. Even as state works fine, unit of measurement shows me the hole template string instead of “kWh” or “Wh”:

 - sensor: 
      - name: "Batterie entladen heute"
        unit_of_measurement: >
            {% if states('sensor.today_batt_discharge') | float > 1000 %}
              "kWh"
            {% else %}
              "Wh"
            {% endif %}
        state: >                                   
            {% if states('sensor.today_batt_discharge') | float > 1000 %}
              {% set state = states('sensor.today_batt_discharge') %}{{ (state | float / 1000 | round (1) if is_number(state))}}
            {% else %}
              {% set state = states('sensor.today_batt_discharge') %}
            {% endif %} aste code here

1 post - 1 participant

Read full topic

Difficulty moving Lovelace cards between views

$
0
0

I’m seeing an issue poop-up more and more that is frustrating me quite a bit. When I try to move a card from one view to another, it will not work most of the time.

I recently setup a mobile interface, with a top card including a home button, that I want to replicate to all my views. I can duplicate the card just fine, but when I go to move it, it will do one of 2 things:

  • Nothing. Completely ignores my choice and keeps the card on the current view.

  • Moves it to the Home view instead.

  • Moves it to the intended view. Note it only seems to do this after I CRTL+F5 the page to reload.

Video of this happening

Running Windows 10 with Firefox, but seeing it in Chrome as well as the iOS app. Anyone else seeing this issue more and more lately?

1 post - 1 participant

Read full topic

Aqara Cube Battery not reporting correct power level

$
0
0

I have an Aqara Magic Cube installed on 2022.2.3 and through ZHA.

The battery power is being reported at 48%. It inititally started at 57% out of the box.

If I pull the battery and test it with a multimeter the battery is at: 3.03 V
in other words at: 100%.

Is this a known problem? Is there a fix?

1 post - 1 participant

Read full topic

Helea Smart Plug Energy Monitoring ( Tuyalocal)

$
0
0

Hi all,

I would like to integrate Helea Smart Plug with Home Assistant and populate Energy Dashboard.

Currently, I have used TuyaLocal to integrate all my Helea Plugs using below Yaml configuration and functions such as Current (mA), Power (W), Voltage (V) is getting populated, But I am unable to view these under Energy Configuration > Individual devices

/config/configuration.yaml

  - host: 192.168.0.152
    device_id: bf4e75f3cee81f217dmgit
    local_key: xxxxxxxxxxxxxx
    friendly_name: "Computer_Plug"
    protocol_version: "3.3"
    scan_interval: 15

    entities:
      - platform: switch
        friendly_name: Computer_Switch
        id: 1

      - platform: sensor
        friendly_name: Computer_current
        scaling: 1.0
        device_class: current
        unit_of_measurement: 'mA'
        id: 18

      - platform: sensor
        friendly_name: computer_consumption
        scaling: 0.1
        device_class: energy
        unit_of_measurement: 'W'
        id: 19

      - platform: sensor
        friendly_name: Computer_voltage
        scaling: 0.1
        device_class: voltage
        unit_of_measurement: 'V'
        id: 20
######################################################################-
#####################      SENSORS     ###############################
######################################################################
# Example configuration.yaml entry
sensor:
  - platform: integration
    source: sensor.common_Heater_consumption
    name: common_heater_energy_spentv1
    unit_prefix: k
    round: 2
    method: left


  - platform: integration
    source: sensor.computer_consumption
    name: computer_energy_spentv1
    unit_prefix: k
    round: 2
    method: left   
    
  - platform: integration
    source: sensor.masterbedroomheater_consumption
    name: mastern_heater_energy_spentv1
    unit_prefix: k
    round: 2
    method: left     

#####################################################################

# Example configuration.yaml entry

  - platform: time_date
    display_options:
      - 'time'
      - 'date'
      - 'date_time'
      - 'date_time_utc'
      - 'date_time_iso'
      - 'time_date'
      - 'time_utc'
      - 'beat'

#####################################################################
  - platform: integration
    source: sensor.computer_consumption
    name: energy_spent_Computer
    unit_prefix: k
    round: 2

  - platform: integration
    source: sensor.masterbedroomheater_consumption
    name: energy_spent_Master_Heater
    unit_prefix: k
    round: 2
    
  - platform: integration
    source: sensor.common_Heater_consumption
    name: energy_spent_Common_Heater
    unit_prefix: k
    round: 2    
    

But under Energy tab, these sensors are not displaying under Individual devices, Kindly help in fixing this issue

1 post - 1 participant

Read full topic

NGINX Proxy manager with google assistant

$
0
0

Hello,

I have been using NGINX proxy manager for all of my docker containers including home assistant (docker). I have wanted to connect google assistant to home assistant. I followed the tutorial on the website and have got to the point where google can see the integration and lets me sign in. Then nothing happens and no devices are added. I’ve looked through a load of posts on here to try find a solution however none have worked.

referring to:
Help post 1
help post 2
help post 3

I have no idea why this doesnt work as I seem to be able to get valid https certificate from typing in the domain name to my browser:

config:
config

My docker is configured as:
Hass → macvlan 192.168.50.200
NGINXPM → host

NGINX config:


proxy2

Ive seen other posts using NGINX but not the GUI so i cant get as fine control over the config and i cant find the location of the stored configs for nginx (new to this so might be completely off)

Google integration:

Any help will be really appreciated!

1 post - 1 participant

Read full topic

Viewing all 106106 articles
Browse latest View live


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