internet-pi icon indicating copy to clipboard operation
internet-pi copied to clipboard

Shelly Plug password not being escaped properly for special characters

Open Vardoger opened this issue 4 years ago • 1 comments

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)

Vardoger avatar Oct 28 '21 19:10 Vardoger

That field should work with special characters, so this is most definitely a bug. Hopefully something simple.

geerlingguy avatar Oct 28 '21 22:10 geerlingguy