select.meshcore_discovered_contact This script no longer works after update?
Maintainers usually reply within 11 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- Half a day
- Newbie friendliness
- 18/100
Research direction
The failing script is a Home Assistant automation in YAML, and the payload does not show which integration code produces the adv_name or friendly_name attributes that changed after the update. Start by checking whether binary_sensor entities named like meshcore_*_contact still carry an adv_name attribute, then find where the integration sets attributes for discovered contacts. Done means the template renders without a NoneType error and the reporter's notify action runs.
Written by the indexing model from the issue text.
Description
triggers:
- trigger: state
entity_id: select.meshcore_discovered_contact
conditions: []
actions: - variables:
zoek_naam: " {% set mesh_contacts = states.binary_sensor | selectattr('entity_id', 'search', 'meshcore') | selectattr('entity_id', 'search', 'contact') | sort(attribute='last_changed', reverse=true) | list %} {% set test = mesh_contacts[0].attributes.friendly_name | replace('(Repeater)', '') | replace('(Client)', '') | replace('(Room Server)', '') %} {{ test }}"
zoek_clean: "{{ zoek_naam | lower | replace('', '') | replace(' ', '') }}"
gevonden_sensor: |
{% set sensors = states.binary_sensor
| selectattr('entity_id', 'search', 'meshcore')
| selectattr('attributes.adv_name', 'defined')
| list %}
{% set ns = namespace(found=none) %} {% for s in sensors %}
{% set sensor_clean = s.attributes.adv_name | lower | replace('_', '') | replace(' ', '') %}
{% if sensor_clean == zoek_clean %}
{% set ns.found = s.entity_id %}
{% endif %}
{% endfor %} {{ ns.found }} - if:
- condition: template
value_template: "{{ gevonden_sensor != 'None' }}"
then: null
- condition: template
- action: notify.mysql_command_example_db
metadata: {}
data:
message: |-
{% set
lat = state_attr(gevonden_sensor, 'latitude') %} {% set lon =
state_attr(gevonden_sensor, 'longitude') %}{% set ad =
state_attr(gevonden_sensor, 'last_advert_formatted') %}
INSERT INTO advert (id, naam, tijd, kanaal, bericht, locatie, afstand,
route, hops, snr, rssi, advert, type, typenode, datum, datumcontrole) VALUES ( '', '{{
zoek_naam }}', '{{ now().strftime("%Y-%m-%d %H:%M:%S") }}', '', '',
'https://www.google.com/maps/@?api=1&map_action=pano&viewpoint={{lat}},{{lon}}&heading=GETAL&pitch=GETAL',
'{% set km = distance(gevonden_sensor) | float(0) %} {{ (km * 1000) |
round(0) ~ " m" if km < 1 else km | round(2) ~ " km" }}', '', '',
'', '', '{{ ad }}', 'advert', '{{
state_attr(gevonden_sensor, "node_type_str") }}', '{{ now().strftime("%Y-%m-%d") }}', '{{ now().strftime("%Y-%m-%dT%H:%M:%S") }}'
);
mode: single
Fout: Error rendering data template: AttributeError: 'NoneType' object has no attribute 'lower'
Maybe the script wasn't well written, but it worked.
Do I need to access the contact details differently after the update?
- Dominant language
- Python
- Stars
- 269
- Forks
- 58
- Avg merge
- 10d 17h
- Merged PRs (30d)
- 12
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from meshcore-dev/meshcore-ha
-
Beta Tagging?Openquestion
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
meshcore-dev/meshcore-ha#365 · 1 comment ·
Maintainers usually reply within 11 days
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 60/100
meshcore-dev/meshcore-ha#196 · 3 comments ·
Maintainers usually reply within 11 days
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
meshcore-dev/meshcore-ha#432 ·
Maintainers usually reply within 11 days
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
meshcore-dev/meshcore-ha#426 ·
Maintainers usually reply within 11 days
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
meshcore-dev/meshcore-ha#420 · 1 comment ·
Maintainers usually reply within 11 days
All issues in meshcore-dev/meshcore-ha
Similar issues
-
docs(contributing): the two things that silently block a PRPossibly taken A pull request linked to this issue is open or already merged. Openavailable documentation good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 95/100
Nixitov/Riptide-Native#944 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
JTHCode/secretguard#24 ·
Maintainers usually reply within 1 day
-
area: middleware documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
omarelshamy25x/shamy-hijri#63 ·
Maintainers usually reply within 1 day