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

Turn interior light on and off based on several triggers

$
0
0

This is beyond sun above horizon.

I live in Norway, and this time of the year it’s still dark inside (need interior light) at 10:30 AM, and it’s still no need for interior light in the summer when the sun barely dips below the horizon.

So my approach to control interior and exterior lights is to determine when it’s dark inside and outside, based on a luminance sensor pointing to the sky on my south wall.

Today I found my automations did not trigger in the morning, and I found one reason would be the luminance sensor never changed to off during the night (doh…), thus never triggering the automation:

binary_sensor.dark_inside is set when luminance outside is below xx lux, and cleared when above the threshold.

automation:
  - alias: "[Lys] Grunnbelysning på eller alt lys av"
    trigger: 
      - platform: state
        entity_id: binary_sensor.dark_inside   ## triggers when binary sensor changes
    action:
        # This script turns light on if the light is off and vice versa
      - service: script.lys_grunnbelysning_pa_eller_av

I am looking for a way to make sure we turn on the lights even when its dark in the moring.

Would my only solution here be to use a time trigger? Are there there other alternatives?

1 post - 1 participant

Read full topic


Creating some code to do the Math for me

$
0
0

The further my Home Automation system develops the happier I become with Home Assistant. A well structured architecture and very easy to configure for anyone without digital anxiety.

It is however about time to introduce some more advanced calculations to support the decision making process in my Home Assistant setup. For example I would like to analyze if all comfort criteria are always met in my house, if the energy consumption is improved or …

I assume that it requires to build some API and integrate it with HA, but maybe I there is more than just creating a template within HA. As I don’t want to mess up the architecture and keep the code manageble over time I would appreciate some guidence on the best way forward.

As you hear I do not have a clue yet. So it would be really nice if somebody can provide me references to documents where that describe how to do that or some practical examples that I can mimic?

1 post - 1 participant

Read full topic

Issue with Logitech Harmony Integration

$
0
0

I have tried with XMPP enabled and disabled on my Harmony Hub same result.

Inside integrations if I add the Logitech Harmony Integration, put in the IP address for my hub and the Name (as it is set in the harmony hub) the integration says it fails no reason given yet the integration box shows up with no devices, if I click options it create a pop up stating installing integration and this pop up never completes or finishes.

HA is Docker install of version 0.118.5

Logs:

Logger: aiohttp.server
Source: components/harmony/config_flow.py:196 
First occurred: December 18, 2020, 9:56:24 PM (6 occurrences) 
Last logged: 6:17:21 AM

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 118, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 172, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 18, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 127, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 129, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 210, in post
    return await super().post(request)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 60, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 69, in post
    result = await self._flow_mgr.async_init(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 130, in async_init
    result = await self._async_handle_step(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 213, in _async_handle_step
    result: Dict = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/components/harmony/config_flow.py", line 196, in async_step_init
    remote = self.hass.data[DOMAIN][self.config_entry.entry_id]
KeyError: '1e36839b0b6f43c90bf754188c628ab9'

1 post - 1 participant

Read full topic

Create snapshot takes hours

$
0
0

On my 8Gb 120Gb SSD NUC with Homeassistant OS a snapshot takes 2-3 hours to finish.The snapshot size is about 4-5 Gb. My InfluxDB is probably the largest part. Is this normal?

On my test system (same specs, same config, smaller InfluxDB) a snapshot is done in minutes.

1 post - 1 participant

Read full topic

Convert wind direction degrees to text

$
0
0

My wind direction sensor sends the direction in degrees: 0 is North, 45 is North-East, 90 is East and so on untill 315 for North-West. This works fine with below code in configuration.yaml

sensor Windrichting:
  - platform: mqtt
    state_topic: "Windrichting"
    name: "Windrichting"
    icon: mdi:compass-rose
    unit_of_measurement: "º"
    value_template: "{{ value_json.graden | round(0) }}"

Now I am struggling to convert the degrees to directions because I would replace the degrees in my card with text like North, North-West, East and so on. Can someone tell me how to do this?

3 posts - 2 participants

Read full topic

Blueprint error: "...generated invalid automation..."

$
0
0

As a newbee I’m fashinated and lured by the blueprint concept asit would allow me to work with templates for my home automation rather then copy-paste…

But, albeit I have triedto follow the template blueprints bundled with 2020.12, the online documentation as well as Barret’s video, I still fail with even the simplest attempt, resulting in

  • the automation not being visible in the UI, although created in the automation.yaml
  • the server log throwing an error that makes me non the wiser:

Blueprint Mall - slack dumma lamport generated invalid automation with inputs OrderedDict([(‘turn_off_time’, ‘22:00:00’), (‘target_light’, ‘switch.matrum_glas_musik’)]): expected a dictionary for dictionary value @ data[‘action’][0][‘target’]. Got None

Random attempts has created entries in the automation UI, but with the entity field being unpopulated.

Blueprint:

blueprint:
  name: Mall - slack dumma lamport
  description: Slack vid ngt klockslag
  domain: automation
  input:
    turn_off_time:
      name: Tid
      selector:
        time:
    target_light:
      name: Lampa
      selector:
        entity:
          domain: switch

mode: single
trigger:
  platform: time
  at: !input turn_off_time

action:
  service: switch.turn_off
  target: !input target_light

automation.yaml:

- id: '1608379702611'
  alias: abc 201219 1308
  description: ''
  use_blueprint:
    path: homeassistant/mall_slack_dum_lampa_kvall.yaml
    input:
      turn_off_time: '22:00:00'
      target_light: switch.matrum_glas_musik

Things like the usage of preceding “-” in the action part does not make life easier for use newbies, in the two examples attached in 202.12, one of them is written with, while the other is without. Is it significant? No idea. What I do is that I take an existing working automation and try to apply the blueprint requirement on top. Does it work? no.

leaving zone blueprint example:

action:
  domain: mobile_app
  type: notify
  device_id: !input notify_device
  message: "{{ person_name }} has left {{ zone_state }}"

motion light example:

action:
  - service: light.turn_on
    target: !input light_target
  - wait_for_trigger:
      platform: state
      entity_id: !input motion_entity
      from: "on"
      to: "off"
  - delay: !input no_motion_wait
  - service: light.turn_off
    target: !input light_target

1 post - 1 participant

Read full topic

Blueprint not working - invalid entity id

$
0
0

I’m trying to create a blueprint that will toggle a device after a period of time - e.g. turn off a light after it has been on for some time, or turn on a device after it has been off for some time.

I have an automation that works, but turning it into the blueprint below is failing.

When I try to create an automation from the blueprint it says:

2020-12-19 13:10:07 ERROR (MainThread) [homeassistant.components.automation] Blueprint Change device status after period of time generated invalid automation with inputs OrderedDict([('trigger_time', '00:02:00'), ('trigger_device', '91a42907065311ebb26e3548969ee84c'), ('trigger_state', 'on')]): Entity ID 91a42907065311ebb26e3548969ee84c is an invalid entity id for dictionary value @ data['entity_id']. Got None

I’ve seen similar examples using the same input selector (entity) and trigger (state), so why isn’t this one working?

Thanks

blueprint:
  name: Change device status after period of time
  description: Once a device has been in a set status for a period of time, change it to a new status
  domain: automation
  input:
    trigger_device:
      name: Device
      description: Which device to monitor?
      selector:
        entity:
    trigger_state:
      name: State
      description: What state to watch for?
    trigger_time:
      name: Duration
      description: How long to wait before toggling?
      selector:
        time:

mode: restart
max_exceeded: silent

trigger:
  platform: state
  entity_id: !input trigger_device
  to: !input trigger_state
  for: !input trigger_time

action:
  service: homeassistant.toggle
  data:
    entity_id: '{{ trigger.entity_id }}'

1 post - 1 participant

Read full topic

Mapping not allowed in config/configuration.yaml

$
0
0

Hi!
I´m new in this with working with HA. its really interested, but I get into some problem even if I try to follow some instructions on internet. some installation works good, but now I get inte to a problem that I which that someone can help me with.
I have installed portioner, influxdb, Grafana, watchtower, pihole and now latest configurator.
But not I got into problem when I check the configuration.
I got the error:
Error loading /config/configuration.yaml: mapping values are not allowed here in “/config/configuration.yaml”, line 18, column 10

my configuration.yaml looks like this

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Text to speech
tts:
- platform: google_translate
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

influxdb:
host: 192.168.0.86

panel_iframe:
configurator
title: "Configurator"
url: 'http://192.168.0.86:3218'
icon: ndi:wrench
graf:
title: 'Grafena'
url: http://192.168.0.86:3000
icon: mdi:chart-bar-stacked

Where do I have the problem? thanks in advanced / Markus

1 post - 1 participant

Read full topic


Nothing seems to work

$
0
0

hi everyone,
i am stuck ,I cant seem to get home assistant to do any automatons. When i try to use ui to create an automation it will not save the automation i press the save button a black box comes up on the left bottom, but it says nothing just a black box and it does not save the automation.
when i go to file editor and put the automation in the /config/automations.yaml
it does nothing
here is the way i have it in /config/automations.yaml
automation:
condition:
- condition: state
entity_id: binary_sensor.ecolink_4655bc0_r_1a5b1f11_ias_zone
state: ‘open’
- condition: state
entity_id: sun_sun
state: ‘below_horizon’
action:
- service: light.turn_on
entity_id: light.ledvance_a19_w_10_year_f91d0300_level_light_color_on_off

am i doing something wrong ui will not save and putting this in as yamil nothing works

1 post - 1 participant

Read full topic

Rest Sensor not working for smartmeter

$
0
0

Hi there,
I’m new to home assistant and during implementation of my first rest sensor I ran into the following problem:

My smartmeter returns following json data:

[
...
{"Monat":"10","Waehrung":"EUR","Kwh180":360.2891,"Kwh181":0,"Kwh182":0,"Kwh280":0,"Kwh281":0,"Kwh282":0,"Betrag1XX":90.82888211,"Betrag2XX":0},{"Monat":"11","Waehrung":"EUR","Kwh180":344.6198,"Kwh181":0,"Kwh182":0,"Kwh280":0,"Kwh281":0,"Kwh282":0,"Betrag1XX":86.87865158,"Betrag2XX":0},{"Monat":"12","Waehrung":"EUR","Kwh180":212.637,"Kwh181":0,"Kwh182":0,"Kwh280":0,"Kwh281":0,"Kwh282":0,"Betrag1XX":53.6057877,"Betrag2XX":0}]

My sensor looks like this:

sensor:
  - platform: rest
    name: 'ehz01_year'
    scan_interval: 30
    resource_template: 'http://10.10.10.10/pages/getinformation.php?auswertung_jahr&jahr={{ now().strftime("%Y") }}&meterindex=1'
    value_template: '{{ 'OK' }}'
    #json_attributes_path: '$[(selectattr("Monat","eq",now().strftime("%m")))]'
    #json_attributes_path: '$[months[now().month-1].strftime("%m")]'
    #json_attributes_path: '$[now().strftime("%m")]'
    json_attributes_path: '$[{{ (now().month - 1) }}]'
    json_attributes:
      - Kwh180
      - Betrag1XX
  - platform: template
    sensors:
      ehz01_monthconsumption:
        value_template: '{{ states.sensor.ehz01_year.attributes["Kwh180"] | round (2) | float }}'
        device_class: energy
        unit_of_measurement: 'kWh'
        unique_id: 'sensor.ehz01_monthconsumption'
      ehz01_monthcost:
        value_template: '{{ states.sensor.ehz01_year.attributes["Betrag1XX"] | round (2) | float }}'
        unit_of_measurement: '€'
        unique_id: 'sensor.ehz01_monthcost'

I’d like to use json_attributes_path to find the line of the current month in the json array (month -1), but the syntax seems not to be correct. After changing it to json_attributes_path: '$[11]' data where retrieved successfully.

What am I doing wrong?

Thank you for your help!

Oliver

1 post - 1 participant

Read full topic

Way to turn off switch (extractor fan) based on how long light has been on

$
0
0

I have linked a Sonoff into my extractor fan as I have a hue bulb in my bathroom. (this meant that the extractor fan was on all the time due to the hue bulb being constantly powered… I digress

Want I currently have is if the light turns on and remains on for over 3.5 mins then turn on the extractor fan relay, and then then the light turns off, turn off the relay. This is fine (better than how it was) but I want to improve it.

I want to be able to delay the turn off command based on how long the light has been on. So if the light was on for a little while turn the extractor fan off as soon as the light goes off, but if the light was on for a while (aka a shower), then keep the extractor fan on for longer, say a few minutes after the light goes off.

I see there is a timer, but that counts down, ideally I want the reverse. Is there an easy way to achieve this? There may be something I am not thinking. I guess one option is to install a humidity sensor and use that as a condition, but I dont have one of those, so hoping I can do it through logic for now.

1 post - 1 participant

Read full topic

Ability to use Shuffle to randomly order script sequence

$
0
0

Hi there,

I’ve made a script for Home Assistant which sets up my Vacuum cleaner to mop specific rooms. I want to have another script which can run all the specific room mopping scripts, but in a random order (so that the water in the reservoir will run out at different spots instead of the same place each time).

Each room-mopping script looks like this:

alias: Mop Bedroom
sequence:
  - service: vacuum.set_fan_speed
    data:
      fan_speed: Gentle
    entity_id: vacuum.xiaomi_vacuum_cleaner
  - service: vacuum.send_command
    data:
      command: app_zoned_clean
      params:
        - - 29144
          - 24140
          - 31928
          - 29208
          - 1
    entity_id: vacuum.xiaomi_vacuum_cleaner
mode: queued
icon: 'mdi:bed'
max: 10

As an initial implmentation, I’d like to get something like this working (string list should probably become a group eventually):

alias: Mop Everywhere
sequence:
{% set services = [ "scripts.mop_kitchen" "scripts.mop_hallway", "scripts.mop_bedroom", "scripts.mop_living_room"] %}
{% for srv in services | shuffle %}
 - service: {{srv}}
   data: {}
{% endfor %}
mode: queued
max: 3

Unfortunately the shuffle command is not available, and I can’t import random in order to provide it. Am I thinking about this wrong? Is there a more idiomatic way of handling this?

1 post - 1 participant

Read full topic

MQTT Light Template - Help needed

$
0
0

I’ve modified my desk lamp with a wemos d1 mini running tasmota to make it “smart”. Since I need to toggle the physical button on my lamp, I use the tasmota “relay1” with “PulseTime 0”. The actual relay hence is always powered off. I have an analog read (ADC0) to actually see whether my lamp is currently turned on (since I can also use the original switch on it)

Now all I need to do is configure a light in Home Assistant that sends a Toggle command to tasmota when being turned on/off but that uses the analog read from my tasmota device as a state_template (>100 it’s turned on, <100 it’s turned off)

I read through the docs and also looked at a few examples, but I’m really not sure how to make this work. I could also extract the state as a sensor and then make it work but I would like not to go that route if not necessary.

1 post - 1 participant

Read full topic

Second button of double light switch does not work

$
0
0

Hi there,

So the problem is this: I am adding a double light switch (lerlink eu model, X712) to ZHA via my sonoff cc2531 usb. All my single switches work fine, however with my one and only double switch, the second button does not work from HA. It finds the device as one, but with two entities. The first entity (left switch) works smooth. The second entity (right switch) does not react. When pressing it on, it goes blue for like 5-10 seconds, then goes back to gray and does not turn of/turn off the light. In my HA logs I get this:

2020-12-19 17:13:10 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x7EDF:2:0x0006]: command failed: 'on' args: '()' kwargs '{}' exception: ''
2020-12-19 17:13:10 DEBUG (MainThread) [homeassistant.components.zha.entity] light.living_room_lights_2: turned on: {'on_off': TimeoutError()}

The first switch that works fine shows this:

2020-12-19 17:00:11 DEBUG (MainThread) [homeassistant.components.zha.core.channels.base] [0x7EDF:1:0x0006]: executed 'on' command with args: '()' kwargs: '{}' result: [1, <Status.SUCCESS: 0>]
2020-12-19 17:00:11 DEBUG (MainThread) [homeassistant.components.zha.entity] light.living_room_lights_1: turned on: {'on_off': [1, <Status.SUCCESS: 0>]}

What is even more weird, if I press the button physically, the entity shows as on and stays on as long as I keep it on. When I physically press to turn off, it also instantly updates the state. I have tried adding/readding the device multiple times, including with HA restarts and my intel nuc restarts. Nothing has helped. My CC2531 has not reached its limit, I am currently at 14 devices with 14 entities, this device included.

Any help is very much appreciated. Thank you.

1 post - 1 participant

Read full topic

Escape Smart Plug

$
0
0

Hello

I have a Prise Intelligente SMP152 / GPRW01 (e)scape smart plug that I having difficulty identifying the correct Tasmota template to use from blakadder.com. I’m wondering if someone else has run into a similar issue and can recommend the correct template to use.

Thanks in advance for any help that can be provided.

Michael

I’ve included some pictures of the plug below.

1 post - 1 participant

Read full topic


Split MQTT payload and send values to entities

$
0
0

Hi,

I’m new to home assistant (I want to switch from openhab to home assistant) and I have a first question.

What is the best way to split a MQTT payload in pieces and use/send this “pieces” as a state to different entities?

At this moment I configured a (MQTT) sensor that receives a string like this: “*STR,3,30,50,50,50,2,1;” . Now I want to use/send these different values as a state to different entities.

I’m able to split the string into pieces by using the “template” functionality of home assistant but I don’t know how to get this values to the entities. Is this the correct way to do this? or is there a better way (like scripts)?

thanks.

1 post - 1 participant

Read full topic

What thermostat parameters to get a copy of the demo?

$
0
0

Hello everyone,
I was hanging around on the HA website and I noticed that the demo thermostat has more options than mine, and I can’t figure out why… More specifically, I’m looking for the different modes (preset and fan mode). Could anybody share his yaml on this please? I think it has something to see with the entity yaml, right?


Thanks in advance!

1 post - 1 participant

Read full topic

Presence detection: if there is motion for x minutes within the last 5 minutes

$
0
0

Hey!
I‘m using the HomematicIP presence detection sensor (https://www.homematic-ip.com/en/products/detail/homematic-ip-presence-sensor-indoor.html). I want to realize an automation which sets the climate temperature after a motion is detected for at least 5min. In general I could use the „for“ argument in the trigger part of my automation. Unfortunately there are often situations where there are a few seconds no motion is detected and that is why the automation is not triggered.

Now the question: Is there any way to realize something like „if there is at least 3min motion within the last 5min, then do anything“?

How do you are realize these situations?

Best regards :slight_smile:

1 post - 1 participant

Read full topic

Is it possible to have one button show state of a switch and controlls of a light?

$
0
0

hi All,

I’ve just replaced my wall switches with the Sonoff T4EU1C no neutral wall switches to control my lights, I’ve also put Ikea tradfri bulbs into the fittings and have an ikea switch control the following

on/off = wall switch on/off
long hold up/down = bulb dimming up/down

what I am looking for is a button on my lovelace where it shows

if the bulb is on/off,
short press = wall switch toggle
long press = more info for the bulb ( so I can control the temp & brightness)

I have been able to do one or the other but not both in one button…

any help?

thank you in advance

1 post - 1 participant

Read full topic

Mediabrowser

$
0
0

I run Hassio on a Raspberry Pi 4B with a 32Gb SD card.
I would like to be able to run my music collection on different mediaplayers and I would like to use the folder “Mediabrowser” for that. But my music collection is too big or I have to compress the files in such a way that it’s not fun anymore. How do I solve that?
Can I attach a hard disk to my Raspberry and have the “Media Browser” refer to it?
I see the following hardware appear when I attach a hard drive to it:

  - /dev/mmcblk0p1
  - /dev/mmcblk0p2
  - /dev/mmcblk0p3
  - /dev/mmcblk0p4
  - /dev/mmcblk0p5
  - /dev/mmcblk0p6
  - /dev/mmcblk0p7
  - /dev/mmcblk0p8

Is there a way to refer to this. And how? Is this the way to solve this or is there a better/other way?

1 post - 1 participant

Read full topic

Viewing all 106481 articles
Browse latest View live


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