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

Single quotes in payload transformed to double quotes #561

Closed
calvinbui opened this issue Jan 16, 2025 · 0 comments · Fixed by #562
Closed

Single quotes in payload transformed to double quotes #561

calvinbui opened this issue Jan 16, 2025 · 0 comments · Fixed by #562
Labels
bug Something isn't working

Comments

@calvinbui
Copy link

calvinbui commented Jan 16, 2025

Describe the bug

This line is changing all single quotes (') in an MQTT payload to double quotes (").

This is causing issues with device names that have a apostrophe/single quote, like Calvin's Study Lights in Home Assistant, as the JSON has a double quote inside a value, { "name": "Calvin"s Study Lights" }.

Expected behavior

Device names should be kept as is. I don't have any issues with device names with single quotes/apostrophes in ZIgbee2MQTT.

image

Versions:

  • Home Assistant: 2024.1
  • Shellies Discovery GEN2: 3.9.2
  • Shelly device firmware: 1.4.4

Shellies Discovery GEN2 automations:

N/A ?

Shelly device MQTT settings:

Debug log:

Unable to parse JSON shelly1pmminig3-e4b32316c17c-ssid: 

{
  "name": "SSID",
  "en": "false",
  "uniq_id": "shelly1pmminig3-e4b32316c17c-ssid",
  "qos": 0,
  "dev": {
    "cns": [
      [
        "mac",
        "e4:b3:23:16:c1:7c"
      ]
    ],
    "ids": [
      "e4:b3:23:16:c1:7c"
    ],
    "name": "Calvin"s Study Lights",
    "mdl": "Shelly 1PM Mini Gen3",
    "mdl_id": "S3SW-001P8EU",
    "sw": "20241011-114450/1.4.4-g6d2a586",
    "hw": "gen3",
    "mf": "Allterco Robotics",
    "cu": "http://shelly1pmminig3-e4b32316c17c.local/"
  },
  "o": {
    "name": "Shellies Discovery Gen2",
    "sw": "3.9.2",
    "url": "https://github.com/bieniu/ha-shellies-discovery-gen2"
  },
  "~": "shelly1pmminig3-e4b32316c17c/",
  "avty": [
    {
      "t": "~online",
      "pl_avail": "true",
      "pl_not_avail": "false"
    },
    {
      "t": "~status/rpc",
      "val_tpl": "{%if value_json.mqtt.connected%}online{%else%}offline{%endif%}"
    }
  ],
  "val_tpl": "{{value_json.wifi.ssid}}",
  "stat_t": "~status/rpc",
  "icon": "mdi:wifi-settings",
  "ent_cat": "diagnostic"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant