(07.07.2024, 11:57)CristianAgata Wrote:(07.07.2024, 11:05)arturfra Wrote:(07.07.2024, 10:45)CristianAgata Wrote:(07.07.2024, 09:09)arturfra Wrote: Hi,
i can't control my umidity sensors because home kit wants "scale" datatypes instead my sensors want "byte floating", how could i resolve the issue?? TNX in advance
Hi,
You need to create an event script for conversion using a virtual object.
tnx for reply, could you post an example ??
Try something like this:
Consider 1/1/1 the umidity value and 32/0/0 the virtual object for home kit
Event script on 1/1/1
Value = event.getvalue()
grp.update('32/0/0',(math.modf(Value)),dt.scale)
tnx indeed ! It works...
for reading the values OK but now i've to write the desidered humidity value and i've to convert from scale to floating byte, the opposite.. how i should go forward ? Tnx
i solved:
Value = event.getvalue()
grp.update('2/0/9',(math.modf(Value)),dt.float16)