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

Reduce wasting storage and unnecessary SD/SSD wear

$
0
0

Most HA implementations run on Raspberry Pi’s with either SD card or SSD as storage. This is significant because disk space may be limited, the life expectancy of these devices is compromised by the number of write cycles, and large log files and databases slow down performance because system resources is not unlimited.
One would therefore expect that all focus would be on avoiding generating data and committing it to disk, but unfortunately the opposite is true. On installation the default for the HA core and integrations is to log “info” level data, but a better approach could be to initially log errors only. Users can then expand the logging to include additional (debug) info for the specific component where/when they encounter problems. Now users must search through forums and documentation to find solutions, where available.
Also the HA database is de-normalized, wasting a lot of space in repeating the same data over and over. For example, every entry in the “states” table for a sensor reading contains a large chunk of text with the sensor configuration (e.g. unit of measure, icon, friendly name etc).

Providing mechanisms to purge the data and truncate logfiles only addresses part of the problem, because all that data was already written to disk and reduced your DWPD/TBW before it is cleaned up.

Question is what we as users can do to reduce the pain and help protect our systems.
Any thoughts and advice you can share based on your experience?

3 posts - 2 participants

Read full topic


Trigger automation on tellstick event

$
0
0

I have a switch connected via a tellstick duo (433 MHz receiver)

I want to trigger on the event, but I can not manage to get the trigger to work. Anyone have any ideas of why this minimalistic trigger do not work. It seems very similar to how my deconz event triggers work.

Event:

{
    "event_type": "state_changed",
    "data": {
        "entity_id": "switch.hallway_remote",
        "old_state": {
            "entity_id": "switch.hallway_remote",
            "state": "on",
            "attributes": {
                "friendly_name": "Hallway Remote",
                "assumed_state": true
            },
            "last_changed": "2020-12-02T21:24:51.037782+00:00",
            "last_updated": "2020-12-02T21:24:51.037782+00:00",
            "context": {
                "id": "c457279172c653a9abc58d129eb500cc",
                "parent_id": null,
                "user_id": null
            }
        },
        "new_state": {
            "entity_id": "switch.hallway_remote",
            "state": "on",
            "attributes": {
                "friendly_name": "Hallway Remote",
                "assumed_state": true
            },
            "last_changed": "2020-12-02T21:24:52.235174+00:00",
            "last_updated": "2020-12-02T21:24:52.235174+00:00",
            "context": {
                "id": "90f42f37ce4dc6ca932dbde029ca1cd6",
                "parent_id": null,
                "user_id": null
            }
        }
    },
    "origin": "LOCAL",
    "time_fired": "2020-12-02T21:24:52.235174+00:00",
    "context": {
        "id": "90f42f37ce4dc6ca932dbde029ca1cd6",
        "parent_id": null,
        "user_id": null
    }
}

Trigger

alias: 433MHz Event Trigger Test
description: ''
trigger:
  - platform: event
    event_type: state_change
    event_data:
      entity_id: switch.hallway_remote

I also tried:

alias: 433MHz Event Trigger Test
description: ''
trigger:
  - platform: event
    event_type: state_change
    event_data:
      entity_id: switch.hallway_remote
      new_state:
        state: "on"

2 posts - 2 participants

Read full topic

RPGPIO not importing. Says can only be run on Raspberry Pi, but that's what I'm using

$
0
0

I added a GPIO switch in the configuration yaml like this:

switch:
  - platform: rpi_gpio
    ports:
      21:Downstairs LR

But when I start, the log gives the following error

