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

Cloudflare tunnel showing up as ISP assigned WAN IP (CG NAT)

$
0
0

Hello, Fabulous people of HA community.

Over the period of learning and setting up HA, I got all my answers (99%), however, I am currently faced with a situation and not able to get a resolution.

My Setup:

Server 1: XCP server with
VM1 - HA CORE (192.168.1.56)
VM2 - Ubuntu server (192.168.1.62)

Server 2: Ubuntu DR server (running backup processes) (192.168.1.50)

My ISP does not provide public IP, (I am behind CGNAT and get dynamic IP from 100.x.x.x - 122.x.x.x) thus I use cloudflared tunnel to get HA exposed to internet (GOOGLE).

When I run cloudflare tunnel on server 2, HA throws up an error as

Received X-Forwarded-For header from an untrusted proxy 100.x.x.x

but runs fine if I run it from server 1, as at that time the IP HA reports are from 192.168.1.x/24 which matches my HA HTTP allowed proxy rule in configuration.yml file, as needed for proxies.

http:
use_x_forwarded_for: true
trusted_proxies: 192.168.1.0/24

The cloudflare plugin in this guide Cloudflare Addon does not work as it seems it needs public IP to be updated in Domain (zone) DNS records to point to HA.

Any suggestion why that is and how can I fix it? Kindly bear in mind I am still learning and pretty new to Linux in general.
Thank you in advance :v:

Edit: added link for addon

1 post - 1 participant

Read full topic


MQTT Turn some lights on when restart MQTT hub on homey

$
0
0

Hello,

When I restart the MQTT Hub in homey, it will start a broadcast for the device.
But then it looks like home assistant somewhere powered on 3 off the lights… and every time the same lights…

Hope someone can help me with this.

Thanks,

Marcel

2 posts - 2 participants

Read full topic

Create custom sensor with condition

$
0
0

I created a custom sensor in sensor.yaml which works:

- platform: template
  sensors:
    last_illumi_garage:
      entity_id: sensor.hue_motion_sensor_illuminance
      friendly_name: "Last Illuminance Garage"
      unit_of_measurement: 'lx'
      value_template: "{{states('sensor.hue_motion_sensor_illuminance') }}"

How do I add a condition to this (light.signify_garage needs to be off) so it only updates in that case.

1 post - 1 participant

Read full topic

Automation trigger on group of sensors AND sent specific triggering sensor in notification SO CLOSE

$
0
0

I have seen and read a lot of post people trying to get this working and Im SO CLOSE.

I am able to trigger on group and with the use of a template able to send the specific sensor in the group that triggers it. Now I only want to sent the notification when it goes from “off” to “on” (when one of the doors opens and it now sends a notifications on whatever state change.

Probably simple but i have no experience with templates.

How do i rewrite this to only sent when the state goes from “off” to “on”

###########################################################################################
# NOTIFY WHEN DOORS ARE OPEN
###########################################################################################
- alias: Notify if door opens
  trigger:
    platform: event
    event_type: state_changed
  condition:     
    condition: template
    value_template: >
      {{ trigger.event.data.entity_id in
        state_attr('group.Door_sensors','entity_id') }}
  action:
    service: notify.mobile_app_XXXXX
    data:
      title: "Alarm"
      message: "{{ trigger.event.data.new_state.name }} opened"

1 post - 1 participant

Read full topic

Sonoff Zigbee 3.0 USB Dongle Plus wierdness

$
0
0

I am trying to use a Sonoff Zigbee 3.0.USB Dongle Plus on a Raspberry Pi 3 Model B+ running Home Assistant but the configuration does not seem to be anything like shown or described on YouTube videos, tutorials, or the Sonoff site. After plugging in the dongle, Notifications says that there are new devices discovered.

Selecting Configuration - Devices & Services - Integrations

Several integrations are shown including one for the dongle, but it is shown as “Z-Wave JS”. Selecting configure on this requests that I Enter the Z-Wave JS add-on configuration including S0 Key (Legacy, S2 Access Control Key, S2 Authentication Key, and S2 Unauthenticated Key.

I have tried this on two installations, one on a Pi3 B+ installed as Home Assistant Operating System, the other on a Raspberry Pi 2 installed as Home Assistant Supervised, and have tried both with and without Sonoff eWeLink installed but nothing gets me any further.
Picture below of expected discovery, actual and configuration.

Any advice and guidance would be greatly - nay, desperately appreciated.

Mike

1 post - 1 participant

Read full topic

Error when installing catt on rpi

$
0
0

Getting a pretty hefty error when running pip3 install catt. Runs fine for a while but trips up when it comes to pycryptodomex. Any thoughts on how to get past this point in the install would be much appreciated.

Installing collected packages: pycryptodomex, protobuf, mutagen, casttube, yt-dlp, PyChromecast, Click, catt                                                                       
    Running setup.py install for pycryptodomex ... error                                                                                                                           
    ERROR: Command errored out with exit status 1:                                                                                                                                 
     command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_wud3_zc/pycryptodomex_c018d401b66e467eaf9812ee8381c0f0/setup.py'"'"'; 
__file__='"'"'/tmp/pip-install-_wud3_zc/pycryptodomex_c018d401b66e467eaf9812ee8381c0f0/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"
'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-1uf6e9ni/install-record.txt --single-version-externally-managed
 --compile --install-headers /usr/include/python3.9/pycryptodomex                                                                                                                  
         cwd: /tmp/pip-install-_wud3_zc/pycryptodomex_c018d401b66e467eaf9812ee8381c0f0/  

(this is just a part of the error message)

1 post - 1 participant

Read full topic

UI Hanging, errors in logs for python, mainthread, etc - slowly getting worse?

$
0
0

It seems over the past few days I’ve been having an issue where the UI would hang and show in red in the bottom left corner “connection lost, reconnecting…” and get stuck on the HA splash screen with Loading Data under the logo. It lasts about a min and then seemingly everything goes back to normal.

I’m not quite sure what to make of it - but I feel like this might be leading up to a bigger issue and I don’t really want to be caught out with HA burning down.

HA is run on a powerful ESXi server and has 4 cores and 8 GB of RAM so it’s never slow which is why I was worried when it was starting to show this behavior out of no where.

Here are the logs from CORE - not sure if I should post anything else. Any help would be appreciated!

Core Version core-2021.11.5
Supervisor Version supervisor-2021.12.2

2022-01-04 11:06:18 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
2022-01-04 11:09:46 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
2022-01-04 11:10:46 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
2022-01-04 11:11:46 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
2022-01-04 11:13:46 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
2022-01-04 11:14:46 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
2022-01-04 11:18:46 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404
2022-01-04 11:19:36 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 98, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 24, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 138, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 135, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/http.py", line 46, in get
    return await WebSocketHandler(request.app["hass"], request).async_handle()
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/http.py", line 148, in async_handle
    await wsock.prepare(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_ws.py", line 135, in prepare
    payload_writer = await super().prepare(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_response.py", line 378, in prepare
    return await self._start(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_response.py", line 386, in _start
    await self._write_headers()
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_response.py", line 458, in _write_headers
    await writer.write_headers(status_line, self._headers)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/http_writer.py", line 119, in write_headers
    self._write(buf)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/http_writer.py", line 67, in _write
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
2022-01-04 11:19:44 ERROR (MainThread) [frontend.js.latest.202111090] http://homeassistant:8123/a0d7b954_esphome/dashboard:0:0 Uncaught 
2022-01-04 11:19:52 ERROR (MainThread) [frontend.js.latest.202111090] http://homeassistant:8123/config:0:0 Uncaught 
2022-01-04 11:21:00 ERROR (MainThread) [frontend.js.latest.202111090] http://homeassistant:8123/hassio:0:0 Uncaught

1 post - 1 participant

Read full topic

Count "on"-time of a binary-sensor

$
0
0

Hey folks,

how can I count during one day the time a binary-sensor is “on”?

4 posts - 2 participants

Read full topic


Yale YRD256 Lock - Battery 100% with a "Replace Battery Soon" Notification

$
0
0

I have two Yale Locks with “Replace Battery” notifications even though the batteries are at 100%. One of the locks is working properly, and it does not show a Replace Battery notification. Here’s a screenshot of the device with the incorrect message:

And the screenshot from zwavejs2mqtt:

Does anyone know how I can reset the message that the battery needs to be replaced soon? Thanks!

1 post - 1 participant

Read full topic

Zigbee2mqtt needed? _TZE200_chyvmhay TS0601 show wrong temperature / not work

$
0
0

Hello,

i am am new to hass. I have a lidl home gateway connected via ZHA in home assistant see link.
Lightbulbs and powerswitches worked nearly out of the box :slight_smile:

I have trouble setting up the radiator valves (_TZE200_chyvmhay TS0601).
I read this link now i am unsure how to get it work.
Do i need zigbee2mqtt for this devices?
If yes is it possible to use zigbee2mqtt with my gateway?
Do you know a good howto to learn this “basics”?

Greetings Schnabulator

1 post - 1 participant

Read full topic

Copy files from media folder to /local/www

$
0
0

Hi ,
im new in HA im sysadmin linux expert, i want to improve with container technology and microservices cause im a newbie with containers in general…

I explain my scenario (running HA 7.1 in VM in my home server) and what i’d like to do :

I make a simple script in my NAS running in VM: the script consists in select , and collect in a directory the last picture captured by my zm-server NVR(running also in VM) for every single camera, It is associated at the last motion detected for each camera …

I want to insert these picture(snapshot of ip camera) in a lovelace picture badge

I already mounted the NAS in my HA ,and i can see the files in my “media browser” of homeassitant,
I know that if i want to show files in a badge in the homepage front end , i need to put them in the directory /local/www that means a create in my config (cause a don’t want to collect to webserver and use reverse proxy and vpn for retrive the picture directly from the server).

i try to create the service…

homeassistant:
media_dirs:
media: /media
shell_command:
mount_share:
'mkdir -p /mnt/media;ln -s /mnt/media /media; mount -t nfs4 10.X.X.XXX:/Cameras /mnt/media/'
copy_images:
'cp -r /mnt/media/snapshot/* /local/

and after that i try this automation

automation:

description: 'copia eventi'

trigger:

- platform: time_pattern

minutes: 15

condition: []

action:

- delay:

hours: 0

minutes: 0

seconds: 5

milliseconds: 0

- service: shell_command.copy_images

mode: single

I know that for sure there many mistakes in my code, but i can’t understand if im in the right wat and what i need to do for a very simple task (automation for coping the files ever 10 minutes in my case is enough to solve the problem) problably the service with the shell command is not correct ?

Any suggestions?
Thx

1 post - 1 participant

Read full topic

Logging Daily, Weekly, Monthly Energy Usage of Sonoff S31 smart plugs. No metrics are being recorded, DevTools showing "0" or "unknown" for energy sensors

$
0
0

Hello all,
I hope you are all doing well thus far in the new year.

HASS: HASS OS 7.1
Core: Core-2021.12.7
Supervisor: supervisor-12.2
Initially installed Home Assistant using haos_ova_7.0.ova HassOS Image about 2 months ago.

Goal: I would like to start tracking energy usage (consumption) from my Sonoff S31 (not the Lite version) power monitoring feature and display that data in Daily, Weekly, and Monthly aggregate values for each plug that is shown below. I would like to get it to a point where I can show these values in the Energy dashboard and aggregate all values to an overall usage in Daily, Weekly, and Monthly values as well.

Problem: I have been searching through the documentation and through multiple different blogs and forums attempting to see if this has been done before or to figure out what I am doing wrong, but have been unsuccessful in getting the integration entities to show anything other than “unknown” and the Utility Meter integration to show anything other than “0”. Looking at the developer tools and searching for “energy” each sensor appears correctly including with desired naming… but some “energy” sensors show “unknown” and some show “0” for the values. The same for some of the daily/weekly sensors. However, the Monthly sensors weren’t created in HASS at all (searched for “monthly” in DevTools and no entries are returned).

The plugs deliver a few different entities in HA:

  • Power (watts)
  • Current (Amps)
  • Voltage (volts)

I have attempted to utilize the “Integration” integration to create a number of new sensors to track energy consumption by utilizing this blog: https://mwunderling.com/blog/energymonitoringha.html and after creating the Integration integration entities, rounding it out with Daily, Weekly, and Monthly entities for the Utility Meter integration.

I have Recorder recording to a MariaDB container on another VM host. This is working perfectly thus far with reporting everything it was previously. I am also shipping data to InfluxDB for eventual reporting in Grafana. InfluxDB is also working, but I don’t think this has much to do with this issue, other than InfluxDB also confirming that while the energy entities are created, they have 0 data being reported about them. This leads me to believe that the integration isn’t working or I have the integration in configuration.yaml incorrect.

Here are the following entries:

sensor: 
  ## Define Engery Monitoring Collections Integration Sensors
  # Fridge/Freezers
  - platform: integration
    source: switch.sonoff_10012b7956
    name: Fridge Energy
    unit_prefix: k
    round: 2
  - platform: integration
    source: switch.sonoff_10012b7360
    name: Freezer (Center) Energy
    unit_prefix: k
    round: 2
  - platform: integration
    source: switch.sonoff_10012b7d4e
    name: Freezer (Outer) Energy
    unit_prefix: k
    round: 2
  ## HomeLab
  - platform: integration
    source: switch.sonoff_10012ef72b
    name: ESXi Energy
    unit_prefix: k
    round: 2
  - platform: integration
    source: switch.sonoff_10012ef2cf
    name: NAS Energy
    unit_prefix: k
    round: 2
  - platform: integration
    source: switch.sonoff_10012b754a
    name: Desktop-Dave Energy
    unit_prefix: k
    round: 2
  ## TV's
  - platform: integration
    source: switch.sonoff_10012b7af7
    name: TV Alex Energy
    unit_prefix: k
    round: 2
  - platform: integration
    source: switch.sonoff_10012effd6
    name: TV Bash Energy
    unit_prefix: k
    round: 2
  - platform: integration
    source: switch.sonoff_10012ef0c1
    name: TV Living Room Energy
    unit_prefix: k
    round: 2
  ## Geckos
  - platform: integration
    source: switch.sonoff_10012b7461
    name: GeckoDaytimeLight Energy
    unit_prefix: k
    round: 2
  - platform: integration
    source: switch.sonoff_10012b7454
    name: GeckoNightLight Energy
    unit_prefix: k
    round: 2

## Utility Meter Integration
utility_meter:
  ## Fridge/Freezer Energy Consumptions ##############
  ## Fridge
  fridge_daily_energy:
    source: sensor.fridge_energy
    cycle: daily
  fridge_weekly_energy:
    source: sensor.fridge_energy
    cycle: weekly
  fridge_monthly_engergy:
    source: sensor.fridge_energy
    cycle: monthly
  ## Freezer (center)
  freezer_center_daily_energy:
    source: sensor.freezer_center_energy
    cycle: daily
  freezer_center_weekly_energy:
    source: sensor.freezer_center_energy
    cycle: weekly
  freezer_center_monthly_engergy:
    source: sensor.freezer_center_energy
    cycle: monthly
  ## Freezer (outer)
  freezer_outer_daily_energy:
    source: sensor.freezer_outer_energy
    cycle: daily
  freezer_outer_weekly_energy:
    source: sensor.freezer_outer_energy
    cycle: weekly
  freezer_outer_monthly_engergy:
    source: sensor.freezer_outer_energy
    cycle: monthly
  ## HomeLab ################################################################
  ## ESXi
  esxi_daily_energy:
    source: sensor.esxi_energy
    cycle: daily
  esxi_weekly_energy:
    source: sensor.esxi_energy
    cycle: weekly
  esxi_monthly_engergy:
    source: sensor.esxi_energy
    cycle: monthly
  ## NAS
  nas_daily_energy:
    source: sensor.nas_energy
    cycle: daily
  nas_weekly_energy:
    source: sensor.nas_energy
    cycle: weekly
  nas_monthly_engergy:
    source: sensor.nas_energy
    cycle: monthly
  ## Desktop-Dave
  desktop_dave_daily_energy:
    source: sensor.desktop_dave_energy
    cycle: daily
  desktop_dave_weekly_energy:
    source: sensor.desktop_dave_energy
    cycle: weekly
  desktop_dave_monthly_engergy:
    source: sensor.desktop_dave_energy
    cycle: monthly
  ## TV's #######################################################
  ## Alex
  tv_alex_daily_energy:
    source: sensor.tv_alex_energy
    cycle: daily
  tv_alex_weekly_energy:
    source: sensor.tv_alex_energy
    cycle: weekly
  tv_alex_monthly_engergy:
    source: sensor.tv_alex_energy
    cycle: monthly
  ## Bash 
  tv_bash_daily_energy:
    source: sensor.tv_bash_energy
    cycle: daily
  tv_bash_weekly_energy:
    source: sensor.tv_bash_energy
    cycle: weekly
  tv_bash_monthly_engergy:
    source: sensor.tv_bash_energy
    cycle: monthly
  ## Living Room 
  tv_living_room_daily_energy:
    source: sensor.tv_living_room_energy
    cycle: daily
  tv_living_room_weekly_energy:
    source: sensor.tv_living_room_energy
    cycle: weekly
  tv_living_room_monthly_engergy:
    source: sensor.tv_living_room_energy
    cycle: monthly
  ## Geckos ######################################
  ## Gecko Daytime 
  gecko_daytime_daily_energy:
    source: sensor.geckodaytimelight_energy
    cycle: daily
  gecko_daytime_weekly_energy:
    source: sensor.geckodaytimelight_energy
    cycle: weekly
  gecko_daytime_monthly_engergy:
    source: sensor.geckodaytimelight_energy
    cycle: monthly
  ## Gecko Nighttime
  gecko_nighttime_daily_energy:
    source: sensor.geckonightlight_energy
    cycle: daily
  gecko_nighttime_weekly_energy:
    source: sensor.geckonightlight_energy
    cycle: weekly
  gecko_nighttime_monthly_engergy:
    source: sensor.geckonightlight_energy
    cycle: monthly

Additionally, I moved away from SQLite and have MySQL setup.

## Setup Recorder Retention - should help to improve DB performance. 
recorder:
  commit_interval: 120
  purge_keep_days: 7
  auto_purge: true
  db_url: mysql://homeassistant:homeassistantDBPW%40core-mariadb/homeassistant?charset=utf8mb4
  include:    # Include everything you graph and will want to see later
    domains:
      - sensor
      - binary_sensor
      - switch
      - light
              # Everything is included by default. 
       
  exclude:    # Eliminate anything that you never graph or refer back to
    domains:
      - automation
      - updater
    entities:
      - sun.sun
      - sensor.time
      - sensor.date_time_iso # Don't record date and time
      - sensor.date_time_utc # Don't record date and time
      - sensor.date_time # Don't record date and time
      - sensor.yr_symbol # Ignore this as well

Finally, and I’m not sure that this has anything to do with it… but I also am sending data to InfluxDB as I want to eventually report things in Grafana (but haven’t really gotten there)

## InfluxDB Integration
influxdb:
  api_version: 2
  ssl: false
  host: 10.0.100.15
  port: 8086
  organization: TheHartHaven
  bucket: HomeAssistant
  token: !secret influxdb_administrator_token
  tags: 
    source: HA
  tags_attributes:
    - friendly_name
    - field

1 post - 1 participant

Read full topic

Hue wall switch controlling a dimmer

$
0
0

How can a Philips Hue wall switch be configured to control a dimmer with the following functionality?

  • Wall switch is connected to a toggle switch with spring return (retrofit, see pictures)

  • Dimmer is Nordtronic or similar

  • Light on / off: short press up / down

  • Light Increase / decrease: press and hold up / down

I’m a Hue newbie so any idea for a solution without API programming :blush:

1 post - 1 participant

Read full topic

Trigger HDMI Power Toggle on FireTV

$
0
0

Has anyone been able to trigger the HDMI power button on a Amazon FireTV? Using the POWER command from this article, simply powers off the FireTV, but the TV stays on. I tried to capture the command with learn_sendevent but nothing pops up for the power button. I think what I need to trigger is the KEYCODE_TV_POWER 177 but not seeing a way to do that yet. Thanks!

1 post - 1 participant

Read full topic

Bulk Export entities to csv then Bulk Import of changes (Rename, Delete)?

$
0
0

Is there a script example to export all entities to a text file that I can manipulate in an editor, or a spreadsheet, and then re-import the changes?

I’d like to be able do the following:-
2. rename several entities suffixed with “_2” to remove the _2
3. change icon, area, name, and/or entity id as I change my naming standard.

I’ve seen various code snippets to extract the data and change some elements, but I would find it easier to extract, transform groups of entities in a spreadsheet, and load back in to HA.

1 post - 1 participant

Read full topic


Upgrade python on HA Core (running on Proxmox)

$
0
0

Searched the forum and did a websearch but don’t think I found relevant info.

In my LXC, I get: Python 2.7.16
In venv: Python 3.7.3
and HA info shows Python Version 3.8.7

Can anyone give me some pointers on how to upgrade to python 3.9 please?
TIA

1 post - 1 participant

Read full topic

MQTT Vacuum - "unknown"

$
0
0

Hi, I flashed my roboroc with vacuum_1898_valetudo_2021_12_1.pkg and the valetudo gui works fine.

When setting up MQTT Vacuum I get the following issue, any advice?

2 posts - 2 participants

Read full topic

How to suppres inexistence of attribute

$
0
0

Hello
I have specific sensor which collects a lot of data in its attributes which are json objects

sensor.doorwindow_counter.attributes.counter.obj1.json_data
sensor.doorwindow_counter.attributes.counter.obj2.json_data 
etc

where json_data is for example

{
    "count" : 0,
    "time_reset": ...,
    "time_last": ....
}

the point is, that objX may not exist at time of filling another template which references those data. See count attribute in template below

  - platform: template
    sensors:
      child_room_window:
        friendly_name: "Child Room Window"
        device_class: "window"
        attribute_templates:
          battery: >-
            {{ state_attr('binary_sensor.child_room_window_battery','battery') }}
          tilt: >-
            {{ state_attr('binary_sensor.child_room_window_tilt','tilt') }}
          count: >-
            {{ state_attr('sensor.doorwindow_counter','counters')['child_room_window_state']['count'] }}

It will fail if sensor.doorwindow_counter.attributes.counters.child_room_window_state doesn’t exist.
Inexistence of count attribut is not critical, it can be suppresed by default(0).

But how can I suppress inexistence of the the first level key in counters object?
probably I could check existence first, then decide if go deeper or not. But in case of yet deeper structure it would have code havoc. Is there a nice way how to cope whith such situation?

1 post - 1 participant

Read full topic

Setting up my ConBee ZigBee dongle with QNAP

$
0
0

Hello!

I’m completely new to this, and would really need some input as I’m completely lost!
I have set up HA on my QNAP TS-869 Pro running firmware 4.3.4 which is not the latest version as it is too old to update. This NAS does not support Container Station or HA natively, but I was able to install HA with a third party app store for my NAS. This gave me an installation of HA 2021.12.7 Core. I’m trying to install ZHA or deCONZ on my HA but this is not working correctly. deCONZ asks to authenticate the app, but this is not possible as I cannot find the correct path as described. With ZHA I cannot find my serial device path, after looking online it seems that this would be found in the supervisor tab, but this is not visable in my system. I have looked at every setting and I simply cannot find this information anywhere, and it has made it impossible to set up my ConBee ZigBee dongle.

Any help would be much appreciated!

1 post - 1 participant

Read full topic

AndroidTV changed IP

$
0
0

I added 2 Fire TV Sticks and 1 AndroidTV Box to my HA, but last week I got a new router and the IPs changed. After this, the log is filled with errors:

2022-01-04 16:27:35 WARNING (MainThread) [androidtv.adb_manager.adb_manager_async] Couldn't connect to 192.168.4.48:5555. ConnectionRefusedError: Connect call failed ('192.168.4.48', 5555)

2022-01-04 16:27:35 WARNING (MainThread) [homeassistant.components.androidtv.media_player] Could not connect to Fire TV Bedroom at 192.168.4.48:5555 using Python ADB implementation with adbkey='/config/.storage/androidtv_adbkey'

2022-01-04 16:27:41 WARNING (MainThread) [androidtv.adb_manager.adb_manager_async] Couldn't connect to 192.168.4.65:5555. ConnectionRefusedError: Connect call failed ('192.168.4.65', 5555)

2022-01-04 16:27:41 WARNING (MainThread) [homeassistant.components.androidtv.media_player] Could not connect to Cogeco at 192.168.4.65:5555 using Python ADB implementation with adbkey='/config/.storage/androidtv_adbkey'

I have already updated my configuration.yaml with the new IPs (the ones in the log are the correct IPs) so what am I missing?

1 post - 1 participant

Read full topic

Viewing all 105779 articles
Browse latest View live


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