Can I increase the shown integer of a EnergyMonitor from 2W to the actual 1.75W or maybe rounded up to one floatingpoint number like: 1.8W somehow?
Is this a custom-built web thing, or something else?
Ah, apologies for not declaring my title in the text more clear.
It’s not about webthing (for once) it’s about Gateway-Things-UI.
The blue bubbles have a one digit value. My Energy meter is more precise. Actually my power consumption is around 1.78W but Things-UI show 2W what is not precise and im asking if its possible to set the one digit to float of maybe two digits.
Like: 1.8W
I understand what you’re asking for, but I need to know what device type you’re using. If it’s a custom web thing you’ve built, you can add a "multipleOf": 0.1
or similar to the property. If it’s a commercial device which you’re using another add-on for, the add-on will need to be updated to do something similar.
Oh. It’s defined in the webthing! What a nice turn.
Yes it is my own built multithing property an it looks like this:
class vorraum_node(Thing):
"""A node in the entry of my house"""
def __init__(self):
self.id = 'urn:dev:ops:node_power'
self.name = 'node_power'
Thing.__init__(
self,
self.id,
self.name,
['EnergyMonitor'],
'A web connected node'
)
self.ina219 = ina219.INA219(busnum=0,address=0x40)
self.power = Value(0.0)
self.add_property(
Property(self,
'Power',
self.power,
metadata={
'@type': 'InstantaneousPowerProperty',
'title': 'Power',
'type': 'float',
'description': 'the power used by this node',
}
)
)...
I can not find that multipleOf
in the iot.mozilla.org/schemas/.
Where is that documented?
You’ll want to add 'multipleOf': 0.01
to the metadata
dict for your property.
multipleOf
is documented here: https://iot.mozilla.org/wot/#property-object