Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: The device name prefix will be stripped... #514

Closed
1mfaasj opened this issue Dec 15, 2023 · 2 comments
Closed

error: The device name prefix will be stripped... #514

1mfaasj opened this issue Dec 15, 2023 · 2 comments

Comments

@1mfaasj
Copy link

1mfaasj commented Dec 15, 2023

Describe the bug
I get this error many times with a couple of shelly devices.
Is this something I can fix?

Versions:

  • Home Assistant: 2012.12
  • Shellies Discovery: the latest version
  • Shelly device firmware: the latest version

Shellies Discovery automation:

part 1

alias: shelly discovery gen2 part 1
trigger:
  - platform: homeassistant
    event: start
  - platform: time_pattern
    hours: /1
action:
  - repeat:
      for_each: "{{ device_ids }}"
      sequence:
        - service: mqtt.publish
          data:
            topic: "{{ repeat.item }}/rpc"
            payload: "{{ device_info_payload }}"
variables:
  device_info_payload: >-
    {{ {'id': 1, 'src':'shellies_discovery', 'method':'Shelly.GetConfig'} |
    to_json }}
  device_ids:
    - ShellyKeukenLampKnop

part 2:

alias: shelly discovery gen2 part 2
description: ""
trigger:
  - platform: mqtt
    topic: shellies_discovery/rpc
action:
  - service: python_script.shellies_discovery_gen2
    data:
      id: "{{ trigger.payload_json.src }}"
      device_config: "{{ trigger.payload_json.result }}"
  - service: mqtt.publish
    data:
      topic: "{{ trigger.payload_json.result.mqtt.topic_prefix }}/command"
      payload: status_update
mode: queued
max: 999

About the device:
image

Debug log:

MQTT entity name starts with the device name in your config {'name': 'ShellyKeukenLampKnop Overtemperature', 'value_template': Template<template=({%if "overtemp" in value_json.get("errors",[])%}ON{%else%}OFF{%endif%}) renders=0>, 'enabled_by_default': True, 'unique_id': 'shellyplus1pm-0cdc7ef64af0-0-overtemp', 'qos': 0, 'device': {'connections': [['mac', '0C:DC:7E:F6:4A:F0']], 'name': 'ShellyKeukenLampKnop', 'model': 'Shelly Plus 1PM', 'sw_version': '20231031-152218/1.0.7-g5db02bd', 'hw_version': 'gen2 (SNSW-001P16EU)', 'manufacturer': 'Allterco Robotics', 'configuration_url': 'http://shellyplus1pm-0cdc7ef64af0.local/', 'identifiers': []}, 'origin': {'name': 'Shellies Discovery Gen2', 'sw_version': '2.22.0', 'support_url': 'https://github.com/bieniu/ha-shellies-discovery-gen2'}, 'availability': [{'topic': 'ShellyKeukenLampKnop/online', 'payload_available': 'true', 'payload_not_available': 'false'}, {'topic': 'ShellyKeukenLampKnop/status/rpc', 'value_template': Template<template=({%if value_json.mqtt.connected%}online{%else%}offline{%endif%}) renders=0>, 'payload_not_available': 'offline', 'payload_available': 'online'}], 'state_topic': 'ShellyKeukenLampKnop/status/switch:0', 'device_class': <BinarySensorDeviceClass.PROBLEM: 'problem'>, 'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>, 'payload_off': 'OFF', 'payload_not_available': 'offline', 'encoding': 'utf-8', 'availability_mode': 'latest', 'force_update': False, 'payload_available': 'online', 'payload_on': 'ON'}, this is not expected. Please correct your configuration. The device name prefix will be stripped off the entity name and becomes 'Overtemperature'
@1mfaasj 1mfaasj added the bug Something isn't working label Dec 15, 2023
@bieniu
Copy link
Owner

bieniu commented Dec 15, 2023

This is not a debug log, it's not even part of the log.

obraz

Please provide the entire log file.

@bieniu bieniu added needs-more-information and removed bug Something isn't working labels Dec 15, 2023
@bieniu
Copy link
Owner

bieniu commented Dec 15, 2023

Your issue is related to the gen2 Shelly device (Shelly Plus 1PM), wrong repository.

@bieniu bieniu closed this as not planned Won't fix, can't repro, duplicate, stale Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants