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

How to trigger an automation based on this log event

$
0
0

I want to create an automation based on successful logins the Supervisor log.

2024-04-30 07:20:00.467 INFO (MainThread) [supervisor.auth] Successful login for 'myuser'

I have deduced that the trigger should be event with event type system_log_event but not sure how to write the condition logic to target successful logins with my user.

Example code I found for automations based on log events:


alias: example 555
trigger:
- platform: event
  event_type: system_log_event
condition: '{{ "zwave_js_server.exceptions.Failed" in trigger.event.data.exception }}'
action:
- service: notify.notifier_telegram
  data:
    message: 'Zwave Error 2'

1 post - 1 participant

Read full topic


Xiaomi Miio Integration - Re-authentication was successful

$
0
0

Hello Everyone,

Today I was testing the native Miio integration, and I was able to get it to work both with manual configuration and cloud synchronization. However, because initially I could not get it to work due to the separate VLANs, I had to create a NAT. So, after the creation of the NAT rule on my firewall, I was able to successfully add the devices and control them locally.

However, I noticed that the device that I initially added and removed because it was not working (missing NAT rule), could not be added anymore, it was just giving the message: Re-authentication was successful. I tried several things to the point that I decided to remove all the devices in the Miio integration and reboot home assistant. Now, for all the devices that I previously added, I cannot add them anymore, I am simply getting the message: Re-authentication was successful.

I checked /root/homeassistant/.storage/core.config_entries already and cannot see the previously added devices here.

Any hint how I can get those devices added again?

1 post - 1 participant

Read full topic

Best way to handle no results or errors in an api call in an automation

$
0
0

Hello, I have an automation and although everything works well, I would like it to be “cleaner” and if the calls to the api do not give any result, I would like to handle it in the best possible way. At the moment when the call to the api does not give any result, the automation does not continue and the input_text and the sensor are not updated or show any error, both keep the last value. and it’s ok for me but I don’t think it is the right way to do it.

The automation is this

alias: Caratula Juego Xbox
description: Muestra la caratula del juego de xbox que se esté jugando en este momento.
trigger:
  - platform: state
    entity_id:
      - sensor.d13g0_m0nt3s_status
condition:
  - condition: state
    entity_id: binary_sensor.d13g0_m0nt3s_in_game
    state: "on"
action:
  - service: rest_command.trigger_idjuego_service
    data: {}
    response_variable: idjuego
  - service: input_text.set_value
    target:
      entity_id: input_text.idjuego
    data:
      value: "{{idjuego['content']['games'][0].game_id}}"
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - service: rest_command.trigger_caratula_service
    data: {}
    response_variable: caratula
  - service: input_text.set_value
    target:
      entity_id: input_text.caratula
    data:
      value: "{{caratula['content']['cover_groups'][0].covers[0].image}}"

And the api returns when no results found :

{"games":[]}

and when an error occur:

{
  "code": 401,
  "error": "Authorization required",
  "message": "You must have an API key to use this resource."
}

with a different code according the kind the error.

How should I handle not receiving results or a possible error?

Thanks in advance

1 post - 1 participant

Read full topic

Correct way to deal with multiple switches (sender) for one device (light/socket)?

$
0
0

Could someone please tell me the correct, tidy way to deal with multiple switches for one device?
I’ve got a few examples of this with RFXCom 433 devices but could see the same with Zigbee devices I might buy:

Two wall switches and a switchable socket with a lamp.
Two battery powered remotes and a switchable socket with a 3D printer.

I’d like to be able to control just the single device from HA but also have it recognise the devices status if it hears a control from either physical switch/remote.

Many thanks,
Gareth

1 post - 1 participant

Read full topic

Kiosk Mode on Home Assistant: how do I implement the kiosk mode config?

$
0
0

I am a new kid on the Home Assistant block with no coding experience.

I have Kiosk Mode installed on Home Assistant.

I have a particular user I’ve setup for a tablet in the living room (user: “firehd8pluslivingroom”).

I have a Dashboard (title: “Home”) with 3 pages (titles: “Page1”, “Page2”, “Page3”)

I want to implement Kiosk Mode for user “firehd8pluslivingroom”, only for page “Page1” on Dashboard “Home”.

From the Kiosk Mode GitHub page, I know I need to place the following config code somewhere:

kiosk_mode:
  user_settings:
    - users:
        - firehd8pluslivingroom
      kiosk: true

(please correct me if I’m wrong)

In the below screenshot, where do I have to click to implement the code?

And if possible, ELI5.

Thank you in advance.

2 posts - 2 participants

Read full topic

ALARMO false triggering with SWITCHBOT contact sensor

$
0
0

I am using the Alarmo integration in HA. I have a Switchbot contact sensor linked to a Switchbot hub 2 (both hub and contact sensor (100% battery) are brand new) . I added the contact sensor as a secondary Matter device on the hub which enables me to add the contact sensor straight to HA using Matter. I only have the single Switchbot contact sensor added as a sensor in Alarmo. The sensor works just fine when opening and closing the door and triggers the alarm as usual.

But sometimes it just randomly triggers the Alarm. It randomly changes the status to open for a few seconds (about ones every 2days ). I have sensor at a reasonable distance to the magnet and pushing and adjusting or wind does not trigger it. Weather is also not a factor (for expansion or contraction of door or frame) here because the hallway outside my door is airconditioned and closed all the time. I also tried removing and adjusting the sensor.

The Logs on HA show me that the Alarm was triggered due to that exact sensor. I can 100% confirm that the door was not actually being opened when it triggers the alarm (Very annoying as sometimes it happens in the middle of the night). The very strange thing about this is that on the Switchbot app itself, there is no sign of the contact sensor changing to open status. The Open state only appears on the app when i actually open the door and not when HA’s false trigger happens. My guess is that maybe there is a problem in the matter connection between the Switchbot hub and HA and that is why HA is acting weird and giving random triggers.

Any insight on this would be greatly appreciated. Thank You

1 post - 1 participant

Read full topic

Python script with venv and numpy library run fine in code server, but not in nodered pythonshell or exec node

$
0
0

I am having a simple script to grab a frame remotely from a rtsp stream. It need opencv-python (cv2) and numpy library. If I run the command on the code-server terminal, it works fine as shown below

But when I used pythonshell node or exec node in node-red to trigger the script, it show the error that the _umath of numpy library is not found

I also tried pythonscript, and the result are the same.

What could be the issue here?

1 post - 1 participant

Read full topic

MQTT Cover template for state_open?


What to do when a Zigbee device isn't understood by ZHA?

$
0
0

I just bought some Tuya Zigbee devices from Aliexpress because I assumed Zigbee would just work. I paired them to Home Assistant, but they don’t show what I would expect.

The first was this button that I was hoping to setup to trigger different scenes. I purchased two of them and they actually show up in Home Assistant differently.


Clicking “Manage Zigbee Device”, the signature looks like this:

{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)",
  "endpoints": {
    "1": {
      "profile_id": "0x0104",
      "device_type": "0x0000",
      "input_clusters": [
        "0x0000",
        "0x0001",
        "0x0006",
        "0xe000"
      ],
      "output_clusters": [
        "0x000a",
        "0x0019"
      ]
    },
    "2": {
      "profile_id": "0x0104",
      "device_type": "0x0000",
      "input_clusters": [
        "0x0001",
        "0x0006"
      ],
      "output_clusters": []
    },
    "3": {
      "profile_id": "0x0104",
      "device_type": "0x0000",
      "input_clusters": [
        "0x0001",
        "0x0006"
      ],
      "output_clusters": []
    },
    "4": {
      "profile_id": "0x0104",
      "device_type": "0x0000",
      "input_clusters": [
        "0x0001",
        "0x0006"
      ],
      "output_clusters": []
    }
  },
  "manufacturer": "unk_manufacturer",
  "model": "unk_model",
  "class": "zigpy.device.Device"
}


Clicking “Manage Zigbee Device”, the signature looks like this:

{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)",
  "endpoints": {
    "1": {
      "profile_id": "0x0104",
      "device_type": "0x0006",
      "input_clusters": [
        "0x0000",
        "0x0001"
      ],
      "output_clusters": [
        "0x0006",
        "0x000a",
        "0x0019"
      ]
    },
    "2": {
      "profile_id": "0x0104",
      "device_type": "0x0006",
      "input_clusters": [],
      "output_clusters": [
        "0x0006",
        "0xe000"
      ]
    },
    "3": {
      "profile_id": "0x0104",
      "device_type": "0x0006",
      "input_clusters": [],
      "output_clusters": [
        "0x0006",
        "0xe000"
      ]
    },
    "4": {
      "profile_id": "0x0104",
      "device_type": "0x0006",
      "input_clusters": [],
      "output_clusters": [
        "0x0006",
        "0xe000"
      ]
    }
  },
  "manufacturer": "_TZ3000_ee8nrt2l",
  "model": "TS0044",
  "class": "zhaquirks.tuya.ts0044.TuyaSmartRemote0044TOPlusB"
}

I also bought the “4 Gang ZigBee Remote” version of this remote and it doesn’t show any of the buttons either…

{
  "node_descriptor": "NodeDescriptor(logical_type=<LogicalType.EndDevice: 2>, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=<FrequencyBand.Freq2400MHz: 8>, mac_capability_flags=<MACCapabilityFlags.AllocateAddress: 128>, manufacturer_code=4417, maximum_buffer_size=66, maximum_incoming_transfer_size=66, server_mask=10752, maximum_outgoing_transfer_size=66, descriptor_capability_field=<DescriptorCapability.NONE: 0>, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)",
  "endpoints": {
    "1": {
      "profile_id": "0x0104",
      "device_type": "0x0000",
      "input_clusters": [
        "0x0000",
        "0x0001",
        "0xe000"
      ],
      "output_clusters": [
        "0x0006",
        "0x000a",
        "0x0019"
      ]
    }
  },
  "manufacturer": "_TZ3000_mrpevh8p",
  "model": "TS0041",
  "class": "zhaquirks.tuya.ts0041.TuyaSmartRemote0041TOPlusA"
}

Sorry, that was a bit of an information dump. But, I am not sure if there is anything I can do from here. I use ZHA with a skyconnect if that makes any difference. Can I manually configure Zigbee devices in Home Assistant?

1 post - 1 participant

Read full topic

How to extract attr_name from trigger.event.data.device_id?

$
0
0

Hi, I am trying to extract the ‘name’ of a device id in a notification but can’t find a way to do it.

Below is the yaml code for a basic automation where if there is a ‘trigger.event.data.command_class == 113’ happening, I would like to receive a Pushover notification with the name of the device_id on wich there was a 113 event. Unfortunatlty, I can’t seem to find any way to get the ‘name_attr’ to be sent

Anybody can help with this ?

Here is my latest try where I have the following error message ‘Error: Error rendering data template: TypeError: attribute name must be string, not ‘LoggingUndefined’’

alias: Serrures Notification Pushover
description: ""
trigger:
  - platform: event
    event_type: zwave_js_notification
    event_data: {}
condition:
  - condition: template
    value_template: "{{trigger.event.data.command_class == 113}}"
action:
  - delay:
      hours: 0
      minutes: 0
      seconds: 2
      milliseconds: 0
  - service: notify.pushover_serrures
    data:
      message: |-
        {% set Lock_State_Array = {
           "Lock state: Lock jammed": 'Moteur bloqué',
           "Keypad lock operation": 'Barrée par le claiver',
           "Keypad unlock operation": states('input_text.serrure_cabanon_last_user_name') ,
           "Manual lock operation": 'Barrée manuellement' ,
           "Manual unlock operation": ' Débarrée manuellement',
           "RF lock operation": 'Barrée par RF',
           "RF unlock operation": 'Débarrée par RF',
           "Auto lock locked operation": 'Barrée automatiquement',
           "Battery level status: Charge battery soon": 'Changer les piles bientôt',
           "Battery level status: Charge battery now": 'Changer les piles immédiatement'
        } %}   
        {{ Lock_State_Array[ trigger.event.data.event_label ]}}
      title: "{{ device_attr(trigger.event.data.device_id,attr_name) }}"
      target:
        - iphonebruno
      data:
        sound: spacealarm
mode: single

3 posts - 3 participants

Read full topic

Accounts cannot be linked. Your Alexa App needs an update

$
0
0

657 / 5.000

Resultados de traducción

Resultado de traducción

Accounts cannot be linked. Your Alexa App needs an update Hello everyone, I’m trying to install the Alexa Skill and I get the following message “Accounts cannot be linked. Your Alexa App needs an update.” I am using Nabu Casa’s Home Assistant Cloud connection. I have the Alexa App installed on an iPhone XR with version 17.4.1 I have uninstalled the Alexa App a few times but I always get the same error message when I log in to the Home Assistant Skill. What am I doing wrong? Is there any other configuration within Hoem Assistant that I am overlooking? Any solution? Thank you so much

1 post - 1 participant

Read full topic

Basic integreation

$
0
0

What did I forget?

Integration error: hanotifier - Integration ‘hanotifier’ not found

manifest.json

{
    "domain": "hanotifier",
    "name": "hanotifier",
    "codeowners": [],
    "dependencies": [],
    "documentation": "",
    "iot_class": "local_polling",
    "requirements": [],
    "version": "0.1.0"
  }

configuration.yaml

# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes
hanotifier:

script

from __future__ import annotations

from homeassistant.core import HomeAssistant
from homeassistant.helpers.typing import ConfigType

# The domain of your component. Should be equal to the name of your component.
DOMAIN = "hanotifier"


def setup(hass: HomeAssistant, config: ConfigType) -> bool:
    """Set up a skeleton component."""
    # States are in the format DOMAIN.OBJECT_ID.
    hass.states.set('hanotifier.hanotifier', 'Works!')

    # Return boolean to indicate that initialization was successfully.
    return True

Screenshot from 2024-04-30 21-49-42

1 post - 1 participant

Read full topic

Template to list all Z-Wave JS nodes and related information

$
0
0

I created a template that lists every zwave_js device node ID, friendly name, device name, manufacturer, model, firmware version and related entities (and state). Thanks to several others who posted related and helpful information.

I use it to:

  • Associate a node ID with its friendly name, device manufacturer and model number
  • Discover missing/disabled entities (e.g. node_status); enable the entity in device settings and it should then be listed
  • Find entities that are not consistently named
  • Understand the capabilities of a device (e.g. scenes, electric consumption)

The template retrieves all zwave_js devices and then uses HTML to create a tabular report. On a dashboard, create a view that is a panel (one card), add a new Markdown card and paste the template into the card. You can also insert it into the template tab under dev tools (but the HTML will not render). I’m not a Markdown or template expert and improvements (e.g. to improve formatting) are welcome.

{# get zwave_js devices #}
{% set ns = namespace(devices=[]) %}
{% set zwave_devices = integration_entities('zwave_js') | map('device_id') | unique | list %}
{% for zwave_device in zwave_devices -%}
  {% set node = (device_attr(zwave_device, 'identifiers') | first | last).split('-')[1] | int %}
  {% set name_by_user = device_attr(zwave_device, 'name_by_user') %} 
  {% set name = device_attr(zwave_device, 'name') -%} 
  {% set manufacturer = device_attr(zwave_device, 'manufacturer') %} 
  {% set model = device_attr(zwave_device, 'model') -%} 
  {% set sw_version = device_attr(zwave_device, 'sw_version') %} 
  {% set entities = device_entities(zwave_device) -%} 
  {# available but not used #} 
    {% set id = device_attr(zwave_device, 'id') -%}
    {% set via_device_id = device_attr(zwave_device, 'via_device_id') %} 
  {# add device info to ns.devices #}
  {% set ns.devices = ns.devices + [ {"node":node, "name_by_user":name_by_user, "name":name, "manufacturer":manufacturer, "model":model, "sw_version":sw_version, "entities":entities} ] %}
{% endfor %}

{# display zwave_js devices #}
<table>
<tr>
  <td align="center"><b><u>ID</b></u></td>
  <td><b><u>Friendly Name</u></b></td>
  <td><b><u>Device Name</u></b></td>
  <td><b><u>Manufacturer</u></b></td>
  <td><b><u>Model</u></b></td>
  <td><b><u>Firmware</u></b></td>
  <td><b><u>Entities (state)</u></b></td>
</tr>
{% for device in ns.devices | sort(attribute="node")  %}
  <tr valign="top"> 
    <td align="center"> {{ device["node"] }}: </td>
    <td> {{ device["name_by_user"] }} </td>
    <td> {{ device["name"] }} </td>
    <td> {{ device["manufacturer"] }} </td>
    <td> {{ device["model"] }} </td>
    <td> {{ device["sw_version"] }} </td>
    <td> 
      {%- for entity in device["entities"] %} {{ entity }} ({{ states(entity)}}) <br>
      {%- endfor %}
    </td>
{% endfor %}
</table>

2 posts - 1 participant

Read full topic

Entity card question - position of "name"

$
0
0

Hi all,

is there a way to place the text “auf” (name) between the red icon and the imput field? I only found options to place it above the date.

Here the code:

type: entities
title: Schedule
show_header_toggle: false
entities:
  - entity: input_datetime.pr03_up_time
    name: 'auf:'

1 post - 1 participant

Read full topic

MQTT Zigbee2MQTT lost connection to buttons, switches and remotes

$
0
0

Hi,

im very new to HomeAssistant. I have installed mosquito and zigbee2mqtt.
im using around 170 zigbee devices. Around 100 as router and 70 as endpoint devices. Sometimes I cannot use my aquara opple or button or my hue dimmer and tap dial and Ikea on/off. all other devices like motion detection devices are working fine.

after restart the mqtt integration oder sometimes the mosquito add-on everything is fine. after a few hours I got the same problem.

where do I have to search for my problem?

first I have installed home assistant on a proxmox server. now I got a separate computer where I installed home assiatnt directly. im using a brand new installation and only backuped zigbee2mqtt because of the many devices.

hopefully someone can help me.

1 post - 1 participant

Read full topic


Stop Faded Volume Changes

$
0
0

I am current utilizing this HA-Fade-Volume-Script by MaxVRAM to fade the volume of my whole-home speaker system entities. The one big modification I made to the original script is I changed the mode from Restart to Parallel. I did this since many of my speakers have long-duration faded volume changes at the same times or events, and using Restart mode essentially killed every run except the last one triggered.

As a result, the problem that now occurs is that when a target speaker is already in a long-period volume fade and is triggered again, the previous fade is fighting against the current run of the script on that same speaker entity. Volume up, down, up, down, up, down… you get the picture. In any event, I can’t seem to figure out how to stop the previous script run on that specific speaker entity. One thought I had was to rely on context_id to identify any previous script running on that particular speaker and kill it, but I’m not sure how to do something like that.

While stopping the previous run in-script may be good, an even better solution would allow ANY activity (even manual volume changes) to stop the script. I suppose I could bight the bullet and create that same script for every single speaker entity and change it back to Restart mode, that would solve some of the proble (but not when manual changes are detected) but I’m looking for a more elegant solution (if it exists). Thanks for the help.

1 post - 1 participant

Read full topic

Camera.record Frigate error?

$
0
0

Upon attempting to record clips from cameras that are in Frigate using camera.record, I now receive the error Failed to call service camera.record. camera.driveway does not support record service.
This is the way I used the get the recordings and screenshots when I was using the reolink integration.
Does anyone know what I need to do to fix this? I attempted adding rtmp to my streams.
Or maybe I’m going about this wrong.
I am trying to record a 3 second clip when a door sensor opens. Thank you in advance.

1 post - 1 participant

Read full topic

ESP32 how to configure API

$
0
0

Hello all,
First of all please be warned - I have no idea what the heck I’m doing :wink:

I am trying to make a DIY presence detector with ESP32 and LD2410. I have found many youtube videos on the subject but absolutely none of them are beginner user-friendly. I’m trying to follow along one of those videos but I can’t even start the first step.

I’ve plugged in the ESP32 board and I see it powers up (good news!), but when I try to add it to HomeAssistant I get the following message: “homeassistant can’t connect to esp. please make sure your yaml file contains an ‘api:’ line.”. I understand that ESP now requires an optional encryption key, so that API line requirement is fairly new and the youtube videos I’ve seen don’t consider this.

Furthermore, according to this : Native API Component — ESPHome

The only configuration I need to add in the YAML config file is this (as everything is optional) :

Example configuration entry

api:

So I went ahead and entered this, yet I still have that first error message. Obviously I don’t understand the instructions I’ve seen.

How can I fix this? Please provide step-by-step instructions so that even a 5-year-old could understand :wink: For some reason after I get past this hurdle another one will be waiting for me. So you’ll probably hear from me again :stuck_out_tongue:

Thanks :slight_smile:

3 posts - 2 participants

Read full topic

Shell commands from docker container

$
0
0

Heya! I’m new to HA and automation in general. Looking for some advice on how to tackle this.

I have an Raspberry pi running HA in a docker container. I’m trying to make an on/off switch for my pc and got the WoL part working. Turning off less so.

Right now I’m trying to send a shell command from the docker container to the static ip from the pc, but it does not seem to be working. Entering the command ‘plainly’ into the RPI’s terminal does work however.

Right now i have this:

Switch:
 platform: wake_on_lan
 mac: [MACADRESS] 
 turn_off:
   service: shell_command.shutdown

shell_command:
 shutdown: "net rpc shutdown -I [IPADRESS] -U [LOGIN]"

Any idea on how to successfully get this message across from within the container?

1 post - 1 participant

Read full topic

Alexa says "it doesnt support that"

$
0
0

I just had some Hunter Douglas blinds installed that work with a remote control and my Alexa app. When I created scenes in the Power View app for these blinds, the same scene names transferred over to the Alexa app.
If I click on the scene in Power View app, the blinds respond and work fine. When I ask Alexa for the same scene, it says “it doesnt support that”. I did create a group called BLINDS so I can view the scenes. What am I doing wrong???

2 posts - 2 participants

Read full topic

Viewing all 107680 articles
Browse latest View live


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