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

Sensors based on output and returning frequency or power factor return 0 #19

Closed
darek-margas opened this issue Aug 26, 2021 · 1 comment · Fixed by #23
Closed

Sensors based on output and returning frequency or power factor return 0 #19

darek-margas opened this issue Aug 26, 2021 · 1 comment · Fixed by #23

Comments

@darek-margas
Copy link

As per subject - these sensors are auto-added and then value is 0 while iowatt reports output correctly.

Cheers,

@gtdiehl
Copy link
Owner

gtdiehl commented Aug 27, 2021

This appears to be an issue with the IoTaWatt Query and how the iotawattpy API is querying it.

Currently the API makes some assumptions as does not use a unit modifier, and lets the IoTaWatt query use the defaults. It appears this default is not working in some cases.

The API retrieves a list of inputs and outputs using two URLs
http://iotawatt/query?show=series
http://iotawatt/status?inputs=yes&outputs=yes

Both URLs do return the units for the input/output

For example, the URL being used now from the API side would be something like:
http://iotawatt/query?select=[pftest,Spa]&begin=d&end=s&group=all

For the above pftest output the output is configured with a unit of pf, though the default IoTaWatt is using in the query is watts which in turn the return value is 0 for that sensor.

Notice in the select array the name of the input/output is given. If the URL is changed to:
http://iotawatt/query?select=[pftest.pf,Spa.watt]&begin=d&end=s&group=all

We would get the correct value for the pftest output sensor. In the first two URLs above we do get the unit value from the IoTawatt. If we save the unit value (which I think we do already), and append the unit type to each of the sensors in the select array this should fix the issue.

This would need to be fixed in the iotawattpy library side through

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

Successfully merging a pull request may close this issue.

2 participants