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 when trying to get Week device history #172

Open
jonferreira opened this issue Oct 29, 2018 · 0 comments
Open

Error when trying to get Week device history #172

jonferreira opened this issue Oct 29, 2018 · 0 comments

Comments

@jonferreira
Copy link
Contributor

According to https://www.domoticz.com/wiki/Domoticz_API/JSON_URL%27s there's no support for week ranges any more (pretty sure there was before so presumably that was removed recently) so requests will fail with an error.

That said /json.htm?type=graph&sensor=temp&idx=IDX&range=day will return week results (yeah go figure why) so the fix is pretty simple in my opinion, just change to

 if (duration <= 172800) {
        range = "day";
    } else if (duration < 1209600) {
        range = "day";
    } else if (duration < 5270400) {
        range = "month";
    } else {
        range = "year";
    }

for now.

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

1 participant