NEWS
(Gelöst) Zeichenkette in Zahl umwandeln (Aqara/Deconz/Vibrationssensor/Winkel)
-
@paul53
00:04:59.382 info javascript.0 script.js.Garage_Offen_Zu: object{
"from": "system.adapter.deconz.0",
"user": "system.user.admin",
"ts": 1556892868113,
"common": {
"name": "Garagentor orientation",
"type": "string",
"read": true,
"write": false
},
"native": {},
"acl": {
"object": 1636,
"owner": "system.user.admin",
"ownerGroup": "system.group.administrator",
"state": 1636
},
"_id": "deconz.0.Sensors.34.orientation",
"type": "state"
} -
@muckel sagte:
object
Dann enthält er schon ein Array und muss nicht mehr gesplittet werden. Damit vereinfacht sich die Umwandlung:
setze Winkel auf nach Zahl in der Liste Wert nimm das 2. Element. -
@paul53
00:04:59.382 info javascript.0 script.js.Garage_Offen_Zu: object{
"from": "system.adapter.deconz.0",
"user": "system.user.admin",
"ts": 1556892868113,
"common": {
"name": "Garagentor orientation",
"type": "string",
"read": true,
"write": false
},
"native": {},
"acl": {
"object": 1636,
"owner": "system.user.admin",
"ownerGroup": "system.group.administrator",
"state": 1636
},
"_id": "deconz.0.Sensors.34.orientation",
"type": "state"
} -
@muckel sagte:
"type": "string",
Das garantiert nicht, dass der Wert tatsächlich einen String enthält. Wodurch wird der Wert des Datenpunktes geschrieben ?
-
-
Perfekt! Das wars! :relaxed:
Auf das wäre ich im Leben nicht gekommen. Danke schön.
Ich stelle es auf gelöst.CU and good night!
-
@muckel Wenn das Array bereits Zahlen enthält, kann die Konvertierung nach Zahl entfallen. Teste bitte:
setze Winkel auf in der Liste Wert nimm das 2. Element
debug output Typ von Winkel -
@muckel sagte:
Vom Deconz Adapter
Welche Version ?
Ich habe gesehen, dass in Version 1.1.0 bereits an einer Stelle "orientation" mit common.type: 'array' eingearbeitet wurde. -
@BBTown
So genau Funktioniert der Sensor nicht.
Das ist die Unschärfe. Möglicher Fehler: Garage nicht komplett zu oder auf.
Damit kann ich allerdings leben.
Ich könnte noch eine Abfrage machen mit dem Ergebnis „Nicht offen/nicht zu“
Aber das kommt nicht vor, da ich die Garage entweder ganz zu, oder ganz auf fahre.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login
