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

Need help splitting lovelace files

$
0
0

@crazytok wrote:

Im trying to split my lovelace file but I dont get it.

I have a problem. I think its much more difficult to edit this yaml files than using RAW editor in Lovelace.

I have a code in the raw editor that works just fine, but just copy and paste dont work!

For example, Im trying to make a 3x3 columns and rows. But it dont work now in yaml mode, look at my code below:

File: 00-menu.yaml (in /ui-lovelace/)

title: Menu
panel: false
badges: []
id: menu

# MENU


cards:
  - cards:
      - entity: switch.lyxlage
        icon: 'mdi:lightbulb-on-outline'
        show_name: false
        style: |
          ha-card {
            border: solid 1px var(--primary-color);
            background: rgb(47,126,253,0.0);
            box-shadow: none;
            margin: 0%;

          }    
        styles:
          card:
            - height: 100px
            - width: 100px
        tap_action:
          action: navigate
          navigation_path: /lovelace/1
        type: 'custom:button-card'
      - entity: switch.lyxlage
        icon: 'mdi:security'
        show_name: false
        style: |
          ha-card {
            border: solid 1px var(--primary-color);
            background: rgb(47,126,253,0.0);
            box-shadow: none;
            margin: 0%;
          }           
        styles:
          card:
            - height: 100px
            - width: 100px
        tap_action:
          action: navigate
          navigation_path: /lovelace/2
        type: 'custom:button-card'
      - entity: switch.lyxlage
        icon: 'mdi:weather-partly-cloudy'
        show_name: false
        style: |
          ha-card {
            border: solid 1px var(--primary-color);
            background: rgb(47,126,253,0.0);
            box-shadow: none;
            margin: 0%;
          }                      
        styles:
          card:
            - height: 100px
            - width: 100px
        tap_action:
          action: navigate
          navigation_path: /lovelace/3
        type: 'custom:button-card'
    type: horizontal-stack
  - cards:
      - entity: switch.lyxlage
        icon: 'mdi:lightbulb-on-outline'
        show_name: false
        style: |
          ha-card {
            border: solid 1px var(--primary-color);
            background: rgb(47,126,253,0.0);
            box-shadow: none;
            margin: 0%;

          }    
        styles:
          card:
            - height: 100px
            - width: 100px
        tap_action:
          action: navigate
          navigation_path: /lovelace/1
        type: 'custom:button-card'
      - entity: switch.lyxlage
        icon: 'mdi:lightbulb-on-outline'
        show_name: false
        style: |
          ha-card {
            border: solid 1px var(--primary-color);
            background: rgb(47,126,253,0.0);
            box-shadow: none;
            margin: 0%;

          }    
        styles:
          card:
            - height: 100px
            - width: 100px
        tap_action:
          action: navigate
          navigation_path: /lovelace/1
        type: 'custom:button-card'
      - entity: switch.lyxlage
        icon: 'mdi:lightbulb-on-outline'
        show_name: false
        style: |
          ha-card {
            border: solid 1px var(--primary-color);
            background: rgb(47,126,253,0.0);
            box-shadow: none;
            margin: 0%;

          }    
        styles:
          card:
            - height: 100px
            - width: 100px
        tap_action:
          action: navigate
          navigation_path: /lovelace/1
        type: 'custom:button-card'
    type: horizontal-stack
  - cards:
      - entity: switch.lyxlage
        icon: 'mdi:lightbulb-on-outline'
        show_name: false
        style: |
          ha-card {
            border: solid 1px var(--primary-color);
            background: rgb(47,126,253,0.0);
            box-shadow: none;
            margin: 0%;

          }    
        styles:
          card:
            - height: 100px
            - width: 100px
        tap_action:
          action: navigate
          navigation_path: /lovelace/1
        type: 'custom:button-card'
    type: vertical-stack
type: vertical-stack


    
 

This is what I get:

Why is my last button on the right, and not below the others!? I have tried 100 different settings and its impossible.

Also, when using “panel: true” I get this, where are my other buttons!?? :sweat_smile::rofl::joy:: ??

And my ui-lovelace.yaml looks like this:

background: center / cover no-repeat url("/local/images/bg/bg2.jpg")
cch:
  swipe: true
  swipe_animate: swipe
  voice: hide
resources:
  - resources: null
  - type: module
    url: /local/mini-media-player-bundle.js?v=1.4.2
  - type: module
    url: /community_plugin/mini-graph-card/mini-graph-card-bundle.js
  - type: js
    url: /local/monster-card.js?v=2
  - type: module
    url: /community_plugin/button-card/button-card.js
  - type: module
    url: /community_plugin/decluttering-card/decluttering-card.js
  - type: module
    url: /community_plugin/lovelace-card-mod/card-mod.js
  - type: module
    url: >-
      https://cdn.jsdelivr.net/gh/bramkragten/weather-card/dist/weather-card.min.js
  - type: module
    url: /community_plugin/atomic_calendar/atomic_calendar.js
  - type: js
    url: /community_plugin/lovelace-grocy-chores-card/grocy-chores-card.js
  - type: module
    url: /community_plugin/bignumber-card/bignumber-card.js
  - type: js
    url: /community_plugin/vertical-stack-in-card/vertical-stack-in-card.js
  - type: js
    url: /community_plugin/lovelace-home-feed-card/lovelace-home-feed-card.js
  - type: js
    url: /customcards/github/thomasloven/card-tools.js?track=true
  - type: js
    url: /customcards/github/thomasloven/layout-card.js?track=true
  - type: module
    url: /community_plugin/compact-custom-header/compact-custom-header.js
  - type: module
    url: /community_plugin/garbage-collection-card/garbage-collection-card.js
  - type: module
    url: /local/timer-card.js
  - type: module
    url: /community_plugin/banner-card/banner-card.js
  - type: js
    url: /community_plugin/lovelace-home-feed-card/lovelace-home-feed-card.js
  - type: js
    url: /local/list-card.js?v=0
title: Home
views: 
    - !include /config/ui-lovelace/00-menu.yaml
    - !include /config/ui-lovelace/01-home.yaml
    - !include /config/ui-lovelace/02-lights.yaml
 

Please someone help me!! :joy::joy:

Posts: 1

Participants: 1

Read full topic


Input_Boolean as device_tracker/person?

$
0
0

@rich710 wrote:

I use Apples Homekit and a scenario to turn a virtual input_boolean to set if a person in my household is home or away (on/off) I would like to connect it to a person in Homeassistant but you can only use device_trackers to connect Persons. Is there any simple way that I can turn my booleans to Persons?
Templates? Virtual Device_tracker??

Thankful for help!
//Richard

Posts: 2

Participants: 2

Read full topic

RESTful command and templated url problem

$
0
0

@hkapanen wrote:

Hi,

I’m trying to post a simple http command to a device with a RASTful command but fail to get the variables through to url;

rest_command:
  set_garo_timer:
    url: http://192.168.0.230:80/v1/timer/{{ id }}
    method: POST
    payload: 'test'
    verify_ssl: false

When calling this from dev tools services with {id:"0"} as data, I get in log:

Error 404 on call http://192.168.0.230:80/v1/timer/.

Also, the payload does not seem to appear there.

Any Advice, please?

Oh, this is with Hassio 0.101.3.

Posts: 1

Participants: 1

Read full topic

Free mem and Swapfile

$
0
0

@poudenes wrote:

Hi All,

I see on my RPI3 B+ that the swapfile is getting full, and memory usage is almost always 34%.
So is there any reason why the swapfile is getting full?

Can i swapoff the swapfile or is this bad for stability of HA?

Posts: 1

Participants: 1

Read full topic

Changing stacks of buttons into icons/logos

$
0
0

@Skye wrote:

I have a bunch of scripts behind buttons to launch TV channels. Currently they are just text on buttons but I would like to use logos.

The yaml is as follows:

cards:
  - cards:
      - entity: script.1560183642357
        hold_action:
          action: more-info
        icon_height: 50px
        name: Journaal
        show_icon: false
        show_name: true
        tap_action:
          action: toggle
        type: entity-button
    type: horizontal-stack
  - cards:
      - entity: script.1560008204659
        hold_action:
          action: more-inf
        icon_height: 100px
        name: VTM
        show_icon: false
        show_name: true
        tap_action:
          action: toggle
        type: entity-button
      - entity: script.1560010345656
        hold_action:
          action: more-info
        icon_height: 50px
        name: VIER
        show_icon: false
        show_name: true
        tap_action:
          action: toggle
        type: entity-button
      - entity: script.1560010397544
        hold_action:
          action: more-info
        icon_height: 50px
        name: VIJF
        show_icon: false
        show_name: true
        tap_action:
          action: toggle
        type: entity-button
    type: horizontal-stack
  - cards:
      - entity: script.1560010450589
        hold_action:
          action: more-info
        icon_height: 50px
        name: één
        show_icon: false
        show_name: true
        tap_action:
          action: toggle
        type: entity-button
      - entity: script.1560010591120
        hold_action:
          action: more-info
        icon_height: 50px
        name: Canvas
        show_icon: false
        show_name: true
        tap_action:
          action: toggle
        type: entity-button
      - entity: script.1560010552111
        hold_action:
          action: more-info
        icon_height: 50px
        name: Q2
        show_icon: false
        show_name: true
        tap_action:
          action: toggle
        type: entity-button
    type: horizontal-stack
type: vertical-stack

And it looks like

I figured if I add

icon: /local/path/to/img.png
show_icon: true

that that would work, though the image is not showing up.

Any ideas?

Posts: 1

Participants: 1

Read full topic

Xioami motion sensor Illumination

$
0
0

@Simmo wrote:

Hi,

I have a few xioami motion sensors around my house that have been working perfectly for well over a year now. What I would like to be able to do is to use the lux reading in my automations. I have read that the sensors only take a lux reading with motion, but that will be fine as I am sure I could set up an automation that sees motion waits for a second, checks then lux and then turns light on if the lux is below x?

My issue is that I cannot seem to see that the lux reading is showing in my HA setup, here is the info I can see from my sensors:

sensors

Any ideas on how I also pull the lux reading in (that I can see in the xioami app)?

Posts: 1

Participants: 1

Read full topic

SSH & Web Terminal

$
0
0

@mortenrpetersen wrote:

Hello

I get the following error, when i start the addon, and then I just get 502 error when I open the WebUI.

Does anyone know how to fix this ?

[11:26:26] INFO: Starting the SSH daemon…
Bind to port 22 on 0.0.0.0 failed: Address in use.
Bind to port 22 on :: failed: Address in use.
Cannot bind any address.
[cont-finish.d] executing container finish scripts…
[cont-finish.d] 99-message.sh: executing…
[11:26:26] INFO: STDIN service was stopped, restarting…
[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] waiting for services.
/usr/lib/bashio/config.sh: line 49: printf: write error: Broken pipe
[s6-finish] sending all processes the TERM signal.

Br Morten

Posts: 1

Participants: 1

Read full topic

Nvidia shield (androidtv) play/paused status problem

$
0
0

@prankousky wrote:

Hi everybody,

I recently got an nvidia shield and now want to integrate it into Home Assistant. I do have an entity media_player.nvidia_shield. When I play a video in the youtube app, it will successfully change the state to playing, and when I pause it to paused (there is even an idle state when it is running but not playing anything).

However, when I play anything via plex app, it will remain its last status from outside plex no matter what I do. When I start playback, or when I pause/resume playback, the state will not change. All or most other apps (haven’t tried all yet but seems like it) work fine, by that I mean the update the status to its actual value - only the plex app does not.

We mainly use plex for media playback, and I want an automation like “when plex changes from playing to paused, turn on lights”; I do have this automation, and it does work for my fire tv (but onn the fire tv I use plex inside the kodi player, which creates an additional entity media_player.plex_on_kodi_localhost(or similar; I cannot see the entity at the moment)).

While I can work with that additional entity on the fire tv, I would prefer not to run plex inside of kodi on my shield but rather use the stand alone plex app for android tv.

Have any of you encountered this problem and know how to fix it? I could work around it by installing kodi, then the kodi plex app, on my shield, but if this is not necessary, I’d prefer not to.

This has been semi-buggy on the fire tv as well, but might be due to my automation; when I play something in plex (in kodi) there upon starting the device, it works fine; but once I had played something outside plex (youtube, for example), it will sometimes update the status correctly, and sometimes not. Weird!

Thanks for your ideas :slight_smile:

Posts: 10

Participants: 3

Read full topic


Ingress iframe router

$
0
0

@seanomat wrote:

I was hoping to be able to access my router webinterface through a link in the HA-menu, possibly even from outside by proxying through Nabu Casa and ingress.

Not really sure if this should be possible at all, but one problem might be, that the router webinterface is setting the x-origin-option to “sameorigin”, making it impossible to access the router in am iframe.

Is there any way, to circumvent this option and should this work, if it was possible to ignore the header-option?

Posts: 1

Participants: 1

Read full topic

Weird looking history graph

$
0
0

@mpahic wrote:

history_graph
As you can see from the picture, the points show ok values, but the x-axis and y-axis are totally jumbled. How can I fix this?

Here is my graph config:

name: Temperature
entities:
  - name: Bedroom
    entity: sensor.room_temperature
type: history-graph
hours_to_show: 48

And this is my sensor config:

- platform: mqtt
  name: "Room Temperature"
  state_topic: "room1/temperature"
  qos: 0
  unit_of_measurement: "°C"

Posts: 6

Participants: 3

Read full topic

Help with my first bit of "programming" - switch to control sonos

$
0
0

@Matt_Barnes wrote:

So up until now I have been doing bits in HA (hassio) including setting up hue lights, a couple of graphs, some data displays for speedtest.net and my synology nas and most recently the skyq custom component.

Until now it has all been UI and Lovelace type stuff really.

Next step, I have a friends of hue switch (sensor.friends_of_hue_switch_1) which has 4 buttons and changes the state to things like “left_upper_release”

I would like to write automation? (or script not entirely sure which) so that when “left_lower_release” is set it plays my sonos.

I am not entirely sure where to start with this, should I use the entity as a sensor? If I set it to play when “left_lower_release” what happens if “left_upper_release” is then pressed? does the state of the sensor mean sonos stopped, which would be unwanted, or can I write it so that each press of the lower left button starts or stops sonos.

Feel like this is really basic, but on the basis I am not sure whether I need automation or script and how to treat a sensor like a switch I need some pointers on where to start.

Thanks!

Posts: 4

Participants: 2

Read full topic

Repeated zha events when using lighify switch

$
0
0

@sam2 wrote:

Hi,

I’m currently running ZHA with a conbee II usb stick. Generally it works ok, but I have an intermittent bug that I haven’t been able to track down.

I have a few Sylvania lightify dimmin switches (the 2 button switch) paired with ZHA. They show up as Centralite 3130. Because of the way I want to use them I have automations wired up to listen to the zha_event when one of the buttons is pressed or held, thereby giving me effectively 4 buttons. I use these events to toggle the state of different hue light bulbs (via the hue bridge and hue integration).

The problem is that sometimes (but not always), i’ll press the button and the light will come on, then a few seconds later go off, then a few more seconds come back on. But its not always 3 times (sometimes one, twice, or three times).

When testing, I can see the zha_event firing the number of times the light state toggles. What I can’t track down is why the event is firing multiple times for a single button press. I don’t know if the switches are misbehaving and sending the message multiple times, or whether something in the ha/zha stack is playing up.

Any idea’s on how I can trouble shoot this further??

cheers
Sam

Posts: 1

Participants: 1

Read full topic

Create a template from a https request and json answer

$
0
0

@penright wrote:

Not sure if this can be done. I would like to query google and get time and distance. Today I am doing it with code running in AppDaemon. When a switch is flipped on, then an AppDaemon would hit the api, build a message that the notify platform would then text. I was seeing if I could move it into HA automation yaml. That is all I am using AppDaemon for now.

Here is my https call:

https://maps.googleapis.com/maps/api/distancematrix/json?origins=35.xxxxx,-97.xxxxx&destinations=35.xxxx,-97.xxxxx&mode=driving&language=en-EN&sensor=false&key=xxxx

It then responds with something like:

{
   "destination_addresses" : [ "xxx Antler Ridge, xxx, OK xxxxx, USA" ],
   "origin_addresses" : [ "xxx NE 63rd St, Oklahoma City, OK 73121, USA" ],
   "rows" : [
      {
         "elements" : [
            {
               "distance" : {
                  "text" : "48.3 km",
                  "value" : 48317
               },
               "duration" : {
                  "text" : "36 mins",
                  "value" : 2133
               },
               "status" : "OK"
            }
         ]
      }
   ],
   "status" : "OK"
}

Is there a way to call a https and template the response?

Posts: 3

Participants: 2

Read full topic

Reading CPU and HDD temp will give 'unkown' error on 'native HASS'

$
0
0

@scdhome wrote:

Tested before the Hass in a container solution … but for different parts of hardware I have build the HASS native on the Raspberry PI.
I could read the CPU temperature in the first situation (container solution) but not anymore in the ‘native linux’ install.

I used the installation manual from this site:
a. https://www.home-assistant.io/docs/installation/raspberry-pi/
b. https://www.instructables.com/id/Setup-Home-Assistant-on-Raspberry-Pi/

And the result is very fine … the HASS software is up and running.
The first thing I always do is to make the small script to see how ‘hot’ the CPU will be.
I used the samll configuration script like:

CPU temperature

  • platform: command_line
    name: CPU Temperature
    command: “cat /sys/class/thermal/thermal_zone0/temp”
    unit_of_measurement: “°C”
    value_template: “{{ (value | multiply(0.001)) | round(1) }}”

But always what I try to fix … the end result is ‘unkown’ temperature in the webscreen of HASS.

Dit anyone see this also before ?

I think something it will be about user rights, hidden python script or what else …
I will check the log files … may be I will see more information why this script will not show the correct temperature …

Note: tested this in the CLI-Shell … everything works fine.

Posts: 9

Participants: 2

Read full topic

Mqtt Sonoff bridge

$
0
0

@nirlag wrote:

Hi.
i’m trying to config my sonoff bridge with mqtt,

-flashed bridge with tasmota.
seems to work fine- reciving data from motion sensor.
-started mosqitto mqtt. at the logs i see that the Sonoff has connected

1573823774: New connection from 10.0.0.6 on port 1883.
[INFO] found nir on Home Assistant
1573823775: New client connected from 10.0.0.6 as RF_Bridge (p2, c1, k30, u'nir')

an config.yaml

i have:
mqtt:
Broker: 10.0.0.33
Port: 1883
discovery: true
discovery_prefix: homeassistant

binary_sensor:

    - platform: mqtt
      state_topic: 'tele/RF_Bridge/RESULT'
      name: 'window'
      value_template: '{{value_json.RfReceived.Data}}'
      payload_on: '1CE2DA'
      payload_off: '1CE2DAoff'
      device_class: motion
      optimistic: false
      qos: 1
      retain: false

but i cand make it apper on lovlace, or at the entity list.

never worked with mqtt before…
what am i doing wrong?

Posts: 2

Participants: 2

Read full topic


I'm stuck: trying to combine conditions 'time:weekday' and 'sun:before sunrise,' no luck

$
0
0

@mugczar wrote:

I want certain lights to come on Monday-Friday at 6:30 a.m., but only if the sun is below the horizon.

I’ve read through a large handful of posts*; originally I couldn’t get the automation to not fire on the weekend, but you folks helped me out, thanks**! Unfortunately, every different syntax I’ve tried for combining two conditions has resulted in the sun coming up before 6:30, and the lights coming on anyway.

Here’s what I have currently; I’m hopeful it’s a simple syntax error (I’m relatively new to scripting):

- id: '1571596809000'
  alias: Weekday TEST
  trigger:
  - at: 06:30:00
    platform: time
  - condition:
    conditions:
      - condition: sun
        before: sunrise
      - condition: time
        weekday:
         - mon
         - tue
         - wed
         - thu
         - fri
  action:
  - data:
      brightness: 26
      entity_id: light.office
    service: light.turn_on
  - data:
      brightness: 26
      entity_id: light.console_lamp
    service: light.turn_on
  - data:
      brightness: 102
      entity_id: light.cube_lamp
    service: light.turn_on

Can anyone spot what I’m doing wrong? Thanks in advance!


*Here are the topics I’ve been using as reference:
Trigger at time but only if before sunrise, Why don't this work? (before: sunrise)

**Here is my one-condition script that does fire only M-F:

- id: '1571596809000'
  alias: Weekday TEST
  trigger:
  - at: 06:30:00
    platform: time
  condition:
  - condition: time
    weekday:
    - mon
    - tue
    - wed
    - thu
    - fri
  action:
  - data:
      brightness: 26
      entity_id: light.office
    service: light.turn_on
  - data:
      brightness: 26
      entity_id: light.console_lamp
    service: light.turn_on
  - data:
      brightness: 102
      entity_id: light.cube_lamp
    service: light.turn_on

Posts: 6

Participants: 4

Read full topic

The Future of Z-Wave in HA - QT-OpenZWave

$
0
0

@JumpMaster wrote:

Hi all,

In the state of the union 2019 presentation there was a brief update on the path to Open Z-Wave 1.6.

Short mention of it can be found here.

This sounds like a great path forward. There will be a separation between Home Assistant and Z-Wave meaning that restarting HA will not result in a restart of the Z-Wave network. My initial guess is this will be in a separate docker container like a Hassio addon.

It will then by connected to HA via MQTT. I am unsure how this differs from the existing ZWave2MQTT project but decoupling OpenZWave from HA and from Python will only be a good thing.

Projects:


Kev

Posts: 1

Participants: 1

Read full topic

TTS.Google_translate_say seems not to accept data_template

$
0
0

@Zapa wrote:

Hello,
I’ve been lately trying to get the info from a simple DHT22 sensor and send an service call in order to play the value of the temperature through my speakers.
Following docs and similar topics, I’ve created and script:

  alias: Testing
  sequence:
    - service: tts.google_translate_say
      entity_id: media_player.symfonisk
      data_template:
        message: "La temperatura del salon es {{ states('sensor.temperatura_salon') }} grados."
        cache: false

But it doesn’t work, as far as I always get the same error.
extra keys not allowed @ data['data_template']

Where I’m getting lost?

Posts: 6

Participants: 2

Read full topic

Templates in shell_command data

$
0
0

@Juggler wrote:

I have a shell_command that is renaming a file. One of the variables I’m trying to send it is the formatted time value from an input_datetime. I have tested the template {{ state_attr('input_datetime.lastmotion_driveway', 'timestamp') | timestamp_custom('%Y%m%d_%H%M') }} and verified that it is working.

The problem is when I look at the output from the shell_command, it is interpreting the time variable as a literal, not a template. I’ve tried with quotes and without; same effect. I’m sure there is a glaringly obvious way to fix this… anyone?

    - service: shell_command.motion_video
      data:
        action: "mv"
        camera: "driveway"
        time: "{{ state_attr('input_datetime.lastmotion_driveway', 'timestamp') | timestamp_custom('%Y%m%d_%H%M') }}"

Posts: 2

Participants: 2

Read full topic

Notification file, export to CSV in one line

$
0
0

@argykaraz wrote:

I am Trying to export some values to csv, but every export I make is written on a different line. Is there a way to export some values to different cells on the same line?

Posts: 5

Participants: 2

Read full topic

Viewing all 109089 articles
Browse latest View live


Latest Images

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