Open dbusch78 opened 1 year ago
Hello @dbusch78 thanks for this very detailed issue! <3 Your feedback is noted, as soon as I've got some time to test it, I'll get back to you on this. I'm on holiday until ~September, I'm replying as I had to fix an urgent situation on #23.
Meanwhile, since you seem to have some ideas on how to tackle this issue, would you be willing to submit a PR? I think we could iterate on your proposal quicker. What do you think?
Hello there,
Congratulations on taking over the project. I really appreciate the ability to display my weather station's data on my website. I was pleased to discover that you are on GitHub, providing a platform for users to contribute and report bugs. I'm in Information Security as one of my Jobs so I hope this is complete and helps identify the issues.
Description:
I've noticed an issue in the file includes/traits/AmbientPluginBaseClient.php. The temperature data from extra modules ('temp' . $i . 'f') is being assigned to the 'temperature' key in the $device array. This seems to be overwriting the outdoor temperature data, resulting in the temperature from extra modules being displayed as the outdoor temperature.
I am using the Ambient Weather Station model WS-5000. However, based on a brief review of the API documentation from Ambient Weather, it appears that the API output might not be dependent on the model. Ambient Weather seems to have standardized the outputs and simply omits data if it doesn't exist for a particular model. I've only had this weather station for a few weeks.
Steps to reproduce:
Expected behavior:
The outdoor temperature and the temperatures from extra modules should be stored and displayed separately.
Actual behavior:
The temperature from extra modules is being displayed as the outdoor temperature.
Debug logs:
Here are the debug logs showing the API output with the correct values:
In the above output,
[tempf] => 68
is the correct outdoor temperature. However,[temp8f] => 100.9
is actually an additional module which is a Pool/Hot Tub Sensor with temperature only. The issue is that the temperature from this additional module is being displayed as the outdoor temperature.Suggested fix:
Consider storing the temperature and humidity data from extra modules in separate keys in the
$device
array to avoid overwriting the outdoor temperature and humidity data. For example:This would need to be done in the following section of code:
Please note that other parts of the codebase that interact with the
$device
array might need to be updated to handle these new keys.Full w/o commentary Debug logs:
Here are the debug logs showing the API output with the correct values: