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

How to switch to MacOS

$
0
0

@fmon wrote:

How to switch over to MacOS

Like many of us here, I started as a newb and had to learn how to SSH into a Raspberry Pi, write basic YAML and effectively use the command line. As soon as I thought I had it all under control, I decided to switch over to a Mac Mini; unfortunately, however, this task isn’t as easy as copying over one’s HA config files, and there’s no real guide that I could find. It took a lot of messing around to figure it out, so I thought I might put a little PSA out for anyone else embarking on this process without the full knowledge of how to do so. Before I even start, I’m barely more than a noob, so take what you see with a grain of salt.

First off, why switch? Briefly my mini ( I was feeling spendy, so it’s the new model) offers:

  • speed: HA graphs render instantly; restarts take ~12 seconds instead of minutes; etc.
  • functions as a NAS and media server. USB 3.0 ports = cheap, fast storage.
  • Spotify to homepods. Airfoil.
  • Time Machine backups = no need for rsync and no worrying about SD card fails
  • HDMI out to nearby TV + wireless keyboard/trackpad (or VNC) = biggest monitor in the house

Now, things to know before you start:

  • Starting with El Capitan, and progressing with each new OS, Apple introduced some new security components with which you shall tangle. First off, “Full Disk Access” is a feature that requires you to give permission to apps- including Terminal and any emulators you may be using (Termius in my case)- permission to work with the entire disk. Go to System prefs -> security & privacy -> privacy, then select full disk access and add what you need. Also you may like to read about SIP (System Integrity Protection), which limits access to certain system folders. This gets even more restrictive in Catalina (see below).
  • Decide on your setup: I chose to run in a VENV because that’s how I did it on my Pi, and you can follow the standard HA installation documentation (although the autostart script to which it links didn’t work for me):
    https://www.home-assistant.io/docs/installation/macos/
    I don’t know if there’s a way to run Hassio on a MacOS volume… maybe with Docker or something.
  • Package installer: there is no apt-get on MacOS; the best alternative is Homebrew. You can read about this elsewhere, but installing an updated version of Python in your VENV is easy with Homebrew.
  • Restarting a headless Mac: at first this was really frustrating, as I was trying to run a headless mini via SSH like we do with the RPi’s, but because of full disk encryption, it turns out that issuing a restart on a mac brings you to a login screen at a point in the boot where VNC and/or the built-in screen sharing modality in Mojave or Catalina isn’t active yet. Which means that you need a physical keyboard and monitor to log in, which means that you’re not headless any more. Well it turns out that there’s a command you can issue that will take you straight to the user login screen at which point VNC will have started, and you can login in that way. The command:
    sudo fdesetup authrestart
    Also, I discovered that it IS possible to write a bash script using this command so that you have a button to restart your Mac in HA. Slick.

Now comes what was I think the most frustrating issue that I faced: who is HA running as, and where are the config files??? Well it turns out that on a mac this all has to do with how you START HA. I shall explain.

  • Let’s start by reviewing the fact that HA should not run as root. However, we sudo the systemctl command to start HA on a pi as detailed here:
    https://www.home-assistant.io/docs/installation/hassbian/common-tasks/
    However, if you sudo your start command on a mac, by using sudo you have specified that root owns the process. As a result, HA not only runs as root but also looks here for the config files:
    /var/root/.homeassistant
    … but var is a symlink, so the actual path is:
    /private/var/root/.homeassistant
    Confused yet? I sure was. My solution to this was NOT to create a new user just for HA which would always be logged in but rather just to use the default user which, given that it has admin privileges may not be as secure as a limited user, but it’s better than root. Also, the config files wind up in a non-perplexing location at:
    /Users/yourusername/.homeassistant
  • So, how to start HA as your user? Well, ideally you want HA to start at boot, so you can use crontab, but I elected to educate myself on launchd, which is MacOS’s updated version of crontab. This involves creating a .plist file that you put in your ~/Library/LaunchAgents folder (which by virtue of its location will start as the user). Good advice here:
    https://alvinalexander.com/mac-os-x/mac-osx-startup-crontab-launchd-jobs
  • In that article he uses launchctl load/unload for start/stop, but FYI there’s even newer syntax using boostrap/bootout and even kickstart (to stop and then restart). This looks like:
    launchctl bootstrap gui/<user PID> /Users/yourusername/Library/Launchagents/org.homeassistant.plist
  • Activating your VENV looks familiar if you created it in your user folder:
    source /Users/yourusername/homeasistant/bin/activate

Dependencies

  • I had remarkably few issues here. Just remember that if you’re looking for something you would normally need apt-get for, there’s probably an analogous package in Homebrew. For example, I was looking for libssl for an updated Apple TV integration and realized that openssl was already installed and filled the bill.
  • Also remember to re-install anything that you had to install separately on your pi (like iStats in my instance).

Catalina-specific issues

  • / isn’t what it used to be, which broke a few things (like system monitor’s disk percent usage). The system now exists on a protected volume, and the path to what the user can access is:
    /system/volumes/data
  • 32 bit support is gone. Find updated versions of those old programs.
  • The default shell is now zh instead of bash, but if you upgrade an existing Mojave system your default shell doesn’t change unless you tell it to. Terminal gives you a blurb about it.

What I’m into lately

I sure hope this saves someone some time, because I wasted a lot figuring it out. Big brains please correct my errors!

Posts: 1

Participants: 1

Read full topic


Templating question - passing data

$
0
0

@klogg wrote:

How can I pass a list of data, in this case room names, between scripts? I am trying like this which I do like this:

service: script.blah_blah
data:
  room: ['kitchen', 'sitting_room']

The script (blah_blah) that receives the data needs to pass it on to another script which I am trying to do like this:

service: script_waffle
data_template:
  room: >
   {{ room }}

All the code in both scripts work perfectly in the template editor. I test it there by setting the ‘room’ variable like this (which is how the original script passes it:
{% set room = ['kitchen', 'sitting_room'] %}

But in a ‘live’ environment the second script doesn’t work with the data passed to it like that.

My question is, how can I pass a list from one script to another script so that it stays as a list and not as a simple string, which I suspect is what is happening now ?

Posts: 4

Participants: 2

Read full topic

Help with triggers based on sensor state

$
0
0

@Peter_West wrote:

Hi,

I’m using the ILO integration to monitor key components of an HP Server i’m running. I’ve made a number of sensors using the template functionality, and example of which looks like this.

      # Storage Status
      - name: storage_status
        sensor_type: server_health
        value_template: "{{ ilo_data.health_at_a_glance['storage']['status'] }}"

I had initially attempted to get the notification to fire if the sensor reported any value other than ‘OK’, but I couldn’t get that working. I then tried creating an automation based on the state changing specifically from OK to Degraded but that also failed to work. The code i’m using is below.

  - alias: "PushOver Notification: HP ILO Storage Issue"
    trigger:
      - platform: state
        entity_id: sensor.hp_ilo_storage_status
        to: 'Degraded'
      - platform: state
        entity_id: sensor.hp_ilo_storage_status
        from: 'OK'
    action:
      - service: notify.pushover
        data:
          message: "HP Server Fault"
          title: "The HP Server located at home has raised an alert regarding it's in-built Storage."
          data:
            url: "https://www.home-assistant.io/"
            sound: pianobar
            priority: 0

However, it seems this also fails to trigger. Is anyone able to help me with this please?

Posts: 7

Participants: 3

Read full topic

New to GPIO, Any Recommendations Where To Begin?

$
0
0

@CaptTom wrote:

Raspberry Pi 3 B+ running HASS.IO. I’m thinking of connecting some relays to the GPIO pins. The relays would be powered by components in my HVAC system, so would appear to the GPIO just like switches (two states; opened or closed.) I’m not looking to control anything, just read the status of these components.

I’ve never done this before, never used Python before, only just coming up to speed with HA in general. I’ve searched, and found some pointers, but most documents I’ve found so far assume a lot more experience.

For example, is there a way to display the status of the GPIO pins while testing? I found the command “sudo gpio readall” but all it returns is an error saying the gpio command doesn’t exist.

I added a small “switch” sample I found to configuration.yaml, and the couple of switches in the example are available to add to Lovelace, so I’ve got that far, even with no pins connected. I’ve read up on the issues with pin numbering and naming.

Next step would be to physically wire some switches to the pins, open and close them, and see what displays. Am I on the right track?

Thank you!!

Posts: 3

Participants: 2

Read full topic

Aqara Double Rocker Constantly Changing State

$
0
0

@StephenSimon wrote:

Hey everyone, I’m still new to HA and just setting up my first Aqara Wireless Remote Switch
(Double Rocker). I made a couple of automations and it seems to be working correctly.

However, looking in my logbook, I see numerous entries about state changes that makes me think that something is not configured correctly. Can someone tell me what these messages actually mean? Is this normal, expected behavior?

I’m running Home Assistant 0.100.2 and HassOS 2.12 on Rasberry Pi 3 B+.

Thanks for your help.

6:59 PM [LUMI lumi.remote.b286acn01](http://10.0.0.229:8123/logbook#) changed to both_single
6:59 PM  [LUMI lumi.remote.b286acn01](http://10.0.0.229:8123/logbook#) changed to right_double
6:59 PM  [LUMI lumi.remote.b286acn01](http://10.0.0.229:8123/logbook#) changed to left_single
6:44 PM [LUMI lumi.remote.b286acn01](http://10.0.0.229:8123/logbook#) changed to unavailable
6:44 PM  [LUMI lumi.remote.b286acn01](http://10.0.0.229:8123/logbook#) changed to unavailable
6:44 PM  [LUMI lumi.remote.b286acn01](http://10.0.0.229:8123/logbook#) changed to unavailable
6:29 PM  [LUMI lumi.remote.b286acn01](http://10.0.0.229:8123/logbook#) changed to unavailable
6:29 PM  [LUMI lumi.remote.b286acn01](http://10.0.0.229:8123/logbook#) changed to unavailable
6:29 PM  [LUMI lumi.remote.b286acn01](http://10.0.0.229:8123/logbook#) changed to unavailable
6:18 PM  [Sun](http://10.0.0.229:8123/logbook#) has set
6:14 PM  [LUMI lumi.remote.b286acn01](http://10.0.0.229:8123/logbook#) changed to both_single
6:14 PM  [LUMI lumi.remote.b286acn01](http://10.0.0.229:8123/logbook#) changed to right_double
6:14 PM  [LUMI lumi.remote.b286acn01](http://10.0.0.229:8123/logbook#) changed to left_single

Posts: 1

Participants: 1

Read full topic

No portability?

$
0
0

@random762 wrote:

Is there a way to take configuration from hass.io on a RPi3 and move it to home assistant in docker on a NUC or do I have to rebuild everything from scratch?

Have hass.io working pretty well on a RPi3. Almost all my devices are z-wave. History and the logbook were kind of slow, so I thought I would move things over to a NUC. Installed home assistant in docker. Got things working pretty well until I tried to get the configuration moved from hass.io to home assistant. Not as simple as copy the config directory. Tried installing hass.io in docker on the NUC. Bring over the latest snapshot from the Pi. History and log book don’t work at all - get a log full of sqlite database image malformed errors. Doesn’t seem to be a way to fix a malformed database, so I delete it. Now history and log book work great but everything in lovelace UI comes up: entity not available. No good.

Thanks for any help.

Posts: 5

Participants: 4

Read full topic

Number of network connections?

$
0
0

@Shazster wrote:

Running hass.io in Docker on linux Mint (19 on a x86 64-bit desktop, not raspberry pi). When I first installed I checked my network to notice 3 concurrent network connections:
my physical ethernet adaptet, one virtual for Docker, and one virtual for Hass.io. After rebooting to make sure everything auto-restarts correctly, I have noticed an extra network connection starting with “veth” in addition to the others.
Is this normal behavior? (I have shut my system down for now until I understand if this is OK).

Posts: 3

Participants: 2

Read full topic

Google assistant and my test app - automate test period renewal?

$
0
0

@dedepene wrote:

So apparently the test app google assistant integration expires every 30 days and testing needs to be manually re-activated as described below. Has anyone figured out a way (short of subscribing to NabuCasa) to schedule an automatic update every 25 days or so, before testing mode expires…???

Syncing may also fail after a period of time, likely around 30 days, due to the fact that your Actions on Google app is technically in testing mode and has never been published. Eventually, it seems that the test expires. Control of devices will continue to work but syncing may not. If you say “Ok Google, sync my devices” and get the response “Unable to sync Home Assistant”, this can usually be resolved by going back to your test app in the Actions on Google console and clicking Simulator under TEST. Regenerate the draft version Test App and try asking Google to sync your devices again. If regenerating the draft does not work, go back to the Action section and just hit the enter key for the URL to recreate the Preview.

Posts: 1

Participants: 1

Read full topic


Fan switch timer with override

$
0
0

@Joedoe wrote:

Is there a way to differentiate a manual physical switch toggle vs mqtt (sonoff in switch mode)?
Here is the scenario:
If the switch is turned on using phone etc., input number slider can be set for desired duration and that works.
If switch is physically turned on, the sonoff still uses the duration previously set by input number.

If automation in HA is turned off, node-red based on switch “on” state, using bigtimer turns off fan after 3hrs - as in forgot to turn off fan… and that works.

What I would like is to be able to somehow differentiate the physical flip of wall switch. The idea is that I can leave the fan as long as I want instead of duration set by input number when I use physical switch and if I really forget, node-red bigtimer should turn it off after a maximum duration of 3hrs.

Somehow I don’t think it is possible… one avenue I explored is to see if tasmota itself provides a timer off function but it is schedule based and not a simple off timer… unless I missed something.

Any thoughts?

Posts: 1

Participants: 1

Read full topic

Newbee question : Zigbee with conbee ii - multi level hardware installation

$
0
0

@theHasp wrote:

Hi
my home-assistant raspi is situated in the basement attaching the conbee to the usb port is possible but the range will be very limited …

Should I use “main powered” extenders to span the network through 3 levels (basement, groundfloor, …) or is there a better approach ?

Thanks
Hannes

Posts: 4

Participants: 3

Read full topic

Telegram - sending a photo. Docs error?

$
0
0

@klogg wrote:

Is there something missing in the Telegram Integration for sending photos?
Or is the documentation wrong?

The docs say:

And the integration fails if message: is excluded.

However neither message nor title actually do anything, they do not appear in the Telegram message (caption works as expected).

So, either the integration is over zealous in its checking or it fails to use message (and title)

This is easily tested in the Service Dev Tool:


This works but just sends the photo with a caption, no title or message

image


This fails with:

required key not provided @ data['message']

image

Posts: 5

Participants: 3

Read full topic

DuckDNS addon constantly stops without reason

$
0
0

@tomoqv wrote:

I am curious if anybody else has encountered this problem (referenced as this Github issue)? If I go into hass.io in the left panel and start the DuckDNS addon, go to overview and then back to the addon page I can see that is has stopped again.

Most of the time it is not a problem, but ever so often (daily or semi-daily) my clients lose access to the hass.io server on my Raspberry Pi 3. When that happens, I have to ssh into hass.io and restart the server. I am not entirely sure that it is related to the issue in question, but it sure seems plausible.

Posts: 3

Participants: 2

Read full topic

LED-strip RGBW Magic Home with Tasmota and MQTT

$
0
0

@AcidSleeper wrote:

Hey
Im loosing it soon. Problems with getting my ledstrip to work correctly with Hassio.

I have flashed it and using Tasmota to control it and have made the setup for mqtt.

BUT…

When I click on the sliderbutton the ledstrip goes ON but it takes forever to get full controll.
ledon

My code:

light:
  - platform: mqtt
    name: "Ledutekok"
    command_topic: "cmnd/magichome/POWER"
    state_topic: "tele/magichome/STATE"
    state_value_template: "{{value_json.POWER}}"
    availability_topic: "tele/magichome/LWT"
    brightness_command_topic: "cmnd/magichome/Dimmer"
    brightness_state_topic: "tele/magichome/STATE"
    brightness_scale: 100
    on_command_type: "brightness"
    brightness_value_template: "{{value_json.Dimmer}}"
    white_value_state_topic: "tele/magichome/STATE"
    white_value_command_topic: "cmnd/magichome/White"
    white_value_scale: 100
    white_value_template: "{{ value_json.Channel[3] }}"
    rgb_command_topic: "cmnd/magichome/Color2"
    rgb_state_topic: "tele/magichome/STATE"
    rgb_value_template: "{{value_json.Color.split(',')[0:3]|join(',')}}"
    effect_command_topic: "cmnd/magichome/Scheme"
    effect_state_topic: "tele/magichome/STATE"
    effect_value_template: "{{value_json.Scheme}}"
    effect_list:
      - 0
      - 1
      - 2
      - 3
      - 4
    payload_on: "ON"
    payload_off: "OFF"
    payload_available: "Online"
    payload_not_available: "Offline"
    qos: 1
    retain: false

Whats wrong? Someone?

Posts: 10

Participants: 3

Read full topic

Help with Rest Configuration

$
0
0

@mattpitts74 wrote:

Hi Guys,

I’m sure someone here can help me, I have just setup a mini weather station using the following ESP board http://www.switchdoc.com/weatherplus/

The software running in the board allows rest calls as can be seen here http://www.switchdoc.com/2016/06/ourweather-rest-interface-interface-raspberry-pi/

So I can make a rest call such as https://192.168.1.118/IndoorTemperature which is display the temp from the boad in my browser in json format as below

{"IndoorTemperatur
e": 27.47, "id":
"1", "name":
"OurWeather",
"connected": true}

I’m now wondering how to get this information into hassio? I had assumed that I would use the aRest Intergration, but so far I’ve been unable to make this work. https://www.home-assistant.io/integrations/rest/

I’m sure its really simple, but I’m struggling, I’d really appreciate if someone could point me in the right direction? Do I need a value template??

Posts: 2

Participants: 2

Read full topic

How to get nodon roller shutter into configuration.yaml (NEWBEE)

$
0
0

@RalfP wrote:

Hi everybody,

I have just set up my first HA and would like to integrate my nodon roller shutter ( Nod On SIN-2-RS-01 EnOcean).
These are enocean devices (my Eltako FT 55 are already knwon to the system and working, so the USB 300 stick is working fine).

First I think I have to put the shutter in the configuration.yaml and there my problem starts. I’ve searched for quite a while now, but I don’t know if the below code would be right and don’t want to destroy anything just my limited knowledge.

#Enocean Rolloaktor SZ1
cover:
  - platform: enocean
  id: [0xXY,0xXY,0xXY,0xXY]
  name: "Rolloaktor-SZ1"

Is that enough to use the shutter to control the motor? (Questions like calibration and so on might follow, but first I’ld like to open/close the blinds with some automation (to be done)).

Thanks upfront
RalfP

Posts: 4

Participants: 2

Read full topic


Display Xiaomi Zigbee door sensor battery level lovelace?

$
0
0

@kazihaha wrote:

I try to use monster card to display the battery level. But it just show me the state of the door sensor only.
My code is:

      - type: custom:monster-card
        show_empty: false
        card:
          type: glance
          title: Batteries
        filter:
          include:
            - entity_id: binary_sensor.door_window_sensor_158d0002e2e117
              attributes:
                battery_level: "< 100"

Could someone show me something wrong here?
Thanks so much for reading.

Posts: 1

Participants: 1

Read full topic

Unable to get ssl working in docker installation - HA cannot be accessed if ssl files are stated in configuration.yaml

$
0
0

@langph wrote:

I have been operating home assistant from OMV 4.3 via docker. SSL is renewed automatically via letsencrypt in OMV. Some time ago, the SSL configuration led to a non-working application. Probably after a upgrade, upgrades are automatically applied with “watchtower”.

Setup is : as host, no privileged mode
mounts:

/sharedfolders/HA/homeassistant to /config
/etc/letsencrypt/live/mycert to /ssl

in configuration.yaml, I have:

ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem
base_url: https://my_url:8123

HA is installed in /sharedfolders/HA/home assistent

I have tried setting rights to full access, I have tried copying the ssl files to a different folder. If I put these two lines in configuration.yaml, I get the following error message: “Invalid config for [http]: not a file for dictionary value @ data[‘http’][‘ssl_certificate’]. Got ‘/ssl/fullchain.pem’”.

If I copy the files (automatically to a folder /sharedfolders/HA/mycert and change the mounts in Docker, the error disappears, but HA still cannot be accessed. (ERR_EMPTY_RESPONSE).

How can I resolve this?

EDIT: https works, it’s the local http address that does’nt.

Posts: 1

Participants: 1

Read full topic

Unit of measurement for a template sensor

$
0
0

@Matt_Barnes wrote:

So I have speedtest giving me a download speed, but I wanted it to round to 0 decimal points so it displays without wrapping in the example below but the template version is not displaying a unit of measurement.

The guage is the speedtest download speed.
The sensor card is the rounded version.

I have put “unit of measurement” everywhere I can think but still just displays 30.

Code for template:

  - platform: template
    sensors:
      speedtest_download_rounded:
        value_template: "{{ states('sensor.speedtest_download') | float | round(0) }}"
        unit_of_measurement: 'Mbit/s'  

Code for sensor card:

    
    - type: horizontal-stack
      cards:

          - type: sensor
            name: Download
            unit_of_measurement: 'Mbit/s'
            entity: sensor.speedtest_download_rounded
            severity:
              red: 10
              yellow: 18
              green: 25

Display of card:
image

Display of guage showing Mbits/S
image

All I want is to be able to see 30 Mbit/s in the sensor card

Posts: 3

Participants: 2

Read full topic

Missing sensors in InfluxDB

$
0
0

@WeeBull wrote:

I’m having some problems with data getting into InfluxDB from homeassistant (0.100.2 using the official docker image). Some stuff is fine, appearing under climate.kitchen absolutely fine. The following query works fine.

    FROM homeassistant climate.landing WHERE SELECT field (current_temperature) mean () GROUP BY time ($__interval) fill (null)

What’s odd is that some sensors seem to be being placed under tables which are named after the units of measurement. For example, the data rates from my router are appearing under kbytes/sec and not sensor.mikrotik_router_kbyte_sec_received:

    FROM homeassistant kbyte/sec WHERE SELECT field (value) mean () GROUP BY time ($__interval) fill (linear)

This is also happening with other components measurements like heating power setting which is being sent to the table %

My YAML for influx DB is very simple:

    influxdb:
        host: localhost
        port: 8086
        database: homeassistant
        max_retries: 3

Am I missing some config to explicitly state how to name tables?

Posts: 2

Participants: 1

Read full topic

Snapcast multiple streams/zones

$
0
0

@kol wrote:

Is it possible to set multiple streams in Snapcast for Hassio? I could not find how do I use this option ‘-s’

SNAPSERVER_OPTS="-d -s pipe:///tmp/snapfifo?name=Radio&sampleformat=48000:16:2&codec=flac -s file:///home/user/Musik/Some%20wave%20file.wav?name=File"

or the stream option

[stream]
stream = pipe:///tmp/snapfifo?name=Radio&sampleformat=48000:16:2&codec=flac
stream = file:///home/user/Musik/Some%20wave%20file.wav?name=File

Posts: 1

Participants: 1

Read full topic

Viewing all 95295 articles
Browse latest View live


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