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

I can't get a template trigger to work in an automation

$
0
0

I am trying to trigger an automation off of the following template value-templates:

“{{ is_state_attr(‘fan.fanlinc_51_d1_37_fan’, ‘percentage’, 100) }}”

“{{ is_state_attr(‘fan.fanlinc_51_d1_37_fan’, ‘percentage’, 66) }}”

“{{ is_state_attr(‘fan.fanlinc_51_d1_37_fan’, ‘percentage’, 67) }}”

“{{ is_state_attr(‘fan.fanlinc_51_d1_37_fan’, ‘percentage’, 33) }}”

These are, of course, four separate triggers which would be in four separate automations, corresponding to “fan on high” for the first, “fan on medium” for the second and third, and “fan on low” for the fourth.

The problem is that the automations never trigger, even though the if I put any one of these in the template editor in developer tools, I get appropriate true or false values. Can anyone suggest what I might be doing wrong?

A related, but ultimately moot question, unless I can make some progress, is how could I combine the second and third into a single value-template that would be true for either 67 or 66. This is the "fan on medium, which sometimes returns 66 and sometimes returns 67. Some way of doing an “or” or a “between” would be useful. I am sure this is the easier of the two questions, but it’s so closely related that I thought I would put it here.

Background information:

  1. This percentage is a state attribute of an Insteon fanlinc fan entity, so this my problem may have something to do with the Insteon integration, but it seems more related to automations in general.

  2. I’ve tried triggering on the device state and adding the value-template as a condition, but the condition seems to prevent the automation from triggering, so no joy there.

Any help appreciated. Thanks.

1 post - 1 participant

Read full topic


Scrape does not retrieve data

$
0
0

Hi everyone, i’m trying to implement Wunderground into my HomeAssistant istance and i’m trying with multiscrape, since i do not have a weather station (and so i can’t get a wunderground’s API).
I have no problem with temperature and humidity, but i can’t retrieve datas such as wind, gust, rain and total rain.
(Note: since i’m in Europe i need to convert them from in to mm, if that may help)
I tried with this setup (to avoid having “unknown” when it is 0 on wunderground) and it does not work:

#--- PIOGGIA GIORNALIERA ---
      - unique_id: pioggia_oggi
        name: Pioggia Oggi
        select: "#main-page-content > div > div > div > div:nth-child(2) > div > lib-tile-current-conditions > div > div.module__body > div > div.weather__summary > div:nth-child(5) > div > div.weather__text > lib-display-unit > span > span.wu-value.wu-value-to"
        value_template: >
                {% if (value | float) == 0,00 %}
                  0
                {% else %}
                  {{ ((value | float) * (25,4) ) | round(2) }}
                {% endif %}
        unit_of_measurement: mm

So i tried with a classic scrape sensor and less template but still (even if on the website it is actually at 0.33in) it shows 0mm:

#--- PIOGGIA GIORNALIERA ---
- platform: scrape
  name: Pioggia Oggi
  resource: https://www.wunderground.com/dashboard/pws/ILEGNA6?cm_ven=localwx_pwsdash
  select: "#main-page-content > div > div > div > div:nth-child(2) > div > lib-tile-current-conditions > div > div.module__body > div > div.weather__summary > div:nth-child(5) > div > div.weather__text > lib-display-unit > span > span.wu-value.wu-value-to"
  value_template: "{{ ((value | float) * (25,4) ) | round(2) }}"
  unit_of_measurement: mm

Any ideas on how to solve?
Plus: is the template correct to show 0 when “unknown” and the value on other occasions?
Thanks in advance

1 post - 1 participant

Read full topic

Answer to where is someone command?

$
0
0

Hi everyone,

Is it possible to have my Google home respond to questions like “where is my Tesla?” I have the Tesla integration, so home assistant knows the address of where my car is. So I assume it should be possible use that together with voice to text to answer the question on my Google speakers. One complication that I envision is that I have multiple speakers, so it is not clear to me that I will be able to cast the answer to the right speaker. Ideally, i would like to do this for the car, and for my family. Has anyone done something like this? if so, could you point me in the right direction?

1 post - 1 participant

Read full topic

