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

How to get a percentage with Value_Template?

$
0
0

@jriker1 wrote:

I have the below.

- platform: snmp
  name: Dell 2130CN Cyan
  host: 192.168.0.4
  baseoid: 1.3.6.1.2.1.43.11.1.1.9.1.1
  accept_errors: true
  scan_interval: 86400
  unit_of_measurement: '%'

So this shows how many pages are left that it can print for each color. Which doesn’t make sense to me as each page isn’t only printing one color. I just want to know the percent of each color left. So assumption is when it’s full there is 2500 sheets it can print. So I was thinking divide how many pages the above oid returns by 2500 and multiply it by 100. Without a value_template I get 2500 for one I just replaced. But when I try value templates it just gives me a dash.

Any help would be appreciated.

Posts: 10

Participants: 3

Read full topic


Sensi Smartthings Integration not working?

$
0
0

@nanobra1n wrote:

Coming from Wink, I now use the Smarthings integration to pull Sensi thermostat data into HA. However it doesn’t seem to be working right as none of the states (temperature, humidity, hvac_action,
etc) are being updated. I can increase the setpoint and that gets delivered to the thermostat, but the other way doesn’t seem to be working.

I removed and re-added the smarthings integration several times with no effect. I do notice however that in the smartthing integration the Sensi device is not turned on. (that switch seems new, I can’t remember seeing it before) . Even turning it on does’t seem to help.

Anyone else seeing this or has an idea how to get the Sensi thermostat to report actual data?

Posts: 1

Participants: 1

Read full topic

How Can I Make Google Recognize "Turn off the first floor lights" Without Screwing Everything Else Up?

$
0
0

@mankyd wrote:

The scenario:

  • I have a multi-story home.
  • I have a few rooms on my first floor each with their own switch.
  • I have 4 Google devices grouped as “First Floor”.
  • Switches, Google devices, and other misc. are linked to Google Assistant and organized into rooms.

Desired Outcome:

  • Be able to say “play music on the first floor”
  • Be able to say “turn on/off the lights on the first floor”
  • Be able to say “turn on/off the lights in the [room name]”

What I’ve tried:
I tried grouping all my light switches into a group called “first floor” in Home Assistant, but that broke my ability to play music on the first floor.

Extra bonus points:
It would be great if I could say “turn on the lights on the first floor”, and it would leave the first floor bathroom lights and outdoor lights in their current state (on or off), but when I tell it to turn off the first floor lights, it turned them off.

Posts: 8

Participants: 5

Read full topic

Ghost interrupt of rf433 switches triggers turn_off in homeassistant

$
0
0

@Felix8806 wrote:

Hello all,

I have configured a multisensor containing also an RF433 emitter receiver. This box is configured to manage a cover in the kitchen.

From time to time, about twice a day, the entire box disconnects from the WIFI without any understandable reason, for less than a minute, then reconnects.
The log in Homeasssistant looks like this:

-----------------------------------
3:29 PM [RF433 module compilation Version](http://10.0.0.120:8123/logbook#) changed to 1.13.6 Jan 11 2020, 23:39:25

**3:29 PM[plugAllswitch](http://10.0.0.120:8123/logbook#) turned off**

**3:29 PM[plugDswitch](http://10.0.0.120:8123/logbook#) turned off**

**3:29 PM[plugCswitch](http://10.0.0.120:8123/logbook#) turned off**

**3:29 PM[plugBswitch](http://10.0.0.120:8123/logbook#) turned off**

**3:29 PM[plugAswitch](http://10.0.0.120:8123/logbook#) turned off**

3:29 PM[RF433 module Restart](http://10.0.0.120:8123/logbook#) turned off

3:29 PM[Blinds_Stop](http://10.0.0.120:8123/logbook#) turned off

3:29 PM[Blinds_Up_Full](http://10.0.0.120:8123/logbook#) turned off

3:29 PM[Blinds_Down_Full](http://10.0.0.120:8123/logbook#) turned off

3:29 PM[Kitchen Cover reset up](http://10.0.0.120:8123/logbook#) turned off

3:29 PM[Kitchen Cover reset down](http://10.0.0.120:8123/logbook#) turned off

3:29 PM [kitchen blinds Controller](http://10.0.0.120:8123/logbook#) changed to open

3:29 PM [D1mini RF433 Box Status 107](http://10.0.0.120:8123/logbook#) is connected

3:29 PM [plugCswitch](http://10.0.0.120:8123/logbook#) changed to unavailable

3:29 PM [Kitchen Cover reset up](http://10.0.0.120:8123/logbook#) changed to unavailable

3:29 PM [Blinds_Stop](http://10.0.0.120:8123/logbook#) changed to unavailable

3:29 PM [plugBswitch](http://10.0.0.120:8123/logbook#) changed to unavailable

3:29 PM [Kitchen Cover reset down](http://10.0.0.120:8123/logbook#) changed to unavailable

3:29 PM [Blinds_Up_Full](http://10.0.0.120:8123/logbook#) changed to unavailable

3:29 PM [plugAllswitch](http://10.0.0.120:8123/logbook#) changed to unavailable

3:29 PM [plugAswitch](http://10.0.0.120:8123/logbook#) changed to unavailable

3:29 PM [Blinds_Down_Full](http://10.0.0.120:8123/logbook#) changed to unavailable

3:29 PM [plugDswitch](http://10.0.0.120:8123/logbook#) changed to unavailable

3:29 PM [RF433 module Restart](http://10.0.0.120:8123/logbook#) changed to unavailable

3:29 PM [D1mini RF433 Box Status 107](http://10.0.0.120:8123/logbook#) is disconnected

3:29 PM [kitchen blinds Controller](http://10.0.0.120:8123/logbook#) changed to unavailable
----------------------------------------------------

As can be seen on the log, the entire list of switches and status goes to unavailable for a few seconds, and then back to available.
The problem is that when coming back online, all switches are set to OFF and send the 433 MHZ signal for going off, and dont come back on.

The esphome switches are programmed under ESPHOME as such:

esphome:
  name: basic_rf433_plugs
  platform: ESP8266
  board: d1_mini

substitutions: 
  time_kitchen_blinds_down: 35s
  time_kitchen_blinds_up: 38s
  name: "D1mini RF433 Box"
  name_lowercase: "Kitchen RF433 box"
  reference: "107"
  interval: 120s
  
debug:

logger:
#  level: debug
  
ota:

wifi:
  networks:
    - ssid: "RFHA"
      password: "PASSWORD"

    - ssid: "RFHA2"
      password: "PASSWORD"

  manual_ip:
    static_ip: 10.0.0.107
    subnet: 255.255.255.0
    gateway: 10.0.0.138
    dns1: 8.8.8.8 
    dns2: 8.8.4.4
 
# Enable Home Assistant API
api:
  reboot_timeout: 0s

sensor:
  - platform: uptime
    name: Uptime of RF433 module
    update_interval: 120s
  - platform: wifi_signal
    name: ${name} Wifi Signal
    update_interval: ${interval}

switch:
### PLUG A #####
  - platform: template
    name: plugA_Start
    internal: true
    id: plugA_Start
    restore_state: true
    turn_on_action:
      - remote_transmitter.transmit_rc_switch_raw:
          code: '000010101001000100110000'
          protocol: 3
          repeat: 20

  - platform: template
    name: plugA_Stop
    id: plugA_Stop
    restore_state: true
    internal: true
    turn_on_action:
      - remote_transmitter.transmit_rc_switch_raw:
          code: '000001111111010010010000'
          protocol: 3
          repeat: 20

 - platform: template
    name: plugAswitch
    id: plugAswitch
    restore_state: true
    optimistic: true
    lambda: |-
      if (id(plugA_Start).state) {
        // plug A is ON
        return true;
      } else if (id(plugA_Stop).state) {
        // plugA is OFF
        return false;
      } else {
        return {};
      }
    turn_on_action:
      - switch.turn_on: plugA_Start
    turn_off_action:
      - switch.turn_on: plugA_Stop

My question: does anyone know how to avoid that the switches, when coming back on available status, would be set to off in homeassistant?

Any help is really appreciated, as I spent already a long time searching for the answer in vain.

Posts: 1

Participants: 1

Read full topic

Simple Grammar Language (HGL) to reduce some reptitiveness

$
0
0

@gjbadros wrote:

Not sure if it’s general enough to be of use to others, but I built a little grammar-based language for specifying parts of my YAML configuration. The below github repository contains my tool – hass-hgl-to-yaml.py – which converts from a file containing “Hass Grammar Language” (HGL) into the YAML that homeassistant understands natively. This allows me to write various concise automation rules in a more concise and natural way. E.g.,

when {pantry,kitchen}_ir is Normal for 3 minutes do turn_off(light.mh_m_*)

It also makes for easier mapping of MQTT messages to actions:

when EH_media_{pause,play,play_pause,volume_up,volume_down,channel_down} do media_player.media_*(entry_hall)

and paired behaviors keyed off of the time of day:

sunrise ... solar_noon -01:00:00
  with cover.mh_m_great_room_upper_east
    start when sunny:
      cover.close_cover
    end:
      cover.open_cover

The script is here: https://github.com/gjbadros/hass-hgl-to-yaml

YMMV: I’m not trying to replace YAML and believe that YAML is a great choice for what Home Assistant is trying to do – I’m just trying to capture some highly repetitive patterns on my YAML because of the volume of devices I have and the automations needed to support them.

Posts: 1

Participants: 1

Read full topic

Stumped by Template Binary Sensor! Looking for guidance

$
0
0

@Zoriontsu wrote:

I have many fairly complex binary sensors working without a hitch, but this on is really aggravating me, as I cannot make it work.
I am trying to create a binary sensor that will turn on if there is a Google Calendar event within 30 minutes.

The following template works perfectly in the Development Tools Template Editor:

`{{ (((as_timestamp(states.calendar.home.attributes.start_time) - as_timestamp(now())) / 60) | int) <= 30 and (((as_timestamp(states.calendar.home.attributes.start_time) - as_timestamp(now())) / 60) | int) > 0 }}`

But… If used in my binary sensor, the sensor never changes:

  - platform: template
      joint_calendar_event_within_30_minutes:
        friendly_name: 'Joint Calendar Event Within 30 Minutes'
        value_template: "{{ (((as_timestamp(states.calendar.home.attributes.start_time) - as_timestamp(now())) / 60) | int) <= 30 and (((as_timestamp(states.calendar.home.attributes.start_time) - as_timestamp(now())) / 60) | int) > 0 }}"

I have tried several variations such as:

      joint_calendar_event_within_30_minutes:
        friendly_name: 'Joint Calendar Event Within 30 Minutes'
        value_template: >-
          {{ (((as_timestamp(states.calendar.home.attributes.start_time) - as_timestamp(now())) / 60) | int) <= 30 and (((as_timestamp(states.calendar.home.attributes.start_time) - as_timestamp(now())) / 60) | int) > 0 }}

Thanks in advance.

Posts: 6

Participants: 4

Read full topic

HACS BOM Weather Card Help

Moving between configuration via YAML and integrations via UI

$
0
0

@TazUk wrote:

I’ve been trying to use the front-end for new integrations where possible since introduced, however for some reason I went completely off-piste a few nights ago and added a new TP-Link integration via an entry in m configuration.yaml.
The TP-Link strip I configured is working as expected and shows up in the integrations list, however having realised my mistake this evening I’m forced to ask what may be a stupid question:

If I remove the TPLink from the configuration.yaml will the integration be kept, or will I have to recreate it?

I ask because I’ve spent two hours reworking my Google-synced entities to remove duplicated and zombie devices - I’d rather not wind up with some duplicates again.

Posts: 3

Participants: 2

Read full topic


Spotify configuration reopens home assistant

$
0
0

@chaddy1701 wrote:

Having some real pain with Spotify, I don’t think I am alone with that!

I am trying to configure the Spotify Media player.

I have created an APP, and added the following to my configuration.yaml

http:
  base_url: http://hassio.local:8123/lovelace/default_view


media_player:
  - platform: spotify
    client_id: !secret spotifyID
    client_secret: !secret spotifysecret

I’ve set the redirect…
image

Restart HA (latest hassio version), I get the notification.
Click the ‘link spotify account’ and then a new tab opens with Home assistant.

The last record in my log for Spotify is:
‘(SyncWorker_18) [homeassistant.components.spotify.media_player] no token; requesting authorization’

This is driving me crazy…

Posts: 1

Participants: 1

Read full topic

Pi RF 433mhz elro socket

$
0
0

@Parschulke wrote:

Hello,
I need help in configuration of my elro socket in the pi rf platform.

The socket has a 10 pole dip switch.
How can I configure the code_on and code_off sequence?
If I type the code 11111,11111 it is not working.

My configuration is
switch :

  • platform : rpi_rf
    gpio : 17
    switches :
    bedroom_light :
    protocol : 1
    code_on : 11111,10000
    code_off : 11111,10000

I do not have a 433 receiver only a sender, so I hope somebody has some tipps to get it work.

Posts: 1

Participants: 1

Read full topic

How to translate snmp value with value_template

$
0
0

@jriker1 wrote:

I have a result that comes in from SNMP

iso.3.6.1.2.1.25.3.5.1.2.1 = Hex-STRING: 00

with platform: snmp

When I try:

value_template: “{%if value == ‘0’ %}OK{% else %}Failed{% endif %}”

or

value_template: “{%if value == ‘00’ %}OK{% else %}Failed{% endif %}”

It returns Failed any idea what I’m doing wrong?

Posts: 2

Participants: 2

Read full topic

Help power on/off Xbox One

$
0
0

@stevchik wrote:

Looking for assistance to use Xbone One component to power on/off XBox One device.

Here is what I have done so far:

  1. Install XBone One component from https://github.com/ericleb010/hassio-addons
  2. Used http://hassio.local:5557/auth/login to authenticate
  3. Used http://hassio.local:5557/device to get device id
  4. Added Configuration for xbox one component in configurator.yaml:
media_player:
 - platform: xboxone
   device: 'XXXXXXXXXXX' (used real device id here)
   name: 'Family Room Xbox One'
  1. Restarted Hass.IO
  2. Checked logs to make sure connection is successful:
127.0.0.1 - - [2020-01-24 20:58:31] "GET /device/XXXXXXXXXXXXXXXX/media_status HTTP/1.1" 200 145 0.002098
[2020-01-24 20:58:31,951] DEBUG in protocol: Received DiscoverResponse from 192.168.1.30
  1. I can power XBox on and off using Media Player UI controller.

I am running into issues setting up automation to power XBox on/off :

  1. Can not power xbox off using media_player.turn_off service. Is this correct service to use to power it off? Should I used another service?

  2. If xbox is not on, I can not use media_player.turn_on service to power it back on. Again, is there a different service I should use?

Any ideas are appreciated!

Thank you

Posts: 1

Participants: 1

Read full topic

Nodes working, but not showing up in config?

$
0
0

@eeze2 wrote:

Not sure what happened, but in the z-wave configuraiton, only 3 of my nodes are listed, yet they work on the main lovelave page (open/close door sensor)

Prior to installing the z-wave graph I noticed this. Installed the z-wave graph anyways (having just tested an open/close sensor) and the graph shows only a few sesnsors despite there being 20 of them

Posts: 2

Participants: 1

Read full topic

Actron Air Conditioner add-on

How do I add a Node-Red shortcut to sidebar?

$
0
0

@afe wrote:

I want to add a shortcut to my sidebar that opens Node-Red to save some clicks (Hass.io -> Dashboard -> Node-Red -> Open Web UI )

I dont want to use a iframe_panel because single sign-on wont work then and I think there has to be an easier way to just add a link.
I tried the following but unfortunately this doesn’t work either:

panel_custom:
  - name: nodered
    sidebar_title: "Node-Red"
    sidebar_icon: mdi:sitemap
    url_path: /hassio/ingress/a0d7b954_nodered

Posts: 4

Participants: 2

Read full topic


HA 0.104.3 automation GUI goes banans

$
0
0

@Viking wrote:

After updating HA to 0.104.3 i experience that the automation GUI goes completely bananas if you try to use the Name(s) of Entities to turn on pull down list, when the number of items in the list result in a vertical scroll bar. Scrolling down beyond the end of the list fails, and the scroll bar stars to jump around by itself like crazy. Entities outside the first (upper) part of the list cannot be picked. You have to type the entity name manually.
Also, there does not seem to be possible to pick more than a single entity, even though the field name suggests that multiple entities should be possible to add (Name(s) of Entities to turn on). Attempts to add another name deletes the first name already entered. Not even trying to type a list of names, work. At least not with any delimiter I’ve tried (comma, semicolon, with space, without space, etc. etc.). As soon as you type the second entity name, the first one entered is deleted.

Posts: 1

Participants: 1

Read full topic

Switching the device on and off with one RF code(RF Bridge)

$
0
0

@arek156 wrote:

Hi
I have one binary switch rf 433, it sends only one code. Is it possible to set the automation so that if the device is turned off and the button is pressed, the device is turned on, while if it is turned on and the button is pressed again, it is turned off?

 - platform: mqtt
    name: "RF switch"
    state_topic: "tasmotaRF/tele/RESULT"
    value_template: '{{value_json.RfReceived.Data}}'
    payload_on: "582AB8" ## only one code##
    device_class: plug
    qos: 1 

Posts: 2

Participants: 2

Read full topic

broadlink/__init__.py (ERROR)

$
0
0

@toze1619 wrote:

hello, i’m a new guy in home assistant, i have trying to integrat broadlink devices in my account with no sucess.
I have the fowling error:

Failed to connect to device
components/broadlink/init.py (ERROR)

my config’s en config.yaml file are:

switch:
  - platform: broadlink
    host: 192.168.1.xxx
    mac: '24:FF:AA:FF:EE:CC'(imaginary mac)

when i call broadlink.learn give me the error that i post, can anyone help me with this?
thk in advance for your time…

Posts: 1

Participants: 1

Read full topic

Cert_expiry work?

$
0
0

@jriker1 wrote:

I just added cert_expiry and a couple of my sites but after reboot lots of log errors:

2020-01-25 11:47:53 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 109, in async_init
    result = await self._async_handle_step(flow, flow.init_step, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 172, in _async_handle_step
    result: Dict = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/components/cert_expiry/config_flow.py", line 116, in async_step_import
    return await self.async_step_user(user_input)
  File "/usr/src/homeassistant/homeassistant/components/cert_expiry/config_flow.py", line 79, in async_step_user
    if await self._test_connection(user_input):
  File "/usr/src/homeassistant/homeassistant/components/cert_expiry/config_flow.py", line 50, in _test_connection
    get_cert, host, user_input.get(CONF_PORT, DEFAULT_PORT)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/cert_expiry/helper.py", line 12, in get_cert
    with socket.create_connection(address, timeout=TIMEOUT) as sock:
  File "/usr/local/lib/python3.7/socket.py", line 728, in create_connection
    raise err
  File "/usr/local/lib/python3.7/socket.py", line 716, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
2020-01-25 11:47:53 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/cert_expiry/config_flow.py", line 50, in _test_connection
    get_cert, host, user_input.get(CONF_PORT, DEFAULT_PORT)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/cert_expiry/helper.py", line 13, in get_cert
    with ctx.wrap_socket(sock, server_hostname=address[0]) as ssock:
  File "/usr/local/lib/python3.7/ssl.py", line 423, in wrap_socket
    session=session
  File "/usr/local/lib/python3.7/ssl.py", line 870, in _create
    self.do_handshake()
  File "/usr/local/lib/python3.7/ssl.py", line 1139, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 109, in async_init
    result = await self._async_handle_step(flow, flow.init_step, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 172, in _async_handle_step
    result: Dict = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/components/cert_expiry/config_flow.py", line 116, in async_step_import
    return await self.async_step_user(user_input)
  File "/usr/src/homeassistant/homeassistant/components/cert_expiry/config_flow.py", line 79, in async_step_user
    if await self._test_connection(user_input):
  File "/usr/src/homeassistant/homeassistant/components/cert_expiry/config_flow.py", line 60, in _test_connection
    if "doesn't match" in err.args[0]:

Don’t really want to share my URL’s so not sure it’s value add but my sensor_ssl.yaml file:

- platform: cert_expiry
  name: Smart Home Cert
  host: <address for HA>
  port: 8123

- platform: cert_expiry
  name: Home Server Cert
  host: <address for a remote access server>
  port: 443

for both of the above it’s just the server address, no https or anything.

And note these are GoDaddy certs not like DuckDNS or whatever.

Posts: 16

Participants: 3

Read full topic

Automation Nested Actions

$
0
0

@Rajman1138 wrote:

So I have 2 Door sensors (Deck and Garage) that report Open and Closed and a Color Changing Smart Bulb (Light1) all setup already in Hassio and wanted to setup some Automatons to indicate the Door states

What I want to do is
Triggers: IF Deck or Garage Door set (change state) to OPEN
IF Deck AND Garage Door = Open Then >Light1 on Blue
ElseIF Deck = Open AND Garage = Closed Then >Light1 on Green
ElseIF Garage = Open AND Deck = Closed Then >Light1 on Red

Is there a way to do this with One automation or would I have to create three one for each of the Color States with the Trigger and Conditionals set up accordingly in them?

Posts: 7

Participants: 2

Read full topic

Viewing all 105470 articles
Browse latest View live


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