2020-12-02 16:43:09 ERROR (MainThread) [homeassistant.bootstrap] Error setting up integration switch - received exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 827, in async_forward_entry_setup
    result = await async_setup_component(self.hass, domain, self._hass_config)
  File "/usr/src/homeassistant/homeassistant/setup.py", line 57, in async_setup_component
    return await setup_tasks[domain]  # type: ignore
  File "/usr/src/homeassistant/homeassistant/setup.py", line 64, in async_setup_component
    return await task  # type: ignore
  File "/usr/src/homeassistant/homeassistant/setup.py", line 174, in _async_setup_component
    processed_config = await conf_util.async_process_component_config(
  File "/usr/src/homeassistant/homeassistant/config.py", line 823, in async_process_component_config
    platform = p_integration.get_platform(domain)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 424, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 429, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/src/homeassistant/homeassistant/components/rpi_gpio/__init__.py", line 2, in <module>
    from RPi import GPIO  # pylint: disable=import-error
  File "/usr/local/lib/python3.8/site-packages/RPi/GPIO/__init__.py", line 23, in <module>
    from RPi._GPIO import *
RuntimeError: This module can only be run on a Raspberry Pi!

I’ve tried installing rpi.gpio_common using apt install.

I tried installing rpi.gpio using pip install. I’m fairly sure I have it installed, but it’s not working.

I have HA installed using docker on a Ras Pi 4. The base OS is Raspberry Pi OS, and I’m pretty sure its the 32-bit version, which from what I was reading is important it seems.

What can I do to troubleshoot this more?

1 post - 1 participant

Read full topic

Using ZWAVE stick on large server

$
0
0

I have my installation on a debian VM on my UNRAID server and it’s a 36 disker. So I can’t lug that around to pair zwave devices. Can I still use the usb stick? Or should I use it in a more portable pc? does it have to stay on that pc or can it be put back on the server? Not sure if the stick is tied to the devices it controls.
MY ISY994 z-wave dongle died and I don’t want to use the ISY anymore.

1 post - 1 participant

Read full topic

Automation: Run script on 2nd button click

$
0
0

HI Everyone!

I 'm trying to configure an automation to run different actions on different button clicks.

  • I have a script that works great if triggered from the UI;
  • I have a Shelly Button 1 device.

After configuring the following automation:

alias: AUTOMATION_SCRIPT_OFFICE_WORK_LIGHTS_TOGGLE
description: Run Script to toggle office lights on button 2x press
trigger:
  - platform: numeric_state
    entity_id: binary_sensor.shelly_for_ha_shbtn_1_483fda6fe510_switch
    attribute: click_count
    above: '1'
    below: '3'
    value_template: '2'
condition: []
action:
  - service: script.script_office_work_lights
    data: {}
mode: queued
max: 3

The script only runs the first time. No matter what I do, how long I wait, it will not work again, unless I edit the automation and save it.

Doesn’t make any sense to me… Appreciate your help.

Thank you in advance.

2 posts - 2 participants

Read full topic

Moved Home Assistant from Docker to Virtulalbox

$
0
0

For the life of me I can’t get my devices to connect to my MQTT broker. I moved my setup from a docker container to a Virtualbox setup. The IP changed so I went to my devices and updated the MQTT to point to the HA on Virtualbox but the devices say they can’t connect.

23:09:28 MQT: Attempting connection…
23:09:33 MQT: Connect failed to 192.168.7.177:1883, rc -2. Retry in 10 sec

I did not change the password or the username. I even removed the MQTT integration and setup from scratch. Still can’t figure it out.

Any thoughts from the community.

1 post - 1 participant

Read full topic

Zigbee and MQTT - setup and (un)supported devices

$
0
0

Hi,

I’m sorry for a probably stupid question, because I’m a total newbie in HA. I studied how Zigbee network works and it seems to fulfill my needs. I don’t want something controlled over a cloud. Instead I want something, which operates locally.

I guess the sue of the flashed CC2531 could be the right solution for me. And this should serve as the coordinator. Or is there a better choice for a device, that should work as a coordinator? I plan to use a NUC type mini PC with Ubuntu Linux, if it matters.

The next question is, if only those devices listed on the https://www.zigbee2mqtt.io/ webpage work, or if others might work too, but it is not guaranteed. For example I would like to use this dimmer: https://www.aliexpress.com/item/1005001499921065.html. What are the chances it will work?

Thank you!

1 post - 1 participant

Read full topic

Zigbee compatibility

$
0
0

Hi!
I`m just starting with HA world. I have some SonOff devices here in my house (switchs) and I just ordered some Xiaomi Philips downlight (all Wifi).
I have a new install of HA and I’m trying to understand all this systems.
Now I’m looking for some Zigbee devices, probabily temperature sensors. My question is: if I buy an Tuya zigbee gateway, can I use Xiaomi zigbee devices with this gateway?

Also: what’s the best option (gateway model) to work with xiaomi/aqara/tuya sensors and HA? I’have read that Xiaomi gateway 3 is not compatible with HA, right? So what’s the better option to buy in AliExpress?
I must mention this (AliExpress) because I’m from Brazil and I don’t have access to most of US stores.

1 post - 1 participant

Read full topic


Automation condition for physical switch press

$
0
0

I’m having a hard time finding info on this…
I’d like to set an automation up to run only if triggered by the physical switch.

For example:
Trigger: Switch On
Condition: “it wasn’t done by home assistant or another automation” OR “it WAS done by the physical device”

The specific switch I’m looking at is an inovelli NZW31 (black), using ozw beta (so it’s using MQTT). Any pointers would be appreciated, thanks!

1 post - 1 participant

Read full topic

Crazy problem with google_translate_say

$
0
0

I have a couple of HA automations that respond to a Google voice command and read out the values of various household sensors. Lately the response has been very erratic, and a couple of days ago it quit working entirely. The problem is that google_translate_say is reporting a generic unspecific error. The first few time it worked again after restarting HA, but now that doesn’t help. However several other routines I have in Node Red that use google_translate_say continue to work just fine. So I figured I would try recreating the failing automaton in Node Red.
Only to encounter a very strange problem! If I create a new node using google_translate_say in Node Red, it fails with an api error. But if I copy one of my existing nodes that uses google_translate_say, it works fine. Until I modify the text of the message even slightly - then it fails too.The settings of the new and old nodes are identical, but the new one fails and a copy of the old one doesn’t!
I thought it might be some kind of new fault with Node Red linking to Home Assistant that only affects a new node, since I haven’t had occasion to restart Node Red for a few weeks. But I have restarted Home Assistant many times, so that doesn’t feel like the right explanation.
Any ideas?

1 post - 1 participant

Read full topic

Tasker Owntracks Webapi HTTP Post Error

$
0
0

Hi,

I am using following HTTP Post to Update my Location via Tasker.

<Str sr="arg0" ve="3">https://xxx.xxx.org</Str>
<Str sr="arg1" ve="3">/api/webhook/xxxxx</Str>
<Str sr="arg2" ve="3">{"_type":"location","tid":"lc","acc":%LOCACC,"batt":"%BATT","lat":"%LOC1","lon":"%LOC2","t":"u","tst":"%LOCTMS","vel":"%LOCSPD","alt":"%LOCALT","topic":"owntracks/xxx/xxx"}</Str>

But getting following error in the Home Assistant Log:

Exception in async_handle_message when dispatching 'owntracks': (<homeassistant.core.HomeAssistant object at 0x7f76601978b0>, <homeassistant.components.owntracks.OwnTracksContext object at 0x7f765d4cf2e0>, {'_type': 'location', 'tid': 'lc', 'acc': 6.43, 'batt': '90', 'lat': 'x.xxxxx', 'lon': 'x.xxxxx', 't': 'u', 'tst': 'xxxx', 'vel': '0.0', 'alt': 'xxx.xxx', 'topic': 'owntracks/xxx/xxx'}) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/owntracks/messages.py", line 394, in async_handle_message await handler(hass, context, message) File "/usr/src/homeassistant/homeassistant/components/owntracks/messages.py", line 199, in async_handle_location_message context.async_see(**kwargs) File "/usr/src/homeassistant/homeassistant/components/owntracks/device_tracker.py", line 43, in _receive_data entity.update_data(data) File "/usr/src/homeassistant/homeassistant/components/owntracks/device_tracker.py", line 151, in update_data self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 296, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 320, in _async_write_ha_state sstate = self.state File "/usr/src/homeassistant/homeassistant/components/device_tracker/config_entry.py", line 104, in state zone_state = zone.async_active_zone( File "/usr/src/homeassistant/homeassistant/components/zone/__init__.py", line 112, in async_active_zone zone_dist = distance( File "/usr/src/homeassistant/homeassistant/util/location.py", line 74, in distance result = vincenty((lat1, lon1), (lat2, lon2)) File "/usr/src/homeassistant/homeassistant/util/location.py", line 99, in vincenty U1 = math.atan((1 - FLATTENING) * math.tan(math.radians(point1[0]))) TypeError: must be real number, not str 

What did I miss here ?

1 post - 1 participant

Read full topic

Envisalink 4 and HA - Notify me when alarm is triggered?

$
0
0

I am currently setup with Envisalink 4 and HA. I have already set up basic configurations but I was wondering if I can configure HA to notify me when the alarm is triggered.

At this moment, only the oneyez app notifies me at the event the alarm is triggered but I rather not use oneyez.

1 post - 1 participant

Read full topic

Got notification my Firebase database will be deleted?

$
0
0

Hi all, I believe the Firebase account I have with Google is for the HTML5 notificatiosn I have setup, but I just got an email that says I haven’t used it in 6 months (weird…) and that it’s going to be deleted?

Is anyone else getting this? There’s also a note about if I created the project back in 2017 or prior it may have auto-provisioned a database for me, but I didn’t setup HTML5 notifications until last year, but have been tinkering with HomeAssistance since 2017 and prior, is there another integration that had a Firebase setup that I might be overlooking?

I’m trying to either fix this so it’s not auto-deleted and making more work for me, or figure out what it was so I can safely ignore, thanks in advance!!!

1 post - 1 participant

Read full topic

Assistance with lock-manager

$
0
0

Does anyone have any experience with Home Assistant lock-manager by FutureTense ?

I’ve spent two days now trying to install it unsuccessfully for my Schlage BE468 locks, following the README instructions exactly each time.

  • I installed lock-manager via HACS
  • I created an integration for my first Schlage lock lock.basementdoor_locked_2_basementdoor
  • I didn’t see a “user code” entity (" sensor.be469zp_connect_smart_deadbolt_user_code ") as referenced in the instructions so when it asks for User Code Sensor from the pull-down, I select the one it suggested (sensor.basementdoor_alarm_level_basementdoor)
  • I copied the code from basementdoor_lovelace and add it to my Lovelace UI.
  • In the HACS “Frontend” menu, I added the (3) required modules: lovelace-auto-entities, lovelace-card-tools, and lovelace-fold-entity-row.
  • In my configuration.yaml file, I added both the input_boolean: and binary_sensor: entries.

When I look at my Lovelace dashboard, all lock code entries say things like " Entity not available: input_text.basementdoor_name_1 ", " Entity not available: input_text.basementdoor_pin_1 ", " Entity not available: input_boolean.enabled_basementdoor_1 ", " Entity not available: input_boolean.notify_basementdoor_1 ", " Entity not available: sensor.connected_basementdoor_1 " ( …amongst some others in the debug section… )

I attempted to remove the lock and add it back to via HASS Z-Wave to see if it would add any different / missing entities, however it just added back the same 9 that were associated the first time.

I’ve repeated the instructions so many times. It seems as though the integration addition should possibly be adding more entities that aren’t being added, maybe? It only ever adds code slot entities, sensor.basement_code_slot_1

Does anyone have any idea for what I might be doing wrong here?

2 posts - 1 participant

Read full topic

Trouble with Google TTS automation

$
0
0

I have a weird scenario with my Google TTS. I have an automations that plays through my Google Nest Speakers “alarm has been disarmed” when I disarm my alarm and “alarm has been armed” when I arm my alarm. This worked for well over a year. Now, the “alarm has been disarmed” works but the “alarm has been armed does not”. The automations are written the same way.

Alarm has been disarmed automation

- id: '1533774446424'
  alias: TTS for Alarm Disarmed
  trigger:
  - entity_id: alarm_control_panel.ha_alarm
    from: armed_home
    platform: state
    to: disarmed
  - entity_id: alarm_control_panel.ha_alarm
    from: armed_away
    platform: state
    to: disarmed
  - entity_id: alarm_control_panel.ha_alarm
    from: pending
    platform: state
    to: disarmed
  - entity_id: alarm_control_panel.ha_alarm
    from: triggered
    platform: state
    to: disarmed
  condition: []
  action:
  - data:
      entity_id:
      - media_player.living_room_speaker
      - media_player.basement_speaker
      - media_player.master_bedroom_speaker
      volume_level: 0.5
    service: media_player.volume_set
  - data:
      message: Alarm has been disarmed.
    entity_id: media_player.living_room_speaker
    service: tts.google_say
  - data:
      message: Alarm has been disarmed.
    entity_id: media_player.basement_speaker
    service: tts.google_say

Alarm has been armed automation

- id: '1606974128581'
  alias: TTS for Alarm Armed
  description: ''
  trigger:
  - platform: state
    entity_id: alarm_control_panel.ha_alarm
    from: disarmed
    to: pending
  condition: []
  action:
  - service: media_player.volume_set
    data:
      volume_level: 0.5
    entity_id: media_player.living_room_speaker
  - service: media_player.volume_set
    data:
      volume_level: 0.5
    entity_id: media_player.basement_speaker
  - data:
      message: Alarm has been armed.
    entity_id: media_player.living_room_speaker
    service: tts.google_say
  - data:
      message: Alarm has been armed.
    entity_id: media_player.basement_speaker
    service: tts.google_say
  mode: single

I can’t find a single difference in the automation code, but the arming one doesn’t work. Even if I execute it manually. I also get this log error when executing the “alarm has been armed” automation

Logger: homeassistant.components.tts
Source: components/tts/init.py:172
Integration: Text-to-Speech (TTS) (documentation, issues)
First occurred: 11:47:16 PM (6 occurrences)
Last logged: 11:49:01 PM

Error on init TTS: No TTS from google_translate for ‘Alarm has been armed.’

Can anyone point me in the right direction to fix this?

1 post - 1 participant

Read full topic


Overview hass icons

$
0
0

Is anywehre an overview of all hass-icons available?
(similar as on the mdi-icon page)?

1 post - 1 participant

Read full topic

Mqtt autodiscovery

$
0
0

I completly confused about mqtt auto-discovery. What does it means an how does it works?

I’ve several shelly switches an sensors in use, all with mqtt, but none of them appear automatic as entity in HA. That’s what I understand under “auto-discovery”

As I read [here](MQTT non-autodiscovery lights/switches as devices? - Configuration - Home Assistant Community (home-assistant.io)) other use automations to “auto-disvoer” the mqtt entities. (what ist auto, when I have to put alls information for ech singe entity in an automation)?

For the moment I’ve set up all my mqtt devices in a normal config.yaml file, and this works without any problem and then and then I see these entities in the entitiy list:

I’m confused… :woozy_face:

my config:

configuration.yaml

homeassistant:
  packages: !include_dir_named integrations/

sensor: !include_dir_merge_list sensors/
light: !include_dir_list lights/

mqtt-config in directory integrations/

mqtt:
  discovery: true
#  discovery_prefix: homeassistant

shelly_sensor.yaml in directroy sensors/

# configuration Shelly Sensors
  - platform: mqtt
    name: "shelly-button-wohnen-batt"
    state_topic: shellies/shellybutton1-D8F15B154F21/sensor/battery
    unit_of_measurement: "%"
  - platform: mqtt
    unique_id: shelly_sensor_win_keller1
    name: "shelly-window-keller1-status"
    state_topic: "shellies/shellydw2-A4CF12F42D61/sensor/state"
    icon: "mdi:window-open-variant"
  - platform: mqtt
    name: "shelly-window-keller1-vibration"
    state_topic: "shellies/shellydw2-A4CF12F42D61/sensor/vibration"
    icon: "mdi:vibrate"
  - platform: mqtt
    name: "shelly-window-keller1-lux"
    state_topic: "shellies/shellydw2-A4CF12F42D61/sensor/lux"
    icon: "mdi:globe-light"
    unit_of_measurement: "lux"
  - platform: mqtt
    name: "shelly-window-keller1-batt"
    state_topic: "shellies/shellydw2-A4CF12F42D61/sensor/battery"
    unit_of_measurement: "%"
  - platform: mqtt
    name: "shelly-window-keller1-temp"
    state_topic: "shellies/shellydw2-A4CF12F42D61/sensor/temperature"
    unit_of_measurement: "°C"
  - platform: mqtt
    name: "shelly-window-keller1-tilt"
    state_topic: "shellies/shellydw2-A4CF12F42D61/sensor/tilt"
    icon: "mdi:arrow-top-right"
  - platform: mqtt
    name: "shelly-window-keller1-illumination"
    state_topic: "shellies/shellydw2-A4CF12F42D61/sensor/illumination"
    icon: "mdi:brightness-6"
  - platform: mqtt
    name: "shelly-water-heizung-batt"
    state_topic: "shellies/shellyflood-C8A7C2/sensor/battery"
    unit_of_measurement: "%"
  - platform: mqtt
    name: "shelly-water-heizung-temp"
    state_topic: "shellies/shellyflood-C8A7C2/sensor/temperature"
    unit_of_measurement: "°C"   
  - platform: mqtt
    name: "shelly-water-heizung-status"
    state_topic: "shellies/shellyflood-C8A7C2/sensor/flood"
    icon: "mdi:water-alert"
  - platform: mqtt
    name: "shelly-ht-hasenstall-temp"
    state_topic: "shellies/shellyht-957402/sensor/temperature"
    unit_of_measurement: "°C"    
  - platform: mqtt
    name: "shelly-ht-hasenstall-hum"
    state_topic: "shellies/shellyht-957402/sensor/humidity"
    icon: "mdi:water-percent"
    unit_of_measurement: "%"
  - platform: mqtt
    name: "shelly-ht-hasenstall-batt"
    state_topic: shellies/shellyht-957402/sensor/battery
    unit_of_measurement: "%"
  - platform: mqtt
    name: "shelly-ht-keller-temp"
    state_topic: "shellies/shellyht-955504/sensor/temperature"
    unit_of_measurement: "°C"    
  - platform: mqtt
    name: "shelly-ht-keller-hum"
    state_topic: "shellies/shellyht-955504/sensor/humidity"
    icon: "mdi:water-percent"
    unit_of_measurement: "%"
  - platform: mqtt
    name: "shelly-ht-keller-batt"
    state_topic: shellies/shellyht-955504/sensor/battery
    unit_of_measurement: "%"  
  - platform: mqtt
    name: "shelly-ht-schlafzimmer-temp"
    state_topic: "shellies/shellyht-F4466F/sensor/temperature"
    unit_of_measurement: "°C"    
  - platform: mqtt
    name: "shelly-ht-schlafzimmer-hum"
    state_topic: "shellies/shellyht-F4466F/sensor/humidity"
    icon: "mdi:water-percent"
    unit_of_measurement: "%"
  - platform: mqtt
    name: "shelly-ht-schlafzimmer-batt"
    state_topic: shellies/shellyht-F4466F/sensor/battery
    unit_of_measurement: "%"

2 example files in directory lights/

  platform: mqtt
  name: "shelly_1pm_buero_mqtt"
  state_topic: "shellies/shelly1pm-A4CF12F3FB52/relay/0"
  command_topic: "shellies/shelly1pm-A4CF12F3FB52/relay/0/command"
  payload_on: "on"
  payload_off: "off"
  retain: true
  platform: mqtt
  name: "shelly_1pm_carmen_zimmer_mqtt"
  state_topic: "shellies/shelly1pm-A4CF12F3FA2C/relay/0"
  command_topic: "shellies/shelly1pm-A4CF12F3FA2C/relay/0/command"
  payload_on: "on"
  payload_off: "off"
  retain: true

1 post - 1 participant

Read full topic

Mqtt discovery unreliable

$
0
0

I’m using mqtt dscovery very short time. I always prefer fixed settings. Now I gave it a go to it because of default settings of zigbee2mqtt.
I have a zigbee switch connected through zigbee2mqtt. The switch is configured but disconnected from power supply (it’s not powered on). So it’s not available in zigbee network therefore should be unavailable. And indeed it is how z2m reports it to mqtt

Here is how it looks like in mqtt:
homeassistant/switch/0x00158d000449dccc/switch/config

{
  "availability": [
    {
      "topic": "zigbee2mqtt/bridge/state"
    },
    {
      "topic": "zigbee2mqtt/zb_switch1/availability"
    }
  ],
  "command_topic": "zigbee2mqtt/zb_switch1/set",
  "device": {
    "identifiers": [
      "zigbee2mqtt_0x00158d000449dccc"
    ],
    "manufacturer": "Nue / 3A",
    "model": "Smart in-wall switch (HGZB-01A)",
    "name": "zb_switch1",
    "sw_version": "Zigbee2MQTT 1.16.1"
  },
  "json_attributes_topic": "zigbee2mqtt/zb_switch1",
  "name": "zb_switch1_switch",
  "payload_off": "OFF",
  "payload_on": "ON",
  "state_topic": "zigbee2mqtt/zb_switch1",
  "unique_id": "0x00158d000449dccc_switch_zigbee2mqtt",
  "value_template": "{{ value_json.state }}"
}

Availability is set to offline:
obrazek

But for some reason, HA still things it’s available and switched on:
obrazek

History book:

The times likely corresponds with Z2M restarts. It turns unavailable and after few seconds turns on. But where the HA picks state and availability from, if the data in MQTT shows that device is unavailable. There is no even data about state=on.

1 post - 1 participant

Read full topic

I'm losing my mind... I mean Memory

$
0
0

So I feel a lot like Hal fixing the light right now… I have been dealing with this memory leak for months. Exactly an hour from the minute I have a reboot, I will get these memory spikes that continue to add up until every few days my swap would fill up and the system would go unresponsive.

At first I thought it was a big deal, and was pulling my hair out to try and figure it out, but like any good HASS user, I simply figure out a way around the problem and had the system reboot itself when it got filled up enough.

12-2-20
Cut to the beginning of this week when everything has been relatively stable for months, new WLED Christmas decorations are up and doing their thing, automations are running seamlessly, WAF is very very high and I thought “Now would be a good time to go debug that memory issue I was having.” Well, I was wrong, so so wrong.

Over the course of the past few days I have slowly one by one disabled every single integration, completely removed HACS, turned off nearly everything (see below), and now nothing around the house is “doing that magic thing” but I am still getting that memory spike every hour on the hour and the leak. is. still. happening.

I don’t know what to do. I ran profiler.start_log_objects over a spike and got the following:

Logger: homeassistant.components.profiler
Source: components/profiler/__init__.py:221


Integration: Profiler ([documentation](https://www.home-assistant.io/integrations/profiler), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+profiler%22))
First occurred: 2:14:21 AM (32 occurrences)
Last logged: 2:29:31 AM

* Memory Growth: [('weakref', 10304, 2), ('set', 3049, 2), ('partial', 54, 1), ('FutureIter', 7, 1), ('Template', 17, 1), ('tuple_iterator', 2, 1), ('dict_itemiterator', 1, 1), ('chain', 1, 1)]
* Memory Growth: []
* Memory Growth: [('tuple', 32912, 1)]
* Memory Growth: [('tuple', 32920, 8), ('MimeType', 17, 1), ('MultiDictProxy', 19, 1), ('MultiDict', 19, 1)]
* Memory Growth: [('cell', 22067, 60), ('tuple', 32941, 21), ('weakref', 10325, 21), ('function', 44160, 10), ('HassJob', 317, 3), ('Event', 237, 2), ('set', 3050, 1)]

but honestly am not sure what I’m looking at here nor if it’s even indicative of what’s going on. So I’m throwing myself on the mercy of the community, please help me wrangle and patch this leak. I don’t want to go into the holidays unautomated.

Also for the record, I DO have a backup and can/will roll back if I have to my every few night reboot, but I’d really rather just get this sonuvabitch nailed while I have the system at its most barebones.

RPi3 B+, only current integration is the mobile app, the only currently running add-ons are MariaDB and Nginx Proxy Manager.

1 post - 1 participant

Read full topic

Rounding dilemma...leave .5 but remove .0

$
0
0

I’d like the following to return just “xx” if it’s xx.0 but leave xx.5 as xx.5. Possible?

The living room is currently {{ state_attr("climate.living_room","current_temperature")|round(1,"half") }} degrees

2 posts - 2 participants

Read full topic

Viewing all 106467 articles
Browse latest View live


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