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

http plugin ignores spaces in URI #14214

Closed
OnkelJudith opened this issue Jun 6, 2024 · 2 comments
Closed

http plugin ignores spaces in URI #14214

OnkelJudith opened this issue Jun 6, 2024 · 2 comments

Comments

@OnkelJudith
Copy link

Describe the bug

After upgrading from 0.126.4 to 0.126.6 my http plugin to read my power meter via a tasmota sensor is not working anymore. There is a decoded space in the URI which seems to be parsed incorrectly after upgrading.

Here is the correct answer from Tasmota:

{ "StatusSNS": { "Time": "2024-06-06T14:40:43", "LK13BE": { "total": 9737.9067, "total_1d": 2.9, "total_7d": 24.2, "total_30d": 110.3, "total_365d": 3720.8, "current": -1938, "total_out": 31763.1502 } } }

This is the answer of a GET request to http://192.168.2.139/cm?cmnd=Status (without %208) in the end -> this is also logged in trace mode, evcc ignores %208:

{ "Status": { "Module": 1, "DeviceName": "Tasmota", "FriendlyName": [ "Tasmota" ], "Topic": "/tasmota", "ButtonTopic": "0", "Power": 0, "PowerOnState": 3, "LedState": 1, "LedMask": "FFFF", "SaveData": 1, "SaveState": 1, "SwitchTopic": "0", "SwitchMode": [ 0, 0, 0, 0, 0, 0, 0, 0 ], "ButtonRetain": 0, "SwitchRetain": 0, "SensorRetain": 0, "PowerRetain": 0, "InfoRetain": 0, "StateRetain": 0, "StatusRetain": 0 } }

Steps to reproduce

  1. create a custom meter with http source including a uri with %20 as space
  2. run evcc in tracing mode

Configuration details

meters:
- type: custom # IR-Lesekopf Tasmota
  name: grid1
  power:
    source: http
    uri: http://192.168.2.139/cm?cmnd=Status%208
    method: GET
    headers:
        - content-type: application/json
    jq: .StatusSNS.LK13BE.current

Log details

[http  ] TRACE 2024/06/06 15:31:50 GET http://192.168.2.139/cm?cmnd=Status 8

[http  ] TRACE 2024/06/06 15:31:50 {"Status":{"Module":1,"DeviceName":"Tasmota","FriendlyName":["Tasmota"],"Topic":"/tasmota","ButtonTopic":"0","Power":0,"PowerOnState":3,"LedState":1,"LedMask":"FFFF","SaveData":1,"SaveState":1,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0,"InfoRetain":0,"StateRetain":0,"StatusRetain":0}}

[site  ] ERROR 2024/06/06 15:31:50 grid meter: strconv.ParseFloat: parsing "<nil>": invalid syntax

What type of operating system are you running?

Docker container

Version

0.126.6

@VolkerK62
Copy link
Contributor

#14175
is fixed in Nightly

@OnkelJudith
Copy link
Author

Oh great, didn‘t find this issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants