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

Automation fail when using condition sun

$
0
0

Hello,

I’m trying to create an automation when the door opens the light goes on. But i want it only to happen after sunset and before sunrise. The moment i put the part condition in my automation it stops working and i have an error next to condition. Any ideas?

image

2 posts - 2 participants

Read full topic


How to generalize a verbose automation with a template group iteration

$
0
0

Hi guys,

I’ve got a ZoneMinder camera array and I’ve built a bunch of automations that control the recording state for the cameras (to disable recording when fog, snow or shadows in the wrong spot, etc.) and it works very well but I’ve noticed that when I restart Home Assistant the states can get out of sync. The global and local controls for each camera say that the camera is enabled but the actual ZoneMinder state is disabled.

Because of this I wrote an automation to force an update of ZoneMinder on a restart of Home Assistant to sync everything up. It works, but I’d like to make it more generic (not specifying all the independent cameras within the automation). Right now it looks like this:

  - id: cameras_update_states_on_restart
    alias: Cameras Update States on Restart
    initial_state: true
    trigger:
      - platform: homeassistant
        event: start
    action:
      - service: switch.turn_{{ 'on' if ( is_state('binary_sensor.cameras_back_yard_global_control', 'on') and is_state('input_boolean.cameras_back_yard_control', 'on') ) else 'off' }}
        entity_id: switch.back_yard_state
      - service: switch.turn_{{ 'on' if ( is_state('binary_sensor.cameras_west_yard_global_control', 'on') and is_state('input_boolean.cameras_west_yard_control', 'on') ) else 'off' }}
        entity_id: switch.west_yard_state
      - service: switch.turn_{{ 'on' if ( is_state('binary_sensor.cameras_east_yard_global_control', 'on') and is_state('input_boolean.cameras_east_yard_control', 'on') ) else 'off' }}
        entity_id: switch.east_yard_state
      - service: switch.turn_{{ 'on' if ( is_state('binary_sensor.cameras_front_door_global_control', 'on') and is_state('input_boolean.cameras_front_door_control', 'on') ) else 'off' }}
        entity_id: switch.front_door_state
      - service: switch.turn_{{ 'on' if ( is_state('binary_sensor.cameras_garage_global_control', 'on') and is_state('input_boolean.cameras_garage_control', 'on') ) else 'off' }}
        entity_id: switch.garage_state
      - service: switch.turn_{{ 'on' if ( is_state('binary_sensor.cameras_out_the_back_global_control', 'on') and is_state('input_boolean.cameras_out_the_back_control', 'on') ) else 'off' }}
        entity_id: switch.out_the_back_state
      - service: switch.turn_{{ 'on' if ( is_state('binary_sensor.cameras_storage_room_global_control', 'on') and is_state('input_boolean.cameras_storage_room_control', 'on') ) else 'off' }}
        entity_id: switch.storage_room_state

Lots of copy/pasta and it makes me feel dirty. Also, if I happen to add more cameras I have to keep this automation sync’d up with the camera list which sucks. I’d much rather have a generic automation that applies to all cameras in the group (rolling through each one and setting the state) but I can’t wrap my head around how to do that or if it’s even possible since the entity_id and service are two separate things…

Anyone have any ideas?

1 post - 1 participant

Read full topic

[error] missing: apparmor

$
0
0

I’m trying to install home assistant on docker on Debian. But every time I run
curl -sL "https://raw.githubusercontent.com/Kanga-Who/home-assistant/master/supervised-installer.sh" | bash -s
I get this: [error] missing: apparmor. I could not find any matching topic on that. Also, my every post about it on Facebook or StackOverflow dies… Please help me!! :weary:

(I’m running on dell wyse Dx0d)

1 post - 1 participant

Read full topic

Light template - Tuya ID

$
0
0

Hi
i’m having trouble with creating a value template for my tuya lights.
They all register as light.numberofID
It seems like HA can’t handle lights that start with a number

states.light.badkamer works, but states.light.321689735468 doesn’t

is there any way around this?

  - platform: template
    sensors: 
      slaapkamer_lights_on: 
        value_template: >
          {% set lights = [
            states.light.3227560084f3eb8f6556
            ] %}
          {{ lights | selectattr('state','eq','on') | list | count }}

1 post - 1 participant

Read full topic

NotSupportedError: Cannot define multiple custom elements with the same tag name

$
0
0

Searched but didn’t find much info. From time to time I saw below on the log, does anyone know what’s wrong and how to fix it? I believe I am running the latest HA and rgb-light-card.

ERROR (MainThread) [frontend.js.latest.202012120] https://xxxx.duckdns.org/hacsfiles/rgb-light-card/card.js:217:22 NotSupportedError: Cannot define multiple custom elements with the same tag name

1 post - 1 participant

Read full topic

Not working weather and hacs

$
0
0

hello everyone. i have trouble. before homeassiatnt working great after update no more working, weather and hacs it just frozen. reinstall 10 times different os version, also made recovery same everything just frozen on my raspberry pi. i hope here have some smart person for help as stupid discord just can provide links with one not solving problem and banning never in my life i see so stupid discord chat

5 posts - 2 participants

Read full topic

Grid-Card on Fullykiosk = "this.ToggleAttribute is not a function"

$
0
0

Hi

I tried the new Grid-Card and on my Windows10 Browser (Chrome) it’s working fine, however on My Android Touch Display running FullyKiosk, i’m getting a red rectangle saying “this.ToggleAttribute is not a function”
I tried to open it under Chromium and it works fine, so seems to be linked on the Broswer embedded into Kiosk. Any idea how to fix this ?

1 post - 1 participant

Read full topic

How do you make a tap_action URL dynamic based on a sensor value?

$
0
0

This is probably the wrong way to do what I want to do, but it is the best I can do so far. I want to look up aircraft data on the FAA website. I use the OpenSky integration to get the call sign of the aircraft, and want to create a URL that will append that call sign to the end of that lookup URL, and then use a tap action on a Lovelace card that will bring up the FAA page with that call sign appended to the end. I made a template sensor that creates the URL with the call sign, but I cannot figure out how to use that sensor value in a tap action. Does anyone know a way to make this work?

This is the (probably silly) way I am trying to do this:

type: picture-elements
tap_action:
  action: url
  url_path:  sensor.aircraft_lookup_url
elements:
  - type: image
    image: /local/images/background_sky.jpg
    style:
      width: 100%
      top: 40%
      left: 50%
      filter: blur(3px) brightness(80%)
  - type: state-label
    entity: sensor.opensky_time
    tap_action:
      action: url
      url_path: sensor.aircraft_lookup_url
    style:
      top: 61%
      left: 15%
      font-size: 16px
      filter: brightness(140%)
  - type: state-icon
    entity: sensor.opensky_time
    tap_action:
      action: url
      url_path: sensor.aircraft_lookup_url
    icon: 'mdi:clock-outline'
    style:
      top: 32%
      left: 13%
      '--mdc-icon-size': 60px
      '--paper-item-icon-color': orange
  - type: state-label
    entity: sensor.opensky_callsign
    tap_action:
      action: url
      url_path: sensor.aircraft_lookup_url
    style:
      top: 60%
      left: 50%
      font-size: 14px
      filter: brightness(140%)
  - type: state-label
    entity: sensor.opensky_altitude
    tap_action:
      action: url
      url_path: sensor.aircraft_lookup_url
    style:
      top: 14%
      left: 50%
      font-size: 14px
      filter: brightness(140%)
  - type: state-icon
    entity: sensor.opensky_callsign
    tap_action:
      action: url
      url_path: sensor.aircraft_lookup_url
    icon: 'mdi:airplane'
    style:
      top: 32%
      left: 48%
      '--mdc-icon-size': 60px
      '--paper-item-icon-color': yellow
  - type: state-label
    entity: sensor.opensky_origin
    tap_action:
      action: url
      url_path: sensor.aircraft_lookup_url
    style:
      top: 60%
      left: 82%
      font-size: 14px
      filter: brightness(140%)
  - type: state-icon
    entity: sensor.opensky_origin
    tap_action:
      action: url
      url_path: sensor.aircraft_lookup_url
    icon: 'mdi:compass'
    style:
      top: 30%
      left: 80%
      '--mdc-icon-size': 60px
      '--paper-item-icon-color': red
image: /local/images/background_color.jpg

I would be grateful for a nudge in the right direction.

1 post - 1 participant

Read full topic


Change color temperature and brightness in python_script

$
0
0

Hi,

Because most of my smart lamps can change color temperature, i created a night shift ‘python_script’ which every 10 minutes shifts the color temp based on time of day/night. I use it mostly for my IKEA Lamps that are connected via a ConBee2 stick. When i created the ‘python_script’ i just could call the light with brightness and color_temp and got a nice transition to the desired color and brightness, but since a few months, i have to call the lamps twice because it only changes one at a time. Do i do something wrong or is something changed and is this intentionally?

In my ‘python_script’ i use:

hass.services.call('light', 'turn_on', {
        'entity_id': 'light.lamp_ceiling_1',
        'brightness_pct': 10,
        'color_temp': 250,
        'transition': 2
    })

So if the state of my lamp is ‘brightness_pct’: 100, ‘color_temp’: 350 the first time i call it, it will change the temp to 250 and after the second call the brightness is changed.

Does anyone has any idea how to fix this?

Regards,
Ferdinand

1 post - 1 participant

Read full topic

Could not get level_template to work

$
0
0

Hello,

i have the following configuration:

livingroom_g:
      friendly_name: Livingroom
      level_template: >-
        {% if states.sensor.gekko_light is defined and states.sensor.gekko_light.attributes['item0'] is defined %}
            {{ state_attr('sensor.gekko_light','item0').split(';')[1]|int }}
        {% else %}
            {{ state_attr('light.livingroom_g','brightness') }}
        {% endif %}  
      value_template: >-
        {% if states.sensor.gekko_light is defined and states.sensor.gekko_light.attributes['item0'] is defined %}
            {% if states.sensor.gekko_light.attributes['item0']['sumstate']['value'].split(';')[0]|float == 1 %}
                on
            {% else %}
                off
            {% endif %} 
        {% else %}
            {{ states('light.livingroom_g') }}
        {% endif %}   
      turn_on: 
        - service: rest_command.rest_gekko_light
          data:
            status: 1
            item: item0
        - service: homeassistant.update_entity
          entity_id: sensor.gekko_light
      turn_off: 
        - service: rest_command.rest_gekko_light
          data:
            status: 0
            item: item0
        - service: homeassistant.update_entity
          entity_id: sensor.gekko_light

But in HomeAssistant no Brightness attribute appears. Even when i put a number to level_template e.g. 128. There is no attribute.
What am i doing wrong ?

The value_template is working fine and the value which i am splitting is something like: “0;100.00;16764280;0;”

Any suggestions ?

1 post - 1 participant

Read full topic

HomeAssistant two connection

$
0
0

Hi

I am running my raspberry with the homeAssistant at home via the Ethernet cable
I would like to bring my raspberry in my RV during my vacation to monitor my sensors that I have in the RV

Is there a way to connect it to my hotspot that I have in my RV?

1 post - 1 participant

Read full topic

Can't upload CODE VIA OTA when my sensor is working

$
0
0

Hello guys,im working on a wemos D1 with one bmp280 sensor and trying to add an illuminance sensor today,my sensor is working properly with the home assistant but when i try to upload the new file the esphome cant resolve the ip adress,so i just compile it to a bin then flashed it on the wemos and the sensors were working great,then i wanted to see if the OTA programming was resolved but still goes with the same error,when litterally the sensor is online on the system and tranferring data,why i cant upload?

esphome:
  name: my_first_sensors
  platform: ESP8266
  board: d1_mini

wifi:
  ssid: "SALONI"
  password: "*************"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "SALONI"
    password: "************"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

i2c:
  sda: D2
  scl: D1
  scan: False
  id: bus_a

sensor:
  - platform: bmp280
    i2c_id: bus_a
    temperature:
      name: "BMP280 Temperature"
      id: bmp280_temperature
      oversampling: 16x
      filters:
      - offset: -1.6
    pressure:
      name: "BMP280 Pressure"
      id: bmp280_pressure
      oversampling: 16x
      filters:
      - offset: 14.3
    address: 0x76
    
  - platform: adc
    pin: A0
    name: "TEMT6000 Illuminance"
    unit_of_measurement: lx
    filters:
      - lambda: |-
          return (x / 10000.0) * 2000000.0;
    update_interval: 5s
    
  - platform: wifi_signal
    name: "WiFi Signal Sensor"
    update_interval: 60s

1 post - 1 participant

Read full topic

Can someone explain Z wave 1.6 add-on and integration as if Im an idiot

$
0
0

…because I am.

I have it working but whats the purpose of the OZW beta add-on and the intergration? Why do I need both to make it work?

And whats the difference between the OZW beta add-on and ZWAVE2MQTT??? Can I use either of these ADD-ONS with the OZW BETA integration?

1 post - 1 participant

Read full topic

Time based automations running late

$
0
0

Hello, for the last several days my automations have been running but not at exactly the configured time. I have several that are set to run on the hour though they have been triggering anywhere from 4-39 minutes after the configured trigger time.

In reviewing logbook they are being noted as running late so I do not believe it is a system clock issue.

I’m running a VirtualBox instance on Ubuntu. See photos from log book showing inconsistency.

Any ideas on where to look and what might be the issue? I’m running latest updates. Thanks!

1 post - 1 participant

Read full topic

Zooz 4 in 1 ZSE40 V2 Issue

$
0
0

I recently purchased and installed a couple of these zwave zooz multi sensors in my house. Everything works great, except for the luminance portion. No matter how bright or dark the room is, the sensor only reports a 0.0%. Both sensors report this so I find it hard to believe its a device fault. Any insight would be appreciated.

1 post - 1 participant

Read full topic


How to change the name of my amazon echo?

Solution to Network Key Issues: Z-Wave & Network Key

$
0
0

This is for anyone who is setting up their Z-wave network for the first time or people who are having issues getting secured devices to work properly. This is an alternative way than adding (zwave:) code to configuration files.

If you have already set up your z-wave network and have added zwave: code to the configuration file follow these steps to fix your secure devices. If you are installing your z-wave usb stick for the first time and have not modified any files or attempted to install your device, jump to step 4.

Step 1: Remove your secure devices from the z-wave network by selecting the node and clicking “remove node” (Follow each devices remove from network instructions).

Step 2: After you have removed the devices from your network. Remove the z-wave code you manually added to any configuration/option file.

Step 3: Go to Configuration>Integrations> Delete the Z-Wave Integration
(Note: This will not remove your existing devices since they are stored on your Z-Wave Stick. However, if you have created custom names for devices you may have to rename them again after.)

Step 4: Create a network key
(There are many ways to generate one however I just changed some of the characters of this example one I found. If you want your own custom key this site is listed in the Z-Wave Install Post: NETWORK_KEY)
0x67, 0x8b, 0x93, 0x5d, 0x84, 0x8b, 0x58, 0x31, 0x06, 0x08, 0xe9, 0xf7, 0xaa, 0x60, 0x9d, 0x5e
(Note: There should not be a z-wave integration after reboot, also your configuration files should be z-wave free at this point)

Step 5: With your USB Z-Wave stick inserted>Go to Supervisor>System>Reboot

Step 6: Go to Configuration>Integration>Click “Add Integration”>Add Z-Wave>A dialog box will pop up with 2 text boxes, Path & Network Key

Step 7: For Path Enter: /dev/ttyACM0 For Network Key Enter your network key without parentheses
Example: 0x67, 0x8b, 0x93, 0x5d, 0x84, 0x8b, 0x58, 0x31, 0x06, 0x08, 0xe9, 0xf7, 0xaa, 0x60, 0x9d, 0x5e

Step 8: Start the Z-Wave network and add your secure devices that you removed using Add Node Secure.

Hope this Helps!

1 post - 1 participant

Read full topic

We couldn't find an OpenZWave instance. If you believe this is incorrect, check your OpenZWave and MQTT setups and ensure that Home Assistant can communicate with your MQTT broker

$
0
0

as the title says

the install of Home assistant is Venv

took a bit to get MQTT installed but this is now talking to Home assistant but even after full reboot it still has this error

this is a full clean install of Home assistant with no other Zwave intergrations

1 post - 1 participant

Read full topic

Thermostat to control a gas heater

$
0
0

Hello all,

I plan to setup a smarter thermostat for the gas heater in my house and I have some questions. Initially I was thinking of starting from the Generic Thermostat example and customise it but I cannot figure some things out. Here is my setup:

  1. I measure the temperature in each room with xiaomi bluetooth devices and feed them to homeassistant via esp32.

  2. my gas heater will have an esp8266 with a relay that will turn it on and off.

Now, the house is not very smartly build so I cannot really control the temperature per room (although I am researching some options for the future).

In my mind I would do the following: take the average temperature in the house using the temperatures in each room and use that as input for the generic thermostat. But this will create the following problem: when the average temperature falls below a threshold even by a bit the heater will turn on and the it will turn off and so on. This leads to a lot of gas being burned. How can I add some sort of condition to this? For example: say the average temperature falls below the threshold but the temperature in one or two rooms are ok (as in between some limits) then the heater should not turn on (this would correspond for example to the situation when a window is opened in one room).

In any case, I am confused about how to add some more logic to the existing generic thermostat example.

Any help or advice is appreciated!

Lucian

1 post - 1 participant

Read full topic

Totalize all entities with '_power'

$
0
0

Hi

All the entities for the different energy-meters end in ‘_power’.

I want to create a sensor that is the total of all these entities.

This is how I do it manually for just 2 sensors:

- platform: template
  sensors:
    em_som_kookplaat:
      friendly_name: 'Kookplaat Power'
      entity_id:
        - sensor.em_kookplaatl1_power
        - sensor.em_kookplaatl2_power
      value_template: "{{ (states('sensor.em_kookplaatl1_power')|float|abs + states('sensor.em_kookplaatl2_power')|float|abs)|round(0) }}"
      unit_of_measurement: "W"

Is there an easier way? (I have over 30 power-entities).
If this can be something dynamically that would even be better. That way I can’t forget to add a new powerplug when it is added.

Tricky:
I have sensors that end in “_power_management”
I have sensors that contain “_battery_powered”

I only want these ending in “_power”

Thanks

1 post - 1 participant

Read full topic

Viewing all 105502 articles
Browse latest View live


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