Giter Site home page Giter Site logo

home-assistantconfig's People

Contributors

djebouh avatar kptnkman avatar notoriousbdg avatar rbflurry avatar sjabby avatar techwithjake avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

home-assistantconfig's Issues

Invalid state encountered for entity id: sensor.philippe_smartphone_battery. State max length is 255 characters.

I have update to version 1.11 and now I have trouble with battery sensor created from device_trackers:

homeassistant.exceptions.InvalidStateError: Invalid state encountered for entity id: sensor.philippe_smartphone_battery. State max length is 255 characters.
2018-08-23 19:46:33 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 282, in async_update_ha_state
    self.entity_id, state, attr, self.force_update, context)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/core.py", line 853, in async_set
    context)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/core.py", line 623, in __init__
    "State max length is 255 characters.").format(entity_id))
homeassistant.exceptions.InvalidStateError: Invalid state encountered for entity id: sensor.philippe_smartphone_battery. State max length is 255 characters.

MQTT info:

homeassistant/sensor/philippe_smartphone_battery/config {
  "device_class": "battery",
  "name": "Philippe Smartphone Battery",
  "state_topic": "homeassistant/sensor/philippe_smartphone_battery/state",
  "unit_of_measurement": "%",
  "value_template": "{{ value_json.value | int }}",
  "unique_id": "philippe_smartphone_battery",
  "json_attributes": [
    "entity_id",
    "attribute",
    "mqtt_config_topic",
    "mqtt_state_topic"
  ]
}
homeassistant/sensor/philippe_smartphone_battery/state {
  "value":47,
  "entity_id": "device_tracker.philippe_smartphone",
  "attribute": "battery",
  "mqtt_config_topic": "homeassistant/sensor/philippe_smartphone_battery/config",
  "mqtt_state_topic": "homeassistant/sensor/philippe_smartphone_battery/state"
}

disable entity creation wildcard

First of all, very convenient addon to use!

I have a lot of similar entities for which I don't want an entity being created. Usage of wildcards or regular expressions would really help with that instead of keeping a long list. Especially with zigbee2mqtt where every battery operated device has a status, link quality and battery level entity where I get 3x a battery per device.. Excluding everything with link quality and status would really help!

Template warnings under 2022.2.9

a couple of warnings in 2022.2.9 (and previous 2022.x versions)

2022-02-27 18:00:00 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'int' got invalid input 'unknown' when rendering template '{% macro battery_level() %} {% for entity_id in states.group.battery_status.attributes.entity_id if (
  not (
        is_state_attr(entity_id, 'battery_alert_disabled', true)
        or is_state_attr(entity_id, 'restored', true)
      )
  and states(entity_id) is not none
  and (
    (
      (
        states(entity_id) is number
        or states(entity_id) | length == states(entity_id)| int | string | length
        or states(entity_id) | length == states(entity_id)| float | string | length
      )
      and states(entity_id) | int < states.input_number.battery_alert_threshold_max.state | int
      and states(entity_id) | int > states.input_number.battery_alert_threshold_min.state | int
    )
    or states(entity_id) | lower == 'low'
    or states(entity_id) | lower == 'unknown'
    or states(entity_id) | lower == 'unavailable'
  )
) -%}
  {{ state_attr(entity_id, "friendly_name") }} ({{ states(entity_id) }})
{% endfor -%} {% endmacro %} {{ battery_level() }}' but no default was specified. Currently 'int' will return '0', however this template will fail to render in Home Assistant core 2022.1
2022-02-27 18:00:00 WARNING (MainThread) [homeassistant.helpers.template] Template warning: 'float' got invalid input 'unknown' when rendering template '{% macro battery_level() %} {% for entity_id in states.group.battery_status.attributes.entity_id if (
  not (
        is_state_attr(entity_id, 'battery_alert_disabled', true)
        or is_state_attr(entity_id, 'restored', true)
      )
  and states(entity_id) is not none
  and (
    (
      (
        states(entity_id) is number
        or states(entity_id) | length == states(entity_id)| int | string | length
        or states(entity_id) | length == states(entity_id)| float | string | length
      )
      and states(entity_id) | int < states.input_number.battery_alert_threshold_max.state | int
      and states(entity_id) | int > states.input_number.battery_alert_threshold_min.state | int
    )
    or states(entity_id) | lower == 'low'
    or states(entity_id) | lower == 'unknown'
    or states(entity_id) | lower == 'unavailable'
  )
) -%}
  {{ state_attr(entity_id, "friendly_name") }} ({{ states(entity_id) }})
{% endfor -%} {% endmacro %} {{ battery_level() }}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2022.1

there are also a couple of errors

2022-02-27 17:58:00 ERROR (MainThread) [homeassistant.components.automation.update_battery_status_group_members] update_battery_status_group_members: Error executing script. Invalid data for call_service at pos 1: Entity ID  is an invalid entity ID for dictionary value @ data['entities']
2022-02-27 17:58:00 ERROR (MainThread) [homeassistant.components.automation.update_battery_status_group_members] Error while executing automation automation.update_battery_status_group_members: Entity ID  is an invalid entity ID for dictionary value @ data['entities']

this is with the fixes in pull request #33 added.

Ikea tradfri Simple dimmer battery status is not showing

I have 2 tradfri remote.
1 Wireless dimmer
2 Remote control

The battery sensor for the remote control is created and showing up. The battery for for the wireless dimmer is not showing up.

The Wireless dimmer is in the entity list of home assistant

'''

sensor.tradfri_wireless_dimmer 87 battery_level: 87 model_number: TRADFRI wireless dimmer power_source: Battery manufacturer: IKEA of Sweden firmware_version: 1.2.248 serial: friendly_name: TRADFRI wireless dimmer unit_of_measurement: %

'''

Reacts to titles with batteries in them:

Neo CoolCam Battery Powered PIR Sensor Luminance (22.0)

This shows up when i set my "Max" over 22. Seems like it reacts to "Battery" in the name of the node?

MQTT based sensors are not created?

Hey guys
I still have this package installed in my HA 2021.6.6
I can see that it was updated not so long ago, so I hope that it's still working.
I have two 'MQTT alarmpanel' by ThanksMister installed.
They, like the Wallpanel by ThanksMister, integrate to HA with MQTT.
Looking in MQTT with MQTT Explorer, I see this entry for one of the panels:

image

So for me that looks good.
But I don't see a battery entry created in HA.

I have the

configuration.yaml

mqtt: !include mqtt.yaml

mqtt.yaml:

  discovery: true
  discovery_prefix: homeassistant

What have I missed?

Error doing job: Task exception was never retrieved

Hello,

I'm using your package for a while now. Today i've updated to the lastest version and getting errors like the one below.

Any idea how to handle?:

Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 313, in async_update_ha_state self.entity_id, state, attr, self.force_update, self._context) File "/usr/local/lib/python3.6/site-packages/homeassistant/core.py", line 853, in async_set context) File "/usr/local/lib/python3.6/site-packages/homeassistant/core.py", line 623, in __init__ "State max length is 255 characters.").format(entity_id)) homeassistant.exceptions.InvalidStateError: Invalid state encountered for entity id: sensor.fibaro_system_fgms001_motion_sensor_battery_2. State max length is 255 characters.

Devices with battery_alert_disabled set are not filtered out

First, thanks for the package, very well done and useful.

My ios phones defined are coming with a "sensor.xxxxx_battery_level" sensor which is well detected by "automation.update_battery_status_group_members". On the other hand, I want to filter them out and they are not.

I think this is because the following condition " not is_state_attr(entity_id, 'battery_alert_disabled', true)" should apply to any item and not only to the ones with battery in their name. Indeed ios phones objects have a battery icon and are therefore matching
the condition "or 'battery' in item.attributes.icon | lower"

I aso think " not is_state_attr(entity_id, 'battery_alert_disabled', true)" should in fact test item.entity_id.

Error in the LOG

Logger: homeassistant.components.hassio
Source: components/hassio/init.py:420
Integration: Hass.io (documentation, issues)
First occurred: 22:45:00 (1 occurrences)
Last logged: 22:45:00

expected a dictionary for dictionary value @ data['packages']['automation']

System Health

version core-2021.2.3
installation_type Home Assistant OS
dev false
hassio true
docker true
virtualenv false
python_version 3.8.7
os_name Linux
os_version 5.4.83-v7
arch armv7l
timezone Europe/Kiev
Home Assistant Community Store
GitHub API ok
Github API Calls Remaining 4997
Installed Version 1.11.2
Stage running
Available Repositories 746
Installed Repositories 5
Hass.io
host_os Home Assistant OS 5.11
update_channel stable
supervisor_version supervisor-2021.02.6
docker_version 19.03.13
disk_total 28.6 GB
disk_used 9.7 GB
healthy true
supported true
board rpi3
supervisor_api ok
version_api ok
installed_addons Samba share (9.3.0), File editor (5.2.0), Home Assistant Google Drive Backup (0.103.1), InfluxDB (4.0.3), Grafana (6.1.1), ESPHome (1.16.0), Mosquitto broker (5.1), MariaDB (2.2.1), ADB - Android Debug Bridge (0.7.0), phpMyAdmin (0.2.0), Terminal & SSH (9.0.1)
Lovelace
dashboards 2
resources 14
views 11
mode yaml

Entity with battery_alert_disabled: true still notifies

Hi,

Thanks for this great package. Gives great insights on all of my battery powered devices!
I added information of my car to Home Assistant which also has some battery info which is irrelevant to be notified about. So I looked up the battery_alert_disabled: true customization, but I still receive notifications on the notify.notify notifier.

Example of my customize.yaml:

sensor.last_trip_average_electric_consumption:
  battery_alert_disabled: 'true'

Thanks for your help!

Battery Level unknown

I have a device using zanzitto to publish the battery info, the device isn't often used resulting in a value 'unknown'.

HA constantly shows Tablet Battery (Unknown), is there a way to filter out the 'unknown' value from the notification message?

Template Warnings under 2021.10.x

The following warning appears (many times) under 2021.10, and says that the template will no longer work under 2021.12:

Template warning: 'float' got invalid input 'Not Charging' when rendering template '{% macro battery_level() %} {% for entity_id in states.group.battery_status.attributes.entity_id if ( not is_state_attr(entity_id, 'battery_alert_disabled', true) and states(entity_id) is not none and ( ( ( states(entity_id) is number or states(entity_id) | length == states(entity_id)| int | string | length or states(entity_id) | length == states(entity_id)| float | string | length ) and states(entity_id) | int < states.input_number.battery_alert_threshold_max.state | int and states(entity_id) | int > states.input_number.battery_alert_threshold_min.state | int ) or states(entity_id) | lower == 'low' or states(entity_id) | lower == 'unknown' or states(entity_id) | lower == 'unavailable' ) ) -%} {{ state_attr(entity_id, "friendly_name") }} ({{ states(entity_id) }}) {% endfor -%} {% endmacro %} {{ battery_level() | trim == "" }}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2021.12

Avoid battery sensor creation for plant entities

A plant (https://www.home-assistant.io/integrations/plant/) entity will falsely trigger the creation of a battery entity from attribute. Please exclude, by design a battery entity must exist that feeds into the plant entity.
Would have created a PR but wasn't sure how to check for entity type.

Example:

"plant.gruenlilie":

problem: 'moisture low, conductivity low'
sensors:
  moisture: sensor.gruenlilie_moisture
  battery: sensor.gruenlilie_battery
  temperature: sensor.gruenlilie_temperature
  conductivity: sensor.gruenlilie_conductivity
  brightness: sensor.gruenlilie_light
unit_of_measurement_dict:
  brightness: lux
  temperature: °C
  moisture: '%'
  conductivity: µS/cm
  battery: '%'
moisture: 3
battery: 95
temperature: 20.9
conductivity: 11
brightness: 76
max_brightness: 76
friendly_name: Grünlilie

help

Hi,
I tried to copy and paste your package file in my HA but when I tried to check it a lot of errors comes out.
Is something that I have to change inside the battery_alert.yaml file ?
tnx

Homematic IP Devices with Battery Levels are not recognized

First: awesome work, it's the best battery alert solution I found on the internet.

My issue: I have a bunch of Homematic IP Devices with Battery Info.

At the Moment, all of them report "Normal" as state, but no integer that's why I believe they are not recognized by the script and hidden in the UI
And I think they won't trigger an alert.

How could I solve this?

template warnings under 2021.4.x

2021-04-09 13:17:00 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'mappingproxy object' has no attribute 'icon' when rendering '{%- for item in states.sensor if (.....

Warning is created in the update_battery_status_group_members automation

Entity ID is an invalid entity

Hi,

Anyone noticed issues since the upgrade to home-assistant 0.87 with errors like the following:

ERROR (MainThread) [homeassistant.components.automation] Error while executing automation automation.update_battery_status_group_members. Invalid data for call_service at pos 1: Entity ID is an invalid entity id for dictionary value @ data['entities']

None of the previous auto-created sensor.battery_* are created show up in the battery status panel.

I wonder if it's something to do with the new entity registry?

MQTT broker still seems to be publishing correct information...

David

Error in the LOG

Sometime i will receive this error in the log:

2020-01-04 05:00:00 INFO (MainThread) [homeassistant.helpers.script] Script battery_persistent_notification_clear: Test condition template: False
2020-01-04 05:15:00 ERROR (MainThread) [homeassistant.helpers.condition] Error during template condition: UndefinedError: 'None' has no attribute 'attributes'
2020-01-04 05:15:00 INFO (MainThread) [homeassistant.helpers.script] Script battery_persistent_notification_clear: Test condition template: False
2020-01-04 05:30:00 ERROR (MainThread) [homeassistant.helpers.condition] Error during template condition: UndefinedError: 'None' has no attribute 'attributes'
2020-01-04 05:30:00 INFO (MainThread) [homeassistant.helpers.script] Script battery_persistent_notification_clear: Test condition template: False
2020-01-04 05:45:00 ERROR (MainThread) [homeassistant.helpers.condition] Error during template condition: UndefinedError: 'None' has no attribute 'attributes'
2020-01-04 05:45:00 INFO (MainThread) [homeassistant.helpers.script] Script battery_persistent_notification_clear: Test condition template: False
2020-01-04 06:00:00 ERROR (MainThread) [homeassistant.helpers.condition] Error during template condition: UndefinedError: 'None' has no attribute 'attributes'
2020-01-04 06:00:00 INFO (MainThread) [homeassistant.helpers.script] Script battery_persistent_notification: Test condition template: False
2020-01-04 06:00:00 ERROR (MainThread) [homeassistant.helpers.condition] Error during template condition: UndefinedError: 'None' has no attribute 'attributes'

There is a way to solve the problem?

is an invalid entity ID for dictionary value @ data['snapshot_entities']

When trying to create an automation i keep receiving this error:

SmartSelect_20221117_020552_Chrome

The yaml code for this automatisation is:
`alias: Telenet Test pauze
description: ""
trigger:

  • platform: state
    entity_id:
    • media_player.telenettvbox
    • media_player.tvliving
      from: playing
      to: paused
      condition: []
      action:
  • service: scene.create
    data:
    scene_id: voorpauze
    snapshot_entities: light.spots_keuken light.lichtbak_keuken
  • delay:
    hours: 0
    minutes: 0
    seconds: 2
    milliseconds: 0
  • service: scene.turn_on
    target:
    entity_id: scene.tv_pauze
    metadata: {}
  • wait_for_trigger:
    • platform: state
      entity_id:
      • media_player.telenettvbox
      • media_player.tvliving
        from: paused
        to: playing
  • service: scene.turn_on
    target:
    entity_id: scene.voorpauze
    metadata: {}
    mode: single
    `
    I am using:
    SmartSelect_20221117_021829_Chrome

Logbook errors:
SmartSelect_20221117_022239_Chrome
SmartSelect_20221117_022215_Chrome

Can anyone help me with this please?

Thanks in advance!

Not working at HA 0.96.2

After updating the system to 0.96.2, the battery group is gone. Batteries are no longer automatically grouped together. I have just deleted all the entries and no battery is being created automatically as well

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.