tim-hellhake / luftdaten-adapter

Mozilla Public License 2.0
0 stars 1 forks source link

Show sensor values in the device icon #3

Closed barts2108 closed 4 years ago

barts2108 commented 4 years ago

Right now the luftdaten sensor is a Custom Thing, while it consists of one ore more sensors "aus der reihe" PN2.5, PN10, Temperature and Humidity.

Would it be possible to make it so that the thing shows one of those values on the main screen ?

(kind of feature request)

tim-hellhake commented 4 years ago

Would it be possible to make it so that the thing shows one of those values on the main screen?

It depends. A device can advertise multiple capabilities. You can select which property you want to see by selecting the corresponding capability in the device view. There is a capability for the TemperatureSensor and a generic MultiLevelSensor capability for other values. I can only advertise one property for the MultiLevelSensor. If there are two values like PN2.5 and PN10 I would have to decide which one to use. Also, I need a min and a max value for the MultiLevelSensor.

I'll add the capability for the TemperatureSensor later but I'm not sure how to proceed with the other values.

barts2108 commented 4 years ago

(quite new to all this) I assume with "device view" you mean the page after pressing + on the Things page ? Then I have no possibility to select anything but custom view

I had some look around and see in a weather add-on what you mean with the TemperatureSensor and MultiLevelSensor. I guess this is currently a limitation of the core.

tim-hellhake commented 4 years ago

I assume with "device view" you mean the page after pressing + on the Things page ?

You can see it in multiple views. When you first add the devices you can select which capability should be the primary one.

image

You can also change it afterward if you click on edit.

The gateway renders the devices according to their primary capability. On the left, you can see what the TemperatureSensor looks like.

image

tim-hellhake commented 4 years ago

I added the TemperatureSensor capability for temperature values and the MultiLevelSensor capability for P1 (PM10) values.

With the new update it should look like this:

image

If you are more interested in the humidity values than in the temperature values I could add MultiLevelSensor capability for humidity values too. In case a Sensor has humidity and P1 values I would have to choose one of them though.

tim-hellhake commented 4 years ago

Btw. there is already an issue in the capability repo for a HumiditySensor:

mozilla-iot/schemas#30

As soon that would be implemented, you could decide whether you would like to see the temperature property or the humidity property. That would require changes in the gateway, though, as the UI needs a representation for every new capability.

barts2108 commented 4 years ago

Seen it. Its nice now to see the real values.

tim-hellhake commented 4 years ago

Is there anything left or can I close the issue?

barts2108 commented 4 years ago

Can be closed

tim-hellhake commented 4 years ago

Good :) If you have any ideas for improvement feel free to open another issue.