dehsgr / homebridge-mobilealerts

This is a homebridge plugin for several Mobile-Alerts (Technoline) devices
ISC License
9 stars 1 forks source link

Support for TFA Weatherhub sensor 30.3312.02 #13

Closed Qrizzz closed 4 years ago

Qrizzz commented 4 years ago

I use this temperature/humidity sensor from TFA for weatherhub.

The html part on measurements.mobile-alerts.eu looks like this

<div class="panel panel-default">
    <div class="panel-body">
        <div class="sensor">

<div class="sensor-header">
    <h3>
        <a href="/Home/MeasurementDetails?deviceid=0E07A1135B6C&amp;vendorid=DDE13514-8D30-4649-BBBE-6321864017C2&amp;appbundle=de.synertronixx.remotemonitor">Bad</a>
    </h3>
    <div class="sensor-component">
        <h5>ID</h5>
        <h4>0E07A1135B6C</h4>
    </div>
</div>

<div class="nofloat"></div>

    <div class="sensor-component">
        <h5>Zeitpunkt</h5>
        <h4>07.05.2020 11:50:33</h4>
    </div>
    <div class="sensor-component">
        <h5>Temperatur</h5>
        <h4>22,2 C</h4>
    </div>
    <div class="sensor-component">
        <h5>Luftfeuchte</h5>
        <h4>53%</h4>
    </div>
        </div>
    </div>
</div>

I am not too experienced in programming. As I understand your code uses the first two digits from the sensor ID as an integer. Unfortunately the TFA sensor ID starts with 0E, so the enums would be 0.

I somehow managed to get it working in my setup with enum 0 but I think this is not a very future-proof solution. How could this be done? With charCodeAt instead of parseInt?

If you give me a hint, I'll try to implement my sensors.

Qrizzz commented 4 years ago

Thank you! Works perfect.