Skip to content

Shelly Plug password not being escaped properly for special characters #268

@Vardoger

Description

@Vardoger

Re https://github.com/geerlingguy/internet-pi/blob/master/example.config.yml#L25

When you use special characters in the 'shelly_plug_http_password' field, data from the Shelly plug will not be available to the Grafana Power Consumption dashboard.

Note #1: It does not matter where in the password the special character(s) are located.

Note #2: 'pihole_password' IS being escaped properly for special characters.

Steps to replicate:

  1. Set password in the Shelly Plug's interface as: $password
  2. Update config.yml --> shelly_plug_http_password --> "$password"
  3. Run 'ansible-playbook main.yml'
  4. Access power-consumption dashboard at http://piholeip:3030
  5. Power Consumption dashboard WILL NOT show data from the Shelly plug!
  6. Set password in the Shelly Plug's interface as: password
  7. Update config.yml --> shelly_plug_http_password --> "password"
  8. Run 'ansible-playbook main.yml'
  9. Access power-consumption dashboard at http://piholeip:3030
  10. Power Consumption dashboard WILL show data from the Shelly plug!!!

Testing with curl confirms data is available from the Shelly Plug with escaped characters in password.

curl http://shellylogin:[email protected]/meter/0
Result: "401 Unauthorized"

curl http://shellylogin:\[email protected]/meter/0
Result: {"power":3.23,"overpower":0.00,"is_valid":true,"timestamp":1635436041,"counters":[2.995, 2.991, 2.962],"total":23708}

(edited only to remove a redundant comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions