balassy / MMM-RemoteTemperature

MagicMirror module that displays temperature from a remote sensor.
MIT License
15 stars 6 forks source link

Add Humidity Display #3

Closed cweinhofer closed 5 years ago

cweinhofer commented 5 years ago

Now that we have the FA5 issues taken care of, there were two other things I have been meaning to ask you about. Here's the first one (I'll post the second in a separate issue). I don't know how much time you have to work on this project, so feel free to close this if it isn't something you have the time for.

The sensor I use to send data to tmy MMM-RemoteTemperature module is both a temperature and humidity sensor. In order to display both on my MM I've jerry-rigged a solution by creating a second instance of the module to display the humidity and then used CSS to put the two together in a group. (I'm happy to send photos and/or code if that helps.)

Would it be difficult for you to add the option for the module to a humidity reading (in the same say it now supports an optional time)? I ask this knowing very little about javascript coding.

Given that dual temperature-humidity sensors are quite common, it could be a very helpful feature for people if the module supported both readings.

balassy commented 5 years ago

Actually it is not that difficult to implement. When I first created this module I was also thinking about it, but I did not think that people really care about humidity. Now that I have a sensor that measures humidity as well, I often found myself checking the measured value.

So yes, I will add it, and I believe I can do that in a backward compatible way.

If I would change the expected POST payload to this format, would that work with your sensor?

{
  "temp": 27,
  "humidity": 40.3,
  "sensorId": "1"
}
balassy commented 5 years ago

I'm happy to announce that I've released version 1.1.0, which supports displaying humidity information if data is provided by the sensor. Please check the updated README for more details. Hope you like it! :)

balassy commented 5 years ago

Resolved with commit 48d4364 in release v1.1.0. Please create new issue tickets if you experience any problem with the solution.