Supervised install - unsupported version

Use a sensor's attirbute as an attribute for a template?

$
0
0

I have the Withings integration with a smart scale, and it includes an entity for my weight in kilograms, and the “Last Updated” attribute accurately shows the date that the given weight was taken (3 days ago, in this example).

I created a template entity to convert to pounds (see below), but its “Last Updated” attribute seems to arbitrarily reset itself once or twice every day.

What do I need to add to my template so that it pulls the Last Updated date from the Withings sensor in as an attribute for the template?

Picture and template attached for reference.

Untitled

      withings_weight_lbs:
        unit_of_measurement: "lbs"
        value_template: >-
          {{
            (states('sensor.withings_weight_kg') | float(0) * 2.20462262185)
            | round(0, default=0)
          }}
        icon_template: "mdi:weight-pound"

1 post - 1 participant

Read full topic

Different on/off actions for automation with repeat until?

$
0
0

Hello, I am trying to control my water boiler through an automation.

The water boiler accepts a phone line, so I have set up a FreePBX system with an ATA. Then, homeassistant runs a shell_command to copy a call file to the /var/spool/asterisk/outgoing FreePBX dir, that causes FreePBX to call the boiler and send the DTMF tones for it to run for 30 minutes.

I also have a shell_command to turn the boiler off with the same method.

My problem is that the on state of the boiler only lasts for 30 minutes. So, I wrote up an automation to run the shell_command every 32 minutes so that it keeps the boiler running continuously. The automation gets triggered by an input_boolean.

Now, I want the input_boolean to have a dual action. If I turn it on, I want the automation to run as mentioned above, but if I turn it off, I want it to issue the boiler off shell_command. How can I do this?

Here is my configuration.yaml:


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

# Text to speech
tts:
  - platform: google_translate

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

shell_command:
  boiler_heat_on: cp /asterisk/turn_boiler_on.call /asteriskout/.
  boiler_heat_off: cp /asterisk/turn_boiler_off.call /asteriskout/.


# Example configuration.yaml entry
input_button:
  boiler_heat_off:
    name: Boiler heat OFF
  boiler_heat_on:
    name: Boiler heat ON


automation boiler off:
  trigger:
    - platform: state
      entity_id: input_button.boiler_heat_off
  action:
    - service: shell_command.boiler_heat_off

automation boiler on:
  initial_state: false
  trigger:
    - platform: state
      entity_id: input_button.boiler_heat_on
  action:
    - service: shell_command.boiler_heat_on

automation keep boiler on:
  alias: "Run Boiler Until Off"
  trigger:
    - platform: state
      entity_id: input_boolean.keep_boiler_on
  condition:
    - condition: state
      entity_id: input_boolean.keep_boiler_on
      state: "on"
  action:
    repeat:
      sequence:
        - service: shell_command.boiler_heat_on
        - delay:
            minutes: 32
      until:
        - condition: state
          entity_id: input_boolean.keep_boiler_on
          state: "off"
            

input_boolean:
  keep_boiler_on:
    name: Keep Boiler On
    initial: false

Relevant sections are: automation keep boiler on AND input_boolean

1 post - 1 participant

Read full topic

Light template for zen31 CCT CW/WW strips

$
0
0

Hi There,

Hoping someone can point me in the right direction, I’ve searched a lot, and so far haven’t found an answer.

I am intending to mount a bunch of high CRI Tunable white LED light strips in my kitchen. These are white strips, with two channels, CW and WW (cool and warm white)
I also intend to use circadian lighting on these strips.

I’m struggling to find the best way to implement these in HA.
basic RGB strips are easy, lots of controllers out there (my preferred is the zooz zen31).
addressable LED strips… WLED. done.

I dont see any built-for-purpose controllers for just white LEDs, although the zen31 does list in it’s documentation you can assign a white strip to two of it’s four channels and use it as such. okay, so that’s the plan.
(unless someone out there can point to a zwave controller built for tunable white strips!!)

The question is… how do i hook that up and get it into homeassistant so it behaves like any other color temperature lite entity (such as hue bulbs, inovelli zwave bulbs, etc) where i can just give it a K value, and it translates that to the appropriate levels on the CW and WW channels?

I think the answer is a light template, but I’m not sure where to start. the zen31 does expose all for channels separately to HA, so there should be a way to template a white light and translate that to values on two channels. Also, do i have to manually figure out the conversion from color_temp to channel level, or is that something the template can do?

OR…
using zwaveJS2mqtt, my other thought is perhaps there is a way to load a custom device driver for a zen31 to make it behave and present to HA as a white light device. (total shot in the dark here…)

1 post - 1 participant

Read full topic

HA Core + Synology + Kemp Loadbalancer + Cloudfare - 522 Error

$
0
0

Level of Personal Expertise:
Beginner

Using the following applications:

  • DSM 7+
  • HA Core through Synology Docker Container
  • Kemp LoadBalancer configured to use Content Rules to point Cloudfare URL and route traffic to SynlogyIP+HAPort
  • Cloudflare with A Record to domain I would like HA to be.

Configuration.yaml

# HTTP Settings
http:
  use_x_forwarded_for: true
  trusted_proxies: 
    - IPofSynology
    - IPofKempVM
    - NetworkGateway IP
  server_port: xxxx
  login_attempts_threshold: 5
  cors_allowed_origins:
    - IPofSynology
    - IPofKempVM

Misc Notes:
Logs are clean. Bootup takes 5 seconds and nothing in there other than startup activities finishing in ‘done’.
image

Problem:
If I enter the IP of the SynologyIP:HAPort, it works without a problem over http. However, if I type the homeassistant.mydomain.com > I get a 522.

At the Content Rule level, Kemp gives me an OK for an HTTP GET Test on IP+Port, and I can also run a GET over Postman locally with an 200.

Goal?
I want to manage and I am currently managing all my other applications through a single Virtual Server over 443. HA is the only one struggling right now, and I assume it’s due to the breath of configurations possible on this system.

Does anyone have experience with a similar configuration?

1 post - 1 participant

Read full topic


Is it safe to migrate my Zway based z-wave smoothly working hub/devices to HA?

$
0
0

Hi, I use 3 diferent and separate systems for my home automation. This looks more complicated but has shown reliable to have this kind of redundancy. The automation dedicated to “more critical” like , smoke alarm, windows and doors open detector and external metal blinds that add protecction too, all are based on z-wave managed with Zway. The lighting and some internal blinds works with another hub and type of devices and the video surveillance under a third system. There are some “bridges” bw some devices. So if I lose ligthing I still may light some lights with the z-wave system and so.

Now, In order to work on more automations I wonder to migrate the z-wave layer to HA and later the lighting one. BUT I noticed a LOT of issues with z-wave!
I guess HA is doing a good work and it is ok for a new project adding new z-wave devices…but looks like a mess to migrate an existing z-wave installation to HA.
Also many internal blinds are venetian type, I mean orientable lames and seems these are not well managed yet by HA.

I appreciate you helping me to decide if it better to wait for a better z-wave integration.
I’m based in Europe, so for instance ISY is not available and HA is one of few standalone solutions.

1 post - 1 participant

Read full topic

Confusion about how to automate state+ 2 times device to work

$
0
0

I have a state (=x) which I want when it is on a device will work at 8:00 and and 11:00,
how do I automate that?
I prefer not in yaml

1 post - 1 participant

Read full topic

External_url missing in UI

$
0
0

Issue:
External_url input box no longer shows in my UI. Internal continues to show but without a label.

Troubleshooting:

    • Confirmed my user has admin rights and advance mode is on. I’ve toggled this off and BOTH internal_url and external_url input boxes disappear. Only internal_come back when on.
  1. restarted HA and client machines
  2. Cleared all browser cache and tried chome and edge
  3. same in browser or companion app

I can see the internal_url and external_url in the config/.storage/core.config file and they look correct to me.

Current version info:

Version	core-2022.4.6
Installation Type	Home Assistant OS
Development	false
Supervisor	true
Docker	true
User	root
Virtual Environment	false
Python Version	3.9.9
Operating System Family	Linux
Operating System Version	5.10.108
CPU Architecture	x86_64
Host Operating System	Home Assistant OS 7.6
Update Channel	stable
Supervisor Version	supervisor-2022.04.0

1 post - 1 participant

Read full topic

Ideal Sciences TempStick

$
0
0

I was wondering if anyone had done any work on integrating TempStick.

1 post - 1 participant

Read full topic

How to make a washing machine smart

$
0
0

I need some help in order to smart my washing machine.
I have it plugged in on a smart-socket that reports also energy consumption.
Also I have created a sensor that reports the high tariffs (HT) and the low tariffs (LT) of my energy supplier which I use it to calculate my utility energy costs.
What I want to achieve is when the plug identifies a consumption of >10W (sensor.washing_machine_current_power >10) for more than 10 seconds, and is at the HT period, to turn off the plug ( switch.washing_machine: off ) until the LT period starts.

1 post - 1 participant

Read full topic

Bathroom fan and light with motion and humidity sensor

$
0
0

Hi
Still learning homeassistant :slight_smile:
can someone help me or guide how to make a automation that does:
Turn on light and fan when there is motion in bathroom and turn off light and after 120sec and fan after 360sec with no motion. but if the humdity is above 50% then dont turn off fan until humidity is under 50%.? :slight_smile:

thank you.

1 post - 1 participant

Read full topic

Blink & Tuya - motion activating lights

$
0
0

Hi everyone,

I am a little new to this, but I have Home Assistant connected to both Alexa and Google Assistant controlling a few smart home devices. Info about my hardware below.

Home Assistant on Raspberry Pi 4
1x USB Aeotec Z Stick 5+ (hub/controller)
1x Aeotec Z Wave extender
1x Yale Z Wave deadbolt
1x Alarm.com Z Wave thermostat
3x WiFi light switches (Treatlife brand, but they’re controlled through Tuya)
2x Echo Dot
3x Google Home Mini
3x Blink outdoor cameras
1x Blink doorbell

I’m able to control everything through HA, Alexa, or Google Assistant flawlessly. It all works great but I’m looking to do a little automation beyond what Alexa is capable of through routines.

I want one of the WiFi light switches to turn on when the Blink camera detects movement, and then automatically turn off a few minutes later. I’m able to set Alexa routines to turn on and off depending on motion, but the routine to turn off the light will run no matter what. If I have manually turned on a light and I’m actively using it, I need it to stay on which Alexa falls short there.

Can someone help guide me in the right direction please? Thank you.

1 post - 1 participant

Read full topic


Smoke Sensor Heiman HS1SA Zigbee Control/Configuration settings

$
0
0

I bought Smart Mini Smoke Sensor Heiman HS1SA for testing with Home Assistant before apply the same for all rooms.

http://www.heimantech.com/product/index.php?type=detail&id=3

This product has smoke detector and Siren together.
I have integrate it with ZHA and it is connected fine

image

There is a control entity which I assume when enabled it will turn ON the siren. but it is not working i am not sure why.

image

also there are few configuration parameters’ which can be set through ZHA but they are not making any difference when I change them. they seems to working between ZHA and the device

image

I have tried to make a test smoke, the siren start the sound. also I get notification “Detected” on the entity. but I tried to mute the sound through the configuration option and it is not working.

image

anyone have idea why the configuration options and control entities not working between ZHA and the device.

1 post - 1 participant

Read full topic

Alarm automation

$
0
0

good afternoon… I created an automation for home invasion notification.
I created a switch called “Alarme” that, when activated, will see the conditions if any motion sensor or light switch is on, to send a notification:

alias: alarme__
description: ''
trigger:
  - platform: state
    entity_id: switch.alarme_418
    to: 'on'
condition:
  - condition: or
    conditions:
      - condition: state
        entity_id: switch.1
        state: 'on'
      - condition: state
        entity_id: switch.2
        state: 'on'
      - condition: state
        entity_id: switch.3
        state: 'on'
      - condition: state
        entity_id: switch.4
        state: 'on'
      - condition: state
        entity_id: switch.5
        state: 'on'
      - condition: state
        entity_id: switch.6
        state: 'on'
      - condition: state
        entity_id: switch.7
        state: 'on'
      - condition: state
        entity_id: binary_sensor.8
        state: 'on'
action:
  - service: notify.notify
    data:
      message: xxxxxxx
      title: Alarme
mode: single

I’m not able to use the trigger as I used to in the reactor… I wanted that after the switch on, it was waiting to see if any light turned on during the entire time the Alarm switch is on

2 posts - 2 participants

Read full topic

Problem with css diferents screens

$
0
0

Hello everyone. I haven’t been able to solve this problem for a long time. Maybe someone can help me solve it. I have a button card where I am showing weather info. The problem is that I can’t get the temperature to adapt well to the size of the device. I tried it with px, en and vw but I can’t. Thank you very much

Computer Screen
1

Cellphone
2

#################################################
#                                               #
#                    CLIMA                      #
#                                               #
#################################################

clima:
  variables:
    state: >
      [[[ return entity === undefined || entity.state;]]]
    timeout: >
      [[[ return entity === undefined || Date.now() - Date.parse(entity.last_changed); ]]]
    light_color: >
      [[[ return entity === undefined ? 'var(--state-icon-color)' : 'var(--button-card-light-color-no-temperature)'; ]]]
  aspect_ratio: 1/1
  show_state: true
  show_icon: false # linea const tablet     states['switch.galaxy_tab_a_screensaver'];
  tap_action:
    ui_sound_tablet: |
      [[[      
        const tablet = 1; 
        const screensaver = states[tablet] === undefined || states[tablet].state;
        if (variables.state === 'off' && screensaver === 'off') {
          hass.callService('media_player', 'play_media', {
            entity_id: 'media_player.tab_10_pro',
            media_content_id: '/local/sound/on.m4a',
            media_content_type: 'music'
          });
        }
        if (variables.state === 'on' && screensaver === 'off') {
          hass.callService('media_player', 'play_media', {
            entity_id: 'media_player.tab_10_pro',
            media_content_id: '/local/sound/off.m4a',
            media_content_type: 'music'
          });
        }
      ]]]
    animation_card: |
      [[[
        const animation_speed_ms = 900;
        const animation = `card_bounce ${animation_speed_ms}ms cubic-bezier(0.22, 1, 0.36, 1)`;
        this.shadowRoot.getElementById("card").style.animation = animation;
        window.setTimeout(() => {
          this.shadowRoot.getElementById("card").style.animation = "none";
        }, animation_speed_ms)
      ]]]
    action: toggle
    haptic: medium
  styles:
    grid:
      - grid-template-areas: |
          "icon  icon icon"
          "icon  icon icon"
          "n     n    temperature"
          "s     s    temperature"
      - grid-template-columns: repeat(3, 1fr)
      - grid-template-rows: auto repeat(3, min-content)
      - align-items: start
    name:
      - justify-self: start
      - line-height: 100%
    state:
      - justify-self: start
      - line-height: 100%
    card:
      - font-family: Sf Text
      - border-radius: var(--custom-button-card-border-radius)
      - -webkit-tap-highlight-color: rgba(0,0,0,0)
      - transition: none
      - padding: 10% 10% 6% 10%
      - --mdc-ripple-color: >
          [[[
            return 'rgba(255, 255, 255, 0.3)';
          ]]]
      - color: >
          [[[
            return 'rgba(255, 255, 255, 0.3)';
          ]]]
    custom_fields:
      temperature: [letter-spacing: 0.03vw, font-size: 2vw]
  extra_styles: |
    #temperature {
      font-size: 1vw;
      letter-spacing: 0.05vw;
    }
    /* portrait */
    @media screen and (max-width: 1200px) {
      #temperature {
        font-size: 5vw;
        letter-spacing: 0.05vw;
      }
    } 
    /* phone */
    @media screen and (max-width: 800px) {
      #temperature {
        font-size: 20px,
        letter-spacing: 0.03vw,
      }
    }
  custom_fields:
    temperature: >
      [[[
        const temp = entity.attributes.temperature 
        return `${temp}°`
      ]]]
    icon: >
      [[[
        const hoy = new Date();
        var hora = hoy.getHours() + ':' + hoy.getMinutes()
        if (variables.state === 'cloudy')     
          if (states['sun.sun'].state === "above_horizon")
            return '<img src="/local/img/forecast/mostly_sunny_light_color_96dp.png">'; 
          else
            return '<img src="/local/img/forecast/mostly_clear_night_light_color_96dp.png">'; 
        else if (variables.state === 'sunny')     
          return '<img src="/local/img/forecast/sunny_light_color_96dp.png">'; 
        else if (variables.state === 'clear-night')     
          return '<img src="/local/img/forecast/clear_night_dark_color_96dp.png">'; 
        else if (variables.state === 'rainy')     
          return '<img src="/local/img/forecast/showers_rain_light_color_96dp.png">'; 
        else if (variables.state === 'partlycloudy')     
          if (states['sun.sun'].state === "above_horizon")    
            return '<img src="/local/img/forecast/partly_cloudy_light_color_96dp.png">'; 
          else
            return '<img src="/local/img/forecast/partly_cloudy_night_light_color_96dp.png">'; 
        else if (variables.state === 'lightning-rainy')     
          if (states['sun.sun'].state === "above_horizon")      
            return '<img src="/local/img/forecast/scattered_showers_day_dark_color_96dp.png">'; 
          else
            return '<img src="/local/img/forecast/scattered_showers_night_dark_color_96dp.png">'; 
        else if (variables.state === 'lightning')     
          return '<img src="/local/img/forecast/isolated_scattered_tstorms_day_dark_color_96dp.png">'; 
        else if (variables.state === 'pouring')     
          return '<img src="/local/img/forecast/heavy_rain_dark_color_96dp.png">'; 
        else if (variables.state === 'snowy')     
          return '<img src="/local/img/forecast/snow_showers_snow_dark_color_96dp.png">'; 
        else if (variables.state === 'snowy-rainy')     
          return '<img src="/local/img/forecast/wintry_mix_rain_snow_dark_color_96dp.png">'; 
        else if (variables.state === 'fog')     
          return '<img src="/local/img/forecast/haze_fog_dust_smoke_dark_color_96dp.png">'; 
        else if (variables.state === 'exceptional')
          return ''; 
        else 
          return variables.state; 
      ]]]

1 post - 1 participant

Read full topic

Blink & Tuya - Help with Motion Activating Light Switches

$
0
0

Hi everyone,

I am a little new to this, but I finally got my entire system running properly. I’m struggling with automation though.

Home Assistant on Raspberry Pi 4
1x USB Aeotec Z Stick 5+ (hub/controller)
1x Aeotec Z Wave extender
1x Yale Z Wave deadbolt
1x Alarm.com Z Wave thermostat
3x WiFi light switches (Treatlife brand, but they’re controlled through Tuya)
2x Echo Dot (via HA Cloud)
3x Google Home Mini (via HA Cloud)
3x Blink outdoor cameras
1x Blink doorbell

My Blink cameras have a motion sensor in them that triggers recording. Home Assistant sees this motion sensor as ‘binary_sensor.blink_cameraname_motion_detected’. I have WiFi light switches (seen as ‘switch.switchname_switch_1’ in HA) that I want to be turned on when certain cameras sense movement. Which that in itself does work. I need to do 2 more things with it though. I need to specify how long the light will remain on and I need it to be conditional based on whether the light was already on or not. The automation should only run if the light switch is off.

Alexa has routines but I can’t make it conditional based on whether the light is already on or not. Can anyone point me in the right direction?

1 post - 1 participant

Read full topic

Simple light automation

$
0
0

Hi
I got caught up in the Insteon debacle. I installed HA and I’m watching a lot of tutorials and trying to learn how to use it. All of my Insteon light switches were recognized by the system. Now I am trying to set up a simple automation of having one light turn on at a certain time. For some reason it is not working. Here are the automation settings I am using.
Trigger type - Fixed Time
Conditions - None
Action type - Call Service
Service - light.turn_on
Target - One of the Insteon switches
When the fixed time I set passes, the light does not turn on. However when I click run actions, the target light turns on. What am I doing wrong?
Thank you in advance for any assistance.

3 posts - 3 participants

Read full topic

Viewing all 99600 articles
Browse latest View live


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