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

Calculate negative offset for sunset

$
0
0

@Claton wrote:

Hi all,

I currently have a -45 minute offset before sunset for turning lights on. I would like to calculate that offset by using “sensor.owm_cloud_coverage” which returns 0 - 100 representing the percentage of cloud cover.

Can you put a calculation in the offset field and if so how do you format it? Calculation something like “-30 + (- sensor.owm_cloud_coverage/ 4)”. This would create a -55 minute offset at 100% cloud coverage and -30 at 0% coverage.

Thanks for reading this and helping out.
Clay

Posts: 1

Participants: 1

Read full topic


Command line sensor problem - multiple JSON sub-attributes?

$
0
0

@mmiller7 wrote:

I’m trying to make a sensor for monitoring internet speed using the official speedtest.net CLI application which can return JSON output.

Here’s an example of the output:
{"type":"result","timestamp":"2020-04-12T02:44:43Z","ping":{"jitter":0.58499999999999996,"latency":13.332000000000001},"download":{"bandwidth":115760816,"bytes":1209207888,"elapsed":10613},"upload":{"bandwidth":6509554,"bytes":23564752,"elapsed":3615},"packetLoss":0,"isp":"Atlantic Broadband","interface":{"internalIp":"192.168.1.221","name":"enp0s10","macAddr":"xxxxxxxxxx","isVpn":false,"externalIp":"x.x.x.x"},"server":{"id":14335,"name":"PBW Communications, LLC","location":"Herndon, VA","country":"United States","host":"speedtest.leadmon.net","port":8080,"ip":"38.103.8.130"},"result":{"id":"xxxxxxxxxxxxx","url":"https://www.speedtest.net/result/c/xxxxxxxxxxxxxxxxxxxx"}}

I’ve made a sensor which partially works, but doesn’t give me the key bits I really want:

sensor:
  - platform: command_line
    name: "Speedtest.net"
    #command: "/config/speedtest-net/speedtest --accept-license --format=json > /config/debug.txt 2>&1"
    command: "/config/speedtest-net/speedtest --accept-license --format=json"
    scan_interval: 3600
    command_timeout: 60
    json_attributes:
      - ping.jitter
      - ping.latency
      - download.bandwidth
      - upload.bandwidth
      - packetLoss
      - isp
      - name
      - location
      - country
      - url
    value_template: "{{ value_json['download.bandwidth'] }} / {{ value_json['upload.bandwidth'] }}"

When I look at it, I don’t see the download/upload speeds (which are the important bits).

First, how do I get it populating the rest of the values?

Second, how do I do the conversion from bytes/sec to Mbit/sec (I need to take the reported bandwidth X*8/1000000)

Posts: 1

Participants: 1

Read full topic

Really messed up

$
0
0

@gilestyle wrote:

so i had home assistant setup and it was working. then really messed stuff up without backup. so i did a new install on another sd card stuck it in raspberry pi 4. everything was working good. went to add my lutron smartbridge and now it wont discover it. it discovered it the first time, on the first sd card. any ideas what else could be messed up?

Posts: 1

Participants: 1

Read full topic

MQTT Message history displayed in lovelace

$
0
0

@VinistoisR wrote:

I have an MQTT integration:

  - platform: mqtt
    name: sip2mqtt
    state_topic: "home/sip"
    value_template: '{{ value_json.verb }}'
    json_attributes_topic: "home/sip"
    
  - platform: mqtt
    name: "SIP callid"
    state_topic: "home/sip"
    value_template: '{{ value_json.caller }}'

And it shows like this in lovelace:

When a new MQTT message comes in, the word “disconnected” changes to “incoming”, and the CallerID shows the data I’m interested in. Perfect.

The issue is it only flashes the message for 1/2 second, and then the MQTT message goes back to “disconnected” and the callerID is blank. I can’t make it stay around longer… its just the nature of it (we have to answer the call eventually, and when we do, the system drops the connection that drives the mqtt script)

What I really want is a list of the 10 most recent callers, the most frequent caller today, etc. I assume I can just poll the history, go to the last time the state changed, and display the data. But I have no clue how to implement that!

Thanks!

Posts: 2

Participants: 2

Read full topic

Repeating Timers

$
0
0

@currest2620 wrote:

Hi, happy easter everyone.

I’d like to setup a repeating timer. Say to turn on a switch every hour for 15 minutes. I’ve read the time integration, but I’m not sure I understand how it works [actually a better way to say it is: I’m sure I don’t understand how it works!].

I’d like to set a timer that switches on, on the hour, stay on for 15 minutes and then switch off and repeat.

Can anyone suggest how this might be achieved? It’s probably pretty simple to do, but I’m just not getting it.

Posts: 3

Participants: 2

Read full topic

Virtual Devices

$
0
0

@remark wrote:

Question from the beginner.
Do not ask me why this is necessary.
Is it possible to make the main devices in HA (lights, switches, sensors, etc.) virtual, and then just connect physical ones to them?
For example, to quickly replace devices, without overwriting automation, without losing history, etc.

Posts: 2

Participants: 2

Read full topic

No Lovelace Raw Editor, no lovelace file

$
0
0

@GordonGekko wrote:

I only recently switched from the old states version to lovelace (more accurately: I did nothing until states didn’t work anymore and the lovelace site didn’t show anything automatically :stuck_out_tongue_winking_eye:) but lovelace only works in manual mode. When I delete the „mode: yaml“–line in config.yaml and the ui–lovelace.yaml file and restart, I don‘t get the 3 dots on the right to start the raw editor or de ui editor. When I change back to manual mode then I get the menu (but can, of course, not start the ui editor). Any Ideas? By the way: I don‘t have (or am unable to find) the file config/.storage/lovelace (only some other files are there). Any ideas? Thanx alot!

Posts: 2

Participants: 2

Read full topic

Strange recurring error in the log

$
0
0

@MichaelR wrote:

Hello everybody,

I have had this ominous recurring error in my log for some time now:

2020-04-11 06:32:53 INFO (MainThread) [root] AFSAPI Exception: Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/afsapi/__init__.py", line 101, in call
    self.__webfsapi = yield from self.get_fsapi_endpoint()
  File "/usr/local/lib/python3.7/site-packages/afsapi/__init__.py", line 81, in get_fsapi_endpoint
    endpoint = yield from self.__session.get(self.fsapi_device_url, timeout = self.timeout)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 582, in _request
    break
  File "/usr/local/lib/python3.7/site-packages/aiohttp/helpers.py", line 586, in __exit__
    raise asyncio.TimeoutError from None
concurrent.futures._base.TimeoutError

Current version is 0.108.3, Hassio on Debian Buster. The bug has been gliding with me for some releases.

Does anyone have any idea where it could come from? I am at a loss …

Best wishes
Michael

Posts: 1

Participants: 1

Read full topic


Emulated_hue breaking changes in 0.108

$
0
0

@sebk-666 wrote:

Hi,

my emulated_hue config broke with 0.108 and I can’t figure out what’s still wrong with it:
So my basic config looks like this:

emulated_hue:
  advertise_ip: 192.168.10.8
  upnp_bind_multicast: true
  host_ip: 192.168.10.8
  listen_port: 80
  advertise_port: 80
  expose_by_default: false
  exposed_domains:
    - input_boolean
    - script
    - switch

For entities customizations, I replaced all the emulated_hue_hidden: keys with hidden:, e.g. (in customize.yaml):

switch.thinkpad:
  friendly_name: Thinkpad
  hidden: false
  icon: mdi:laptop-windows

I get no errors verifying the config, but still after restarting HA, a curl http://192.168.10.8:80/api/pi/lights returns only an empty pair of braces.

What am I missing?

Sebastian

Posts: 1

Participants: 1

Read full topic

Frontend.set_theme

$
0
0

@poudenes wrote:

Hi All,

I made a automation for changing theme based on sun. But its not working.
When I do it in developer tool Its only change the page where I do the action.
My tablet (also other user) stay the same. How can I do this action?

Oh and I use a different Lovelace for tablet as well, can this be the problem?

In version 0.106.x it was working, I disabled it for a while. in 0.108.x its not working anymore.

###########################################################################################
#
# SYSTEM CHANGE THEME BASED ON SUN IS BELOW OR ABOVE HORIZON
#
###########################################################################################

- alias: "System - Automatic Theme Change Sunset"
  trigger:

    - platform: homeassistant
      event: start

    - platform: state
      entity_id: sun.sun

  action:
    service_template: frontend.set_theme
    data_template:
      name: "{{ 'default' if is_state('sun.sun', 'above_horizon') else 'peternight' }}"

Posts: 1

Participants: 1

Read full topic

Light Group - one on, group state is on

$
0
0

@baz123 wrote:

The current implementation of the Light Group means that when one light in the group is turned on, the group state changes to on. The only way to turn on the rest of the group, is to turn the group off and on again. This is very annoying.

Could an option be added to control this behaviour? i.e. an option to control if not all the lights in the group are on, whether the group shows on or off (would make the change no-breaking). Set state to ‘partial’.

A second option might be an option such that if not all the lights are on, switching the group could either turn them all on, or those on, off.

Finally, an option to set the icon based on the state of ‘partial’ (will probably come with the additional state).

Meantime, I need to work out an automation to control a tri-state entity :grin:.

Posts: 1

Participants: 1

Read full topic

SSH stopped working after upgrade to 108

$
0
0

@dkagedal wrote:

I upgraded to 108 recently, and now I tried to connect over SSH and it is failing:

ssh: connect to host hassio.local port 22: Connection refused

HA is up and working, and I can get a terminal from the web UI, etc, and the SSH add-on is still there. But when i look at its configuration, it looks odd:

Skärmavbild 2020-04-12 kl. 10.52.15

Clicking Reset to defautls doesn’t seem to make any difference.

Posts: 1

Participants: 1

Read full topic

Run Python Script in Automation

$
0
0

@SuperMaximus wrote:

Can’t make the appropriate switch to run in Automation depending on the state of some sensors.
Following examples from Community forum, made below config in configuration.yaml:

  - platform: command_line
    switches:
    intercom:
    swimpool_on: "python3 /config/python_scripts/swimpool1.py"
    swimpool_off: "python3 /config/python_scripts/swimpool2.py"

and getting as a result:

* Invalid config for [notify.command_line]: required key not provided @ data['command']. Got None. (See ?, line ?).
* Invalid config for [sensor.template]: [switches] is an invalid option for [sensor.template]. Check: sensor.template->switches. (See ?, line ?).
* Invalid config for [sensor.command_line]: [switches] is an invalid option for [sensor.command_line]. Check: sensor.command_line->switches. (See ?, line ?).
* Error loading /config/configuration.yaml: mapping values are not allowed here in "/config/configuration.yaml", line 268, column 16
* Invalid config for [switch.command_line]: [name] is an invalid option for [switch.command_line]. Check: switch.command_line->name. (See ?, line ?).

I have python_scripts normally working for sensors from “command_line”, but can’t configure switch properly. What is wrong?

Posts: 4

Participants: 2

Read full topic

Aqara Wireless Mini and Deconz

$
0
0

@mrhaugland wrote:

I have two Aqara Wireless Mini switches. Had them connected to my previous installation of HA trough Deconz. I since made a fresh install, and are now unable to reconnect them to Deconz. They show up in HA entries like in the picture, with only battery percentage, but not in Deconz.

I have tried every button combination I can think of, and tried Googling and researching my way. I think perhaps I have to reset my Deconz gateway and start fresh?

If so, what would be the “correct” way to do this? Or is there anything else I can try?

Posts: 1

Participants: 1

Read full topic

Automation doesn't trigger

$
0
0

@Hellis81 wrote:

I’m trying to make my receiver turn down the volume automatically when it gets too loud.
I have added a microphone to a ESP8266 and use the ADC to get the “volume”. The return is a voltage reading.

ESPhome:

sensor:
  - platform: adc
    pin: A0
    name: "Sound"
    update_interval: 0.2s
    filters:
      - multiply: 3.3

The value is visible in Home Assistant as it should.
image
I also added a stats sensor to even out the spikes some.

Configuration.yaml

sensor:
  - platform: statistics
    entity_id: sensor.sound
    sampling_size: 5

This means the original value, sensor.sound, updates every 0.2 seconds and sensor.stats is average of 5 values (1 second).

The automation is:

- id: '1586672460751'
  alias: skruva ner förstärkaren
  description: ''
  trigger:
  - platform: template
    value_template: '{{ states.sensor.sound.state > 1.9 }}'
  condition: []
  action:
  - data: {}
    service: script.1586684255359 # script that turns down the volume of the receiver

Why is that not triggered as it should? Not even with {{ states.sensor.stats.state > 1.9 }} does it work.
Anyone that spots the problem?

Posts: 4

Participants: 2

Read full topic


Samsung Family Hub (Tizen?) browser: custom element does not exist

$
0
0

@Gotanius wrote:

Lovelace works perfect on all the apps and browsers, except for the browser on my Samsung Family Hub fridge. Standard cards are visible, however custom cards are not.

The error says: custom element does not exist

Anybody else having this issue?

Posts: 1

Participants: 1

Read full topic

ZHA with CC2652R / CC26X2R1

$
0
0

@jd1900 wrote:

I’ve been trying to add the CC2652R (with CC26X2R1 and connected to a Raspberri Pi) to ZHA with no luck, whereas I can in zigbee2mqtt with no problem at all.

I just get the error that the device can’t be connected (after a few seconds “loading”).
I stoped zigbee2mqtt beforehand. I’ve also tried rebooting the Raspberri Pi.

image

Posts: 1

Participants: 1

Read full topic

How to define sensor updated only with API

$
0
0

@gitmirko wrote:

Hi,

I would like to define a humidity sensor which will exclusively be updated from an API call from an external machine.

How could I achieve something like that?

Thank you

Mirko

Posts: 2

Participants: 2

Read full topic

FGRM222 without cover domain

Determining the City on AirVisual

$
0
0

@xacker wrote:

Hi! According to https://www.home-assistant.io/integrations/airvisual/ try configure AirVisual integration for use city (not lat, long) like this:

airvisual:
    api_key: YOUR_AIRVISUAL_API_KEY
    geographies:
        city: Los Angeles
        state: California
        country: USA

But after restart server sensors are not create, and HA notify me that new devices discovered and offer setup AirVisual through integrations UI(using lat and long). It is possible now using City/State/Country instead latitude/longitude?

Posts: 1

Participants: 1

Read full topic

Viewing all 101257 articles
Browse latest View live